Skip to content

Commit f085bc6

Browse files
Martin SchreiberMartin Schreiber
Martin Schreiber
authored and
Martin Schreiber
committedNov 18, 2016
Added shader modifications
1 parent f3da05f commit f085bc6

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed
 

‎data/shaders_glsl/shader_blinn/vertex_shader.glsl

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ void main(void)
1919
gl_Position = pvm_matrix*vertex_position;
2020

2121
frag_normal3 = view_model_normal_matrix3*vertex_normal3;
22-
2322
frag_texture_coord2 = vertex_texture_coord2;
24-
2523
frag_position3 = vec3(view_model_matrix*vertex_position);
2624
}

‎data/shaders_glsl/shader_texturize_rainbowmap/fragment_shader.glsl

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#version 150
22

3-
in vec2 rast_texture_coord;
3+
in vec3 frag_vertex_normal3;
4+
in vec2 frag_texture_coord2;
45

56
out vec3 frag_data;
67

7-
uniform sampler2D sampler;
8+
uniform sampler2D dataTexture;
89

910
/**
1011
* computation of rainbow color map from
@@ -19,8 +20,12 @@ vec3 blend2ndOrder(vec3 f)
1920

2021
void main(void)
2122
{
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;
2429

2530
float limited_height = max(0.0, min(1.0, red_value));
2631
#if 1
@@ -32,5 +37,7 @@ void main(void)
3237
vec3(3.0)*(limited_height-vec3(1.0, 0.5, 0.0))
3338
);
3439
#endif
40+
// frag_data.z = 0;
41+
// frag_data.xy = frag_texture_coord2;
3542
return;
3643
}
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
#version 150
22

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;
56

6-
out vec2 rast_texture_coord;
7+
out vec3 frag_vertex_normal3;
8+
out vec2 frag_texture_coord2;
79

810
uniform mat4 pvm_matrix;
9-
uniform mat4 normal_matrix;
11+
//uniform mat4 normal_matrix;
1012

1113
void main(void)
1214
{
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;
1519
}

0 commit comments

Comments
 (0)
Please sign in to comment.