Question

I am trying to see if my texture coming in to my shader.

I am have the following code so far but I need to know if my texture is coming in to my fragment shader or not.

Is it even possible to test that?

Thanks for the answers already

sampler2D activeTex;

float screenwidth = 1024;
float screenheight = 1024;

float x= gl_FragCoord.x/screenwidth;
float y= gl_FragCoord.y/screenheight;
float z= gl_FragCoord.z;
Was it helpful?

Solution

If you just want to see the content of your texture, you could copy it to your default framebuffer using glBlitFramebuffer. Since you created it by using it as a render target, it's probably attached to an FBO already. Make that FBO your read framebuffer, set the draw framebuffer to the default framebuffer (both using glBindFramebuffer), and then call glBlitFramebuffer to copy it.

Myself, I would just use a minimal shader using the texture, and render. But the above is an alternative if you have problems with your shaders.

Is the code fragment you copied your entire fragment shader? It's missing a main() function, among other things.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top