Login  Register

Re: Problem with client-side textures

Posted by Sven Gothel on Aug 31, 2015; 11:50pm
URL: https://forum.jogamp.org/Problem-with-client-side-textures-tp4035179p4035208.html

On 08/31/2015 06:00 PM, opengltester [via jogamp] wrote:
> Hi,
>
> Yes I tried glActiveTexture and it makes no difference. In any case my
> understanding is that you use glActiveTexture for textures that have been
> pushed to a shader but glClientActiveTexture as in this sample. Perversely my
> shader-based code, which is more complex, works but this simpler class doesn't.

Its all written up in the API doc I have referenced.
Its mapped active-texture-unit -> texture-unit in shader code.
All texture states relate to the current active texture-unit!

In JOGL we also have a few texture unit tests w/ shader
and they all work just fine:

TextureDraw01ES2Listener:
<http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java;h=e29981bb5cbb1c0d32555779e2501b33c5786be9;hb=HEAD>

Vertex Shader:
<http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texture01_xxx.vp;h=1030dab4725980de44acbf32373a85b2f9cb6f07;hb=HEAD>

Fragment Shader:
<http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/texture01_xxx.fp;h=93f252cd67b9fc7077442e2ad236b70789c99a5a;hb=HEAD>

+++

Here is one used internally e.g. for rendering
and vertical flipping a previous rendered texture via FBO
as used in GLJPanel:

GLSLTextureRaster:
<http://jogamp.org/git/?p=jogl.git;a=blob;f=src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java;h=66c5c855b6205ece068de8572228c46d7d887096;hb=HEAD>

Its shaders:
<http://jogamp.org/git/?p=jogl.git;a=tree;f=src/jogl/classes/jogamp/opengl/shader;h=b93bf63564e2f89b0daf25096df11ca9d9f3d1a4;hb=HEAD>

+++

They all follow the same principles as laid out...

Maybe you want to play with this code while reading the
GL ES 2/3 or GL 3/4 core spec .. and become more familiar w/ it.

Hope it helps a bit.

~Sven


signature.asc (828 bytes) Download Attachment