[x3d-public] does someone have a solution to multiple vertex shader files

doug sanden highaspirations at hotmail.com
Wed Apr 19 09:23:36 PDT 2017


No solution, maybe some insights and reiterate how we got here: not having a standard from the start.
-Doug

Freewrl has yet-different name prefixes fw_.
I haven't tried the gl_ convention. Freewrl runs on mobile with GLE2 (opengl es 2) and on desktop with what I call GLES2 subset of desktop opengl. Desktop opengl may be trying to set things like gl_ModelViewMatrix, I don't know what its doing. So when we did our own matrix stack for GLES2, we chose other non-competing names ie fw_ModelViewMatrix.
So while I like the gl_, x3d_ and no-prefix used by others, I'd need to try/confirm them in desktop opengl -make sure there are no collisions or bad side effects. 
I suppose if the prefixes were the only things different, when hooking up to / getting the addresses of uniforms, we could iterate over the most common prefixes ie x3d_, gl_, (no prefix) ...
Another idea is to have a uniform called web3dprefix in each shader, which would somehow tell us what the prefix is, if that's possible, and then the first uniform we would ask for is the web3dprefix, and then use that to get the addresses of rest of the uniforms.
-- That could get more complicated with shader parts and (proposed) Effect nodes/plugs
-- except plugs may be one way to abstract away some differences if parameter lists are agreed on
And for any of that to work we'd still need to agree on the rest/suffix of the most common uniform names, which might be easier than agreeing on the prefix.



________________________________________
From: x3d-public <x3d-public-bounces at web3d.org> on behalf of yottzumm at gmail.com <yottzumm at gmail.com>
Sent: April 18, 2017 1:23 PM
To: X3D Graphics public mailing list
Subject: [x3d-public] does someone have a solution to multiple vertex shader files

As an example, I am providing these vertex shaders (and the companion fragment shader, not F#) as the problem with X3D programmable shaders.  Can you help solve it?  Can I use an MFString?  Do I have to have an MFString entry for every single X3D vendor?  I’m so confused, I’m not sure any of this works.  I am going to try to replace all my vertex shaders with cobweb.vs to see if I can get one working.

Thanks,

John




More information about the x3d-public mailing list