Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for material constant types #8891

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

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.

None yet

1 participant