Skip to content

Adding time to a shader #520

Answered by asny
JohnPiwinski asked this question in Q&A
Discussion options

You must be logged in to vote

No problem. Simply define it in the shader and use the Program::use_uniform to send it to the shader each frame. It would probably be simpler if the Mandelbrot example didn't use a material (similar to the triangle_core example) but just send the uniform value in the MandelbrotMaterial::use_uniforms. You can either compute the time in that material or pass it in somehow to the material from the frame input. The name of the uniform is completely up to you.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JohnPiwinski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #519 on December 21, 2024 08:07.