jogamp
›
jogl
GL_TEXTURE_2D vs GL_TEXTURE_RECTANGLE
Posted by
elect
on
URL:
https://forum.jogamp.org/GL-TEXTURE-2D-vs-GL-TEXTURE-RECTANGLE-tp4032718.html
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
Free forum by Nabble
Edit this page