Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Jhonnyg
Copy link
Contributor

@Jhonnyg Jhonnyg commented May 6, 2024

Currently Defold only supports setting and getting material constants via go.set / go.get - vec4 and mat4. We can now support a wider range of types with this system:

Numbers and vector types: float, vec2, vec3, vec4
Matrix types: mat2, mat3, mat4

Example:

// my_shader.fp
uniform vec2 mouse_pos;
uniform mat3 camera_rotation;
go.set("#model", "mouse_pos", vmath.vector3(self.mouse_x, self.mouse_y, 0))
go.set("#model" "camera_rotation", go.get_rotation(...))

@Jhonnyg Jhonnyg added feature request A suggestion for a new feature engine Issues related to the Defold engine labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine Issues related to the Defold engine feature request A suggestion for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants