From 9c71f276d1fcc87b69b413847fd1da34b30d0932 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 4 Apr 2014 02:30:00 +0200 Subject: Bug 801: Cleanup shader-program location/data update ; Add COLORTEXTURE + TextureSequence to Region (Demo: TextureButton) Cleanup shader-program location/data update - GLUniformData: - Allow lazy data setup, as used for RenderState.ProgramLocal, see below - RenderState - Separate data (pmv, weight, colorStatic) from program-local uniforms -> add class ProgramLocal. Reduces uniform location lookups, since ProgramLocal is bound to Region impl. - ProgramLocal.update(..) needs to write uniform data always, since data is being used in multiple programs! - No 'dirty' tracking possible, removed - see above. - RegionRenderer - Fix shader-selection: 2-pass programs differ from 1-pass! - No shader-setup at init +++ Add COLORTEXTURE + TextureSequence to Region - Create color-texture coords in vertex-shader via region's bounding box (pass-1) - Use color-texture unit in pass-1 if enabled (own shader program) - Use TextureSequence in Region impl. providing all required data (unit + texture-name) - Demo: TextureButton (a UIShape) --- src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl') diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java index 6a4b13dfb..3ac17b0c5 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java @@ -56,7 +56,7 @@ public class ShaderProgram { /** * returns the uniq shader id as an integer */ - public int id() { return id; } + public int id() { return id; } /** * Detaches all shader codes and deletes the program. @@ -321,7 +321,7 @@ public class ShaderProgram { private int shaderProgram = 0; // non zero is valid! private final HashSet allShaderCode = new HashSet(); private final HashSet attachedShaderCode = new HashSet(); - private int id = -1; + private final int id; private static synchronized int getNextID() { return nextID++; -- cgit v1.2.3