pi3d: issues with Shader?


4 posts
by Tom Swirly » Sat Nov 24, 2012 10:37 pm
So I'm looking to redo shader so it's also in our new world, but I ran into some trouble.

Issue 1 is that it really appears to be two separate shaders glued together. We should instead create a single shader, and then a way to combine multiple shaders together.

Issue 2 is that it seems as if one of the input parameters is essentially being ignored - instead we're using the hardcoded self.vshader_source.

Issue 3 is that there doesn't seem to be a way to remove a shader from a program!

I have to say that I also don't understand the role of the "uniform tex1 and tex2" referred to here.
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by paddyg » Sat Nov 24, 2012 11:39 pm
Tom, this sounds like the old (non opengl ES 2.0) shader? I think the new system differs in quite a few ways so maybe better to either leave this till later or bite the bullet and star the integration process to ES2. I would say at this stage to get the threading and program control sorted then go back and re-hack to fit in the shader orientated system for ES2.

In the new form there is facility to load as many textures as you want and they get assigned references tex0, tex1, tex2 etc they are type uniform because they don't change from vertex to vertex (in the vertex shader) or pixel to pixel (in the fragment shader) At the moment I have successfully used tex0 for the texture and tex1 for a kind of normal map. This now looks quite good, I've sorted out the normals for the elevation map, got proper rotation of the normal map and made it attenuate with distance. I don't think it will be difficult to get fog, blur and shininess to work
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d
User avatar
Posts: 1080
Joined: Sat Jan 28, 2012 11:57 am
Location: Bingley, Yorkshire
by Tom Swirly » Sun Nov 25, 2012 4:24 am
Awright, I'm going to leave it alone for the moment then!

We're not actually in any sort of rush so any time I can avoid extra work by waiting until the final form appears, the better...
Posts: 160
Joined: Tue Sep 25, 2012 1:08 am
by paddyg » Mon Nov 26, 2012 2:08 pm
Some progress on the open gl ES 2.0 shader here http://www.youtube.com/watch?v=CeNQq1yNMCw reflection map is better than in the video now but still a bit 'lumpy'
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d
User avatar
Posts: 1080
Joined: Sat Jan 28, 2012 11:57 am
Location: Bingley, Yorkshire