-
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
What is the benefit of separately listing the technique.parameters? #717
Comments
Looks like #92 could provide some history behind However I agree that current polymorphism of |
@mre4ce I had the same question in #92:
I think I've seen other formats combine uniforms and attributes into "parameters", but, as a GL developer, I find it awkward since they are so different. I believe the current design allows |
I'm in full agreement with the sentiment here. I have always thought that our design was unnecessarily elaborate. I would be in favor of going straight to attributes and uniforms in a future release. |
I think current complexity level gives almost no benefits, since it provides only 1:1 mapping. Maybe it would be better to split parameters into |
@lexaknyazev up to you how you want to handle this, e.g., try to design what is right for Vulkan/WebGL 2.0 right now, try to do something forward compatible, or just wait. If we want to start now, it would be good to see some example JSON for proposals. At least for GL (can't speak for Vulkan), I would stay with |
I think "attributes" and "uniforms" is fine for both OpenGL and Vulkan. I have a glTF loader for Vulkan setup and for uniforms I added:
Provided my setup is somewhat simplified because I only support the following uniform types:
The downside is that on many platforms the push constants are limited to 256 bytes. However, if you exceed that amount of data in your shader you should probably use an uniform buffer anyway. I also added:
The existing shader.uri could be renamed to shader.uriGlslOpenGL but I left the existing name for backwards compatibility. In general I'm not married to any of these names. |
@lexaknyazev @donmccurdy should this influence KHR_technique_webgl in the near-term? |
I think yes. |
Closing, since |
I looked through the existing issues and couldn't find a clear answer. Why is there a separate technique.parameters instead of directly listing the properties under each of technique.attributes and technique.uniforms. Currently technique.parameters can or cannot list properties based on whether the parameter is a unifom or vertex attribute. This seems to add unnecessary complexity, but maybe there's a good reason to have a separate list of parameters?
The text was updated successfully, but these errors were encountered: