-
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
Support for desktop OpenGL features #457
Comments
Thanks for the writeup. I agree there is a lot to add to glTF to take full advantage of OpenGL. You are welcome to propose extensions in this direction if you get to it before us. :) |
TransformFeedback does not require the Fragment Shader, hence this stage should be optional as well. This cannot be managed via extension. |
I believe vertex shaders are mandatory for any rendering operation. Fragment shaders are of course optional. Oh, and the single-file/multiple-stages thing will become especially important with SPIR-V. Not just because that will allow people to use whatever shading language they want. But because SPIR-V itself explicitly supports that style. |
I aggree, but my concern was about the glTf spec of a program which forces you to specify at least one vertex shader file and one fragment shader file.
And there is no way/token to specify either a binary SPIR-V or a multi-stage glsl text file. Morover, if such tokens would (will) be added the vertex shader must not be mandatory. |
To be fair, the OpenGL Shading Language does not provide support for a "multi-stage glsl text file". Some people may create such a thing via a pre-processing step, but that would be their own shader format, not GLSL.
I'm curious as to what the use case would be for a program that had no vertex shader. |
glTF has a |
@pjcozzi On second thoughts, if one wants to standardize file exchange, it makes sense to guarantee that data is correctly rendered. Best way is to ship the relevant shaders, so keep it. I have not considered profiles and this seems to be an elegant approach.
Let me correct you, OpenGL does not provide support for any kind of shader FILE. You create a shader (stage) with passing c-string(s) to glShaderSource (I guess it is similar with WebGL). Hence this "pre-process" is always involved just by opening and reading a file and converting to a string. A specification that a GLSL FILE must be this and that does not exist, this is already reflected in all the different file extensions in use like .vert, .frag, .vs, .fs, .vp, .fp, .glsl ... and in essence they are just all text files. I admit, one file per stage is the most common and straight forward to open and pass to the driver, but no-one forces you to use that path. That being said, I never argued that OpenGL does not need a vertex shader, the argument was about the glTF spec. Surely you agree that when a SPIR-V file is referenced in glTF file additional reference to a vertex and/or fragment file would be redundant.
Btw, I couldn't find any hint that SPIR-V can contain multiple shader stages, neither in the spec nor via google. However, I honestly hope you're right, but could you point me to your source please? Sorry for kind of hijacking this issue, but I feel it has relevance for glTF if OpenGL and Vulkan are supposed to be first class citizens. |
I'm well aware of that; perhaps you should look at the name on the accepted answer on that Stack Overflow question you cited ;) My point is that glTF data basically goes straight into OpenGL. And therefore, it needs to work the way OpenGL works. If OpenGL cannot accept a single string as being used for multiple shader stages, then glTF should not allow you to specify a single "file" that is used by multiple shader stages. GLSL does not have a way to take a single shader string and use part of it as the vertex shader and part as the fragment shader. Therefore, if glTF is going to allow you to do that, it would need to define a mechanism to detect which parts of a shader file/string/whatever-you-want-to-call-it were the vertex shader and which parts were the fragment shader. That's not something glTF ought to do.
Sorry for being so late with this, but my source is the SPIR-V specification itself.
All of these were explicit changes made to SPIR-V between older 0.99 versions and 1.0. Older SPIR-V versions only allowed multiple entrypoints in a module if your module used the Kernel execution model, and execution models were bound to a module, not an entrypoint. |
|
glTF 2.0 effectively obsoletes this bug, by going to a standardized surface description. Well, standardized once Appendix B is finished, that is ;) Most aspects of this bug are outside of the domain for glTF 2.0. We might benefit from a few more blend modes, but that can go into a more specific bug/feature request. |
I know that glTF is focused primarily on WebGL (based on GL ES 2.0). But what is the chance of getting more OpenGL support for desktop OpenGL 3.0+?
Rendering states are missing numerous recent features like:
Per-program settings are missing things like:
Technique parameters do not have the ability to:
There is a lot missing from glTF that desktop OpenGL is capable of doing. That makes glTF not really viable for desktop applications that are looking to yoke its strengths.
At the very least, glTF should support OpenGL ES 3.2-level features (which includes most of the above).
The text was updated successfully, but these errors were encountered: