From 297c48f4fefd1ab59800524ea5f0dd56684d6786 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 30 Sep 2023 01:28:59 +0200 Subject: Bug 1465 - Graph / GraphUI: Render a Region's ColorTexture in proper aspect-ratio, letter-boxed or zoomed (config) + Bug 1466 Fix color mixing Bug 1465: Region currently simply bloats a given texture to its region AABBox, which renders textures with the wrong aspect ratio. Add facility to program the texture-coordinates to either letter-box or scaled-up (and cut) true aspect-ratio. Default shall be zoom (scale-up and cut), but user shall be able to set a flag in the Region for letter-box. Have the shader clip texture coordinates properly, best w/o branching to soothe performance. See functions.glsl +++ Bug 1466: Current color mix: texture * color_channel * color_static is useless in GraphUI. color_static shall modulate the texture, which works. But in case of color_channel (attribute/varying) we want it to be mixed so it can become the more dominant color for e.g. a border. Desired is: color = vec4( mix( tex.rgb * gcu_ColorStatic.rgb, gcv_Color.rgb, gcv_Color.a ), mix( tex.a * gcu_ColorStatic.a, 1, gcv_Color.a) ); --- src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl') diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java index 7e3a7ff30..0927c41cb 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java @@ -631,6 +631,7 @@ public final class RegionRenderer { } try { + posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "functions.glsl"); posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "uniforms.glsl"); posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "varyings.glsl"); } catch (final IOException ioe) { -- cgit v1.2.3