indiesoftby / defold-scene3d

Scene3D is a collection of scripts, materials and tools to help you develop 3D games with the Defold game engine.
https://indiesoftby.github.io/defold-scene3d/
MIT License
148 stars 10 forks source link
3d 3d-graphics defold defold-library defold-shaders game-development

Scene3D Cover

Scene3D - make 3D games with Defold

Scene3D is a collection of assets to help you developing 3D games with the Defold game engine. Use included prefabs to quickly prototype structures, levels, and to test game mechanics. Try out ideas quickly!

The built-in example scene is available ✨to play online✨. Controls:

Follow further developments:

Showcase

Merge Getaway

Key features

Included Assets (i.e. Prefabs)

Debugging

Buildings

Environment

Icons

Primitives

Props

Visual Effects

Materials

Some materials have a tint from the palette: #687378 Nickel, #d9d9d3 Timberwolf, #38b2cb Pacific Blue, #0baaad Verdigris, #94d2bd Middle Blue Green, #e9d8a6 Medium Champagne, #ffcd70 Maximum Yellow Red, #fd905e Atomic Tangerine, #ef766b Salmon, #e2797d Candy Pink.

Included shaders don't apply gamma correction.

Current Status

⚠️ Work in progress ⚠️

How To Use

Before You Start

Scene3D uses the metric system, i.e. metres as its default unit for measuring distance/length, i.e. 1 unit is 1 meter.

Installation

Use it in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add the link to the ZIP file.

Required Dependencies

Optional Dependencies

Scene3D can use the following dependencies if you include them in your project:

Included Scenes

math3d.lua

The table briefly describes the included helper math functions. The source code of math3d.lua has more detailed explanation.

Lua Function Description Corresponding Unity API
Quaternions
math3d.euler_x(q) Returns the Euler angle representation of a rotation, in degrees - X. Quaternion.eulerAngles.x
math3d.euler_y(q) Returns the Euler angle representation of a rotation, in degrees - Y. Quaternion.eulerAngles.y
math3d.euler_z(q) Returns the Euler angle representation of a rotation, in degrees - Z. Quaternion.eulerAngles.z
math3d.quat_inv(q) Returns the inverse of rotation. Quaternion.Inverse
math3d.quat_look_rotation(forward, upwards) Creates a rotation with the specified forward and upwards directions. Quaternion.LookRotation
Math
math3d.clamp(x, min, max) Clamps the given x between the given minimum float and maximum float values. Mathf.Clamp
math3d.clamp01(x) Clamps x between 0 and 1 and returns value. Mathf.Clamp
math3d.delta_angle(a, b) Calculates the shortest difference between two given angles (in degrees). Mathf.DeltaAngle
math3d.inverse_lerp(t, a, b) Calculates the lerp parameter between of two values. Mathf.InverseLerp
math3d.lerp(t, a, b, [dt]) Linearly interpolates between a and b by t. The parameter t is clamped to the range [0, 1]. Mathf.Lerp
math3d.lerp_angle(t, a, b, [dt]) Same as vmath.lerp but makes sure the values interpolate correctly when they wrap around 360 degrees. Mathf.LerpAngle
math3d.limited_lerp(t, a, b, max_step) Same as vmath.lerp but max_step limits the increment of value. -
math3d.move_towards(a, b, max_delta) Moves the a value towards b. Mathf.MoveTowards
math3d.ping_pong(t, length) Pingpongs the value t, so that it is never larger than length and never smaller than 0. Mathf.PingPong
math3d.repeat_(t, length) Loops the value t, so that it is never larger than length and never smaller than 0. Mathf.Repeat
math3d.sign(x) Returns the sign of x. Mathf.Sign
math3d.smooth_step(x, min, max) Interpolates between min and max with smoothing at the limits. Mathf.SmoothStep
math3d.smooth_damp(a, b, cur_velocity, smooth_time, max_speed, dt) Gradually changes a value towards a desired goal over time. Mathf.SmoothDamp
math3d.smooth_damp_angle(a, b, cur_velocity, smooth_time, max_speed, dt) Gradually changes an angle given in degrees towards a desired goal angle over time. Mathf.SmoothDampAngle
Camera
render3d.screen_to_world(x, y, z, [world_coord]) Transforms a point from screen space into world space. Camera.ScreenToWorldPoint
Noise
scene3d.simplex_noise2(x, y) Generates 2D Perlin noise. Output range is [0, 1]. Mathf.PerlinNoise

Known Issues

Optimization

TODO

... Add information about the over-use of scripts and how to optimize them. ... Add info about shaders optimization, downsizing meshes buffers.

Vote For The Issues

The following issues are critical for the further development of Scene3D. Please put πŸ‘πŸ‘πŸ‘ on them!

Editor Issues

Contributing to Scene3D

πŸ‘πŸŽ‰ First off, thanks for taking the time to contribute! πŸŽ‰πŸ‘

Scene3D tries to follow the principles:

When creating a bug report, please include as many details as possible. If you find a Closed issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.

Please, follow code formatting style of the project:

Credits

Artsiom Trubchyk (@aglitchman) is the current Scene3D owner within Indiesoft and is responsible for the open source repository.

Contributors

  1. Brian Kramer (@subsoap)
  2. Be the next!

License

The content and sources are licensed under the MIT license.

Third-Party Licenses & Acknowledgements