GL_TEXTURE_2D vs GL_TEXTURE_RECTANGLE

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GL_TEXTURE_2D vs GL_TEXTURE_RECTANGLE

elect
I have a little program that render a yellow triangle twice, once on the left half of a framebuffer and once on the right side.

Dump of the texture



Now, after that I render the content of this framebuffer on the screen

It works if I use GL_TEXTURE_RECTANGLE in the framebuffer constructor

https://github.com/elect86/Joglus/blob/master/Joglolus/src/joglus/example1/FrameBuffer.java

In binding the texture, function renderFullScreenQuad, line 372

https://github.com/elect86/Joglus/blob/master/Joglolus/src/joglus/example1/GlViewer.java

And using sampler2DRect in the fragment shader

https://github.com/elect86/Joglus/blob/master/Joglolus/src/joglus/example1/glsl/shaders/Distortion_FS.glsl

But if I change all the RECTANGLE to 2D and I use sample2D in the fs, I get a total black image at the end of the display(), although the dump of the texture shows always the correct image...

I would like to know why
Reply | Threaded
Open this post in threaded view
|

Re: GL_TEXTURE_2D vs GL_TEXTURE_RECTANGLE

elect
Reply | Threaded
Open this post in threaded view
|

Re: GL_TEXTURE_2D vs GL_TEXTURE_RECTANGLE

gouessej
Administrator
Thanks for the feedback.
Julien Gouesse | Personal blog | Website