PDA

View Full Version : texture2D weird behavior



kuja01
02-28-2013, 01:23 PM
Hello,
I'm implementing my own Phong shading without using opengl lights in opengl 2.0 (desktop, not ES).
Everything works fine but when I use texture2D things go a bit crazy.
Basically just calling texture2D changes the behavior of my shader and lights don't work in the way they do without texture2D.
On my machine I managed to solve this problem creating a function and calling texture2D inside this function instead of main. It doesn't make any sense to me but it works. On other machines this "solution" works randomly based on the machine.
Do you know if texture2D has some weird behavior in opengl 2.0?
Thanks!

tonyo_au
02-28-2013, 05:56 PM
Best post your shader; texture2D just effects the colour feed into the equations nothing else.

kuja01
03-02-2013, 11:36 PM
Never mind, the problem is fixed :) it was outside of the shader itself.
The fact that calling a function inside the shader was fixing it still does not make any sense at all but at least everything is working now!
Thanks.