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

Implement global and per instance shader uniforms. #37949

Merged

Conversation

reduz
Copy link
Member

@reduz reduz commented Apr 17, 2020

image
image

Adds two keywords to shader language for uniforms:
-'global'
-'instance'

This allows them to reference values outside the material.

Bugsquad edit: closes godotengine/godot-proposals#257, closes #18848, closes #30375

Copy link
Member

@Chaosus Chaosus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some Travis error messages about fallthrough should be fixed (its easy), otherwise looks ok...

@Schroedi
Copy link
Contributor

Per instance uniforms sound like instance parameters for MultiMeshInstances: https://docs.godotengine.org/en/3.2/tutorials/3d/using_multi_mesh_instance.html

I guess this is not what they are meant for, or can they be used there as well?

@reduz reduz force-pushed the implement-global-shader-uniforms branch from 9030c7e to 80d2c87 Compare April 17, 2020 13:24
@reduz
Copy link
Member Author

reduz commented Apr 17, 2020

Oh just as a side note, per instance uniforms are not working for 2D (CanvasItems) because I could not find a way to implement them. I am planning to eventually rewrite the 2D rendering code to make it more efficient before 4.0 is out, now that I am more proficient with Vulkan so I will properly implement those there.

@reduz reduz force-pushed the implement-global-shader-uniforms branch from 80d2c87 to e3e0e88 Compare April 17, 2020 14:38
Adds two keywords to shader language for uniforms:
-'global'
-'instance'

This allows them to reference values outside the material.
@reduz reduz force-pushed the implement-global-shader-uniforms branch from e3e0e88 to 0e1c66d Compare April 17, 2020 15:35
@akien-mga akien-mga merged commit 17304f1 into godotengine:master Apr 17, 2020
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment