-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Optionally check if all uniform values have been set #1681
Comments
Hey, I think I'll try this issue out. |
Hey ! can i try this issue too ? |
@yukirine Yes, you can! |
Hi, I’d love to contribute to this! I was wondering if it would be appropriate to call the |
@ZzzhHe We would probably want to avoid this (even in debug mode) because the render loop should be as fast as possible and adding sanity checks could slow it down substantially. I think the best place to call the function is in the code of the several demos that we have, see https://github.com/SFTtech/openage/tree/master/libopenage/renderer/demo |
@heinezen Thanks! I get it. Working on it. |
I’ve implemented an |
@ZzzhHe Yes, that would make sense! |
Required Skills: C++ (understanding OpenGL terminology is helpful too)
Difficulty: Easy
Whenever we want to change something in the shader for an object, we use a
UniformInput
object to store the values. When the object is rendered, the data from the uniform input is passed to the GPU, e.g. via OpenGL. The definitions of the uniform data rypes are stored in theShaderProgram
class.During rendering, the GPU does not strictly require that all uniform values have to be set for rendering to happen. However, when a uniform value is not set, e.g. when someone forgets to set pass it to the uniform input, this often leads to rendering errors, or worse: nothing being rendered at all. This is often infuriating to debug as it not always clear from the start whether the value was just forgotten or another error produces the rendering problems. To mitigate these issues, we should add a way to check if all uniform values for a uniform input have been set.
To try out the renderer and see how setting uniform values work, check out renderer demo 4 by running the following command:
Tasks:
is_complete(..)
method forGlUniformInput
that checks if all uniform values have been set. You can accomplish this easily by iterating through theupdate_offs
vector and testing if theused
flag has been set.is_complete(..)
checks to the renderer demos in https://github.com/SFTtech/openage/tree/master/libopenage/renderer/demoFurther Reading
The text was updated successfully, but these errors were encountered: