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

[idea / wip] - ofShader::setUniformBufferObject to easily pass a struct to a shader #8097

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dimitre
Copy link
Member

@dimitre dimitre commented Aug 29, 2024

relevant discussion: https://forum.openframeworks.cc/t/multiple-lights-limit-with-opengl-3-2-how-to-increase/43777/26

usage example:

shader.setUniformBufferObject("vars", &customVars, sizeof(customVars));

PS: not static yet

What do you think @NickHardeman ?

@NickHardeman
Copy link
Contributor

Should probably be wrapped in the defines next to getUniformBlockIndex, getUniformBlockBinding, etc.
I don't have much experience with Uniform Blocks, so would be good to test with openGL ES. Testing with Emscripten would be helpful. Could be wrapped in

#if !defined(TARGET_OPENGLES) || defined(TARGET_EMSCRIPTEN)
#ifdef GLEW_ARB_uniform_buffer_object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants