[GEM-dev] Re: GEM shader usage

james tittle tigital at mac.com
Tue Oct 18 16:08:03 CEST 2005


On Oct 18, 2005, at 7:27 AM, IOhannes m zmoelnig wrote:

> Tebjan Halm wrote:
>> ... and which shader language is supported ind gem ?
>
> currently just ARB-shaders (and in theory NVSL)
> so no Cg and no GLSL; i am currently thinking about how GLSL would  
> be best integrated (which pd-object set would be nice); once i have  
> figured that out, it should be done pretty quick.

...as ya might've guessed, I'm already into a coupla drafts of a glsl- 
based [shader_program]...the first try was simply to mimic what I did  
for the ARB programs, but then I found that glsl is different in that  
you compile programs to objects, then link those objects into a  
shader, which then can be used when needed...another twist is that  
while one does need to specifiy whether the program is vertex or  
fragment when creating a shader object, you can actually just link  
together vertex and fragment shader objects for the final shader:   
discovered this looking at some of the latest nvidia sample code  
(specifically gpu_videoeffects)...

...so, I think this means we should just have one [shader_program]  
that can accept one or two names as arguments (vertex shader followed  
by fragment?), but we would then need some mechanism to determine  
which one is the vertex or fragment shader...so, I've been just going  
ahead with making it a message based object, such that you send a  
[vertex nameOfVertexShader< and/or [fragment nameOfFragShader< to the  
[shader_program]...then the shader_program will try to link together  
whatever it has, report what happens, and go on from there...

...how's this sound?

jamie




More information about the GEM-dev mailing list