-
Notifications
You must be signed in to change notification settings - Fork 53
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
[OGRE 1.x] Uniform buffer shader support #294
[OGRE 1.x] Uniform buffer shader support #294
Conversation
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: WilliamLewww <[email protected]> Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some style issues
Co-authored-by: Alejandro Hernández Cordero <[email protected]> Signed-off-by: William Lew <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice demo. I have a few style suggestions.
ogre
works fine but I get a crash with ogre2
though
I only worked with the |
Signed-off-by: William Lew <[email protected]>
ok thanks. If it's not trivial to fix, we can ticket an issue first. But I think we should at least print an error msg and have the demo exit gracefully. |
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Signed-off-by: William Lew <[email protected]>
Implementing uniform buffers in OGRE2 requires a little more work than expected. Currently only the PBS Hlms is implemented but custom shaders require the LowLevel Hlms implementation. I will see if I can implement the two other Hlms (Unlit and LowLevel), but they would probably need their own separate pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Windows PR is yet a draft but I think it makes sense to include here at least the right variables and includes.
Signed-off-by: William Lew <[email protected]>
…ign-rendering into wlew/extend_shader_support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some code check errors. Can you run sh tools/code_check.sh
from the ign-rendering dir and and address the issues related to your changes?
Signed-off-by: William Lew <[email protected]>
Uniform Buffer Shader Support
Related Issue #24
Summary
Currently only INT and FLOAT uniforms are encoded with ShaderParam. The new uniform buffers take advantage of OGRE's following method:
void Ogre::GpuProgramParameters::setNamedConstant(const String& name, const int* val, size_t count, size_t multiple = 4)
Any uniform buffer with a type size of 4 bytes will be available to update and use in a shader program.
Test it
Build and run the example custom_shaders_uniforms
To-do
Checklist
codecheck
passed (See contributing)