fragment

How to not overwrite a models texture with the glsl fragment shader

jrs's picture

Hi All,

How do I keep glsl from overwriting the texture details that get loaded with a model? I've attached an example composition where I texture the teapot with its image port. This works fine outside a shader but as soon as I place it inside my model goes white.

Apart from having a search on the web and not being able to find it I came across this thread - https://kineme.net/Discussion/GeneralDiscussion/Fisheyeviewplugin

which at one stage talks about the same thing. Chris mentioned adding the following to the vertex shader:

gl_FrontColor = gl_Color;

And the following to the fragment shader

gl_FragColor = gl_Color;

but it doesn't work. I get the feeling this is something simple and easy but I just can't see where I'm going wrong

Cheers James