File tree 3 files changed +21
-12
lines changed
shader_texturize_rainbowmap
3 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,6 @@ void main(void)
19
19
gl_Position = pvm_matrix* vertex_position;
20
20
21
21
frag_normal3 = view_model_normal_matrix3* vertex_normal3;
22
-
23
22
frag_texture_coord2 = vertex_texture_coord2;
24
-
25
23
frag_position3 = vec3 (view_model_matrix* vertex_position);
26
24
}
Original file line number Diff line number Diff line change 1
1
#version 150
2
2
3
- in vec2 rast_texture_coord;
3
+ in vec3 frag_vertex_normal3;
4
+ in vec2 frag_texture_coord2;
4
5
5
6
out vec3 frag_data;
6
7
7
- uniform sampler2D sampler ;
8
+ uniform sampler2D dataTexture ;
8
9
9
10
/* *
10
11
* computation of rainbow color map from
@@ -19,8 +20,12 @@ vec3 blend2ndOrder(vec3 f)
19
20
20
21
void main(void )
21
22
{
22
- float red_value = texture(sampler , rast_texture_coord).r;
23
- // red_value = rast_texture_coord.x;
23
+ // frag_data.xyz = vec3(0);
24
+ // frag_data.x = frag_texture_coord2.y;
25
+ // return;
26
+
27
+ float red_value = texture(dataTexture, frag_texture_coord2).r;
28
+ // red_value = frag_texture_coord2.x;
24
29
25
30
float limited_height = max (0.0 , min (1.0 , red_value));
26
31
#if 1
@@ -32,5 +37,7 @@ void main(void)
32
37
vec3 (3.0 )* (limited_height- vec3 (1.0 , 0.5 , 0.0 ))
33
38
);
34
39
#endif
40
+ // frag_data.z = 0;
41
+ // frag_data.xy = frag_texture_coord2;
35
42
return ;
36
43
}
Original file line number Diff line number Diff line change 1
1
#version 150
2
2
3
- in vec4 vertex_position;
4
- in vec2 vertex_texture_coord;
3
+ in vec4 vertex_position4;
4
+ in vec3 vertex_normal3;
5
+ in vec2 vertex_texture_coord2;
5
6
6
- out vec2 rast_texture_coord;
7
+ out vec3 frag_vertex_normal3;
8
+ out vec2 frag_texture_coord2;
7
9
8
10
uniform mat4 pvm_matrix;
9
- uniform mat4 normal_matrix;
11
+ // uniform mat4 normal_matrix;
10
12
11
13
void main(void )
12
14
{
13
- gl_Position = pvm_matrix* vertex_position;
14
- rast_texture_coord = vertex_texture_coord;
15
+ gl_Position = pvm_matrix* vertex_position4;
16
+
17
+ frag_vertex_normal3 = vertex_normal3;
18
+ frag_texture_coord2 = vertex_texture_coord2;
15
19
}
You can’t perform that action at this time.
0 commit comments