Leadwers engine?

Miscellaneous Forums/General Discussion/Leadwers engine?

I think a Basic shading language is a bad idea. I initially thought it would be cool, but there are a few problems.

There are many things in GLSL that have no correlation to anything in BASIC. What is the BASIC equivalent to a varying? A uniform? There is none.

Most shader code relies heavily on overloaded vector objects, which have no BASIC equivalent. You could support these in your pseudo-language, but it keeps looking less and less like BASIC and more like an unnecessary variation on GLSL.

GLSL has a lot of niggles that a CPU language doesn't. Things like dynamic loops are not possible or not supported on <SM4.0 hardware. Or for example it is not allowed to get a value from an output variable like gl_FragColor.

So the end results would be something like the following.

GLSL:
uniform float appTime;

void Main() {
vec4 pos = ModelViewMatrix * gl_Vertex;
gl_Position = pos;
#ifdef _GLSL_CG_TYPE
gl_ClipVertex = pos;
#endif
}


BASIC SL:
uniform appTime#

Function Main()
Local pos:TVec4
pos = ModelViewMatrix * gl_Vertex
gl_Position = pos
#ifdef _GLSL_CG_TYPE
gl_ClipVertex = pos
#endif
EndFunction

So instead of making your shader code cleaner and more compact, it just makes it nonstandard and confusing, being neither BASIC nor GLSL. Not really worth it, in my opinion.