A HLSL doesn’t give you any more power over the hardware than the assembly style shaders we write today. Does that mean the HLSL doesn’t belong?
Oddly, I’m not particularly in favor of having glslang being part of the GL2.0 core either.
Allowing state-set’s and shading language code to be abstracted from the rendering process is the next logical extension.
Some people say that it is a good idea to have GL handle collision detection and any number of other concepts that have no buisness being in a low-level graphics library. Saying it doesn’t make it the “next logical extension.”
The only thing I find at all appealing about glslang being part of the GL2.0 core is that I know that it allows implementations enough flexibility to compile the shader program into something that is properly accelerated on their hardware.
As far as being useful, I have a use for it, as do many people I know.
Would that use be, “Passing a canned effect around and using it in places that it wasn’t directly designed for?”
OK, so you have a nice, canned shader that takes a mesh and draws it with a wood-look to it. What happens when you want to create “wood-man” that requires a skinned shader instead of a regular model-to-view-to-projection shader to produce vertex output? Or, maybe I want to take an effect that renders regular bump maps via tangent-space bump mapping, and add specular characteristics?
In all these cases, you not just downloading an effect from the internet and using it. You’re trying to integrate some new effect into your already existing shaders. This is the area where problems arise far more than having some shader format that allows the storage and access of multiple shaders and some required/requested state changing.
Lastly, in the future, “FX” stuff will be less important for getting things done. You’re not going to have the issues of needing multiple shaders for “fallback” hardware. And if the shading language defines transparent multipass (which is the correct way to get the functionality you want), the only thing the FX stuff provides is a slightly convienient place to put your state changes. You won’t even see a performance increase out of it.
Also, let’s not forget that putting state changes in a shader will cause any number of debugging problems. If you can’t find the code that says, “glDisable(*)”, you may just assume it was never disabled. Of course, since a shader can do it, you now have to make sure to search shaders for the occurance of *.
Having to write all the scripting and parsing crap just to support somethign similar to this in your own code is just a pain in the ass. This should be core.
Having to write all that model and texture parsing crap is a pain in the ass too. Maybe those should be part of the core as well. Maybe OpenGL should ship with the Doom 3 engine built in, too.
You have to draw a line. And just because it might be nice or convienient to have a feature be implemented by somebody else isn’t sufficient to make it part of the GL core. You’ve already got a library (Cg) that implements it; why is there the need to make it core GL?
I think the point Dr^Nick is trying to make is that these “material characteristics” often belong in the “art pipeline” along with the shaders.
First, I don’t see turning on/off depth writes as being a “material characteristic” that I would ever want my artists touching.
Secondly, any material characteristics that a shader uses are either per-vertex/fragment constants already hard-coded into a shader, or are bound implicitly to programmer-defined state. The latter requires programmer intervention to connect the two, and the former doesn’t need the FX stuff.
It may not always be the case, but if the High-level State Setting system isn’t made Core, it can’t enjoy the optimization benefits it deserves.
Which is the only argument that makes this concept even close to reasonable. I still don’t like the idea, as it is too high-level for something like OpenGL. And I’m not entirely convinced that the performance gains will be significant enough to warrent the violation of a low-level interface.