aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1.vp
blob: b9974b97db52721cf064a641e50c8c77aa898552 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2010-2023 JogAmp Community. All rights reserved.

#if __VERSION__ >= 130
  #define attribute in
  #define varying out
#endif

#include uniforms.glsl
#include attributes.glsl
#include varyings.glsl

void main(void)
{
    gl_Position = gcu_PMVMatrix02[0] * gcu_PMVMatrix02[1] * gca_Vertices;
#if 1
    gcv_CurveParam = gca_CurveParams;
#else
    if( gcv_CurveParams.x <= -10.0 ) {
        // vec4 tc = gcu_PMVMatrix02[0] * gcu_PMVMatrix02[1] * vec4(gca_CurveParams.xy, gca_Vertices.z, 1);
        // gcv_CurveParams = vec3(tc.xy, gca_CurveParams.z);
        gcv_CurveParam = gca_CurveParams;
    } else {
        gcv_CurveParam = gca_CurveParams;
    }
#endif
#ifdef USE_AABBOX_CLIPPING
    gcv_ClipBBoxCoord = (gcu_PMVMatrix02[1] * gca_Vertices).xyz; // Mv
#endif    
    
#ifdef USE_COLOR_TEXTURE
    gcv_ColorTexCoord = ( gca_Vertices.xy - gcu_ColorTexBBox[0] ) / ( gcu_ColorTexBBox[1] - gcu_ColorTexBBox[0] );
#endif
#ifdef USE_COLOR_CHANNEL
    gcv_Color = gca_Colors;
#endif
}