Skip to content

Commit 5652545

Browse files
simonschmeisserrhaschke
authored andcommitted
Modernize billboard.geom
1 parent a496ddd commit 5652545

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

ogre_media/materials/glsl150/billboard.geom

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,24 @@ uniform mat4 worldviewproj_matrix;
1919
uniform vec4 size;
2020
uniform vec4 auto_size;
2121

22-
in gl_PerVertex {
23-
vec4 gl_Position;
24-
vec4 gl_FrontColor;
25-
} gl_in[];
22+
in VertexData {
23+
vec4 color;
24+
} vdata[];
2625

27-
out vec4 gl_TexCoord[];
26+
// Use exactly these names to map onto gl_Color and gl_TexCoord used by fragment shaders
27+
out vec4 color;
28+
out vec2 TexCoord;
2829

2930
layout(points) in;
3031
layout(triangle_strip, max_vertices=4) out;
3132

3233
void emitVertex( vec3 pos_rel, vec3 tex )
3334
{
3435
pos_rel = mat3(inverse_worldview_matrix) * pos_rel;
35-
vec4 pos = gl_in[0].gl_Position + vec4(pos_rel,0.0);
36+
vec4 pos = gl_in[0].gl_Position + vec4(pos_rel, 0.0);
3637
gl_Position = worldviewproj_matrix * pos;
37-
gl_TexCoord[0] = vec4( tex.xy, 0.0, 0.0 );
38-
gl_FrontColor = vec4( gl_in[0].gl_FrontColor );
38+
TexCoord = tex.xy;
39+
color = vdata[0].color;
3940
EmitVertex();
4041
}
4142

0 commit comments

Comments
 (0)