Skip to content

Commit

Permalink
Modernize billboard.geom
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschmeisser authored and rhaschke committed Mar 25, 2022
1 parent a496ddd commit 5652545
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ogre_media/materials/glsl150/billboard.geom
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,24 @@ uniform mat4 worldviewproj_matrix;
uniform vec4 size;
uniform vec4 auto_size;

in gl_PerVertex {
vec4 gl_Position;
vec4 gl_FrontColor;
} gl_in[];
in VertexData {
vec4 color;
} vdata[];

out vec4 gl_TexCoord[];
// Use exactly these names to map onto gl_Color and gl_TexCoord used by fragment shaders
out vec4 color;
out vec2 TexCoord;

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

void emitVertex( vec3 pos_rel, vec3 tex )
{
pos_rel = mat3(inverse_worldview_matrix) * pos_rel;
vec4 pos = gl_in[0].gl_Position + vec4(pos_rel,0.0);
vec4 pos = gl_in[0].gl_Position + vec4(pos_rel, 0.0);
gl_Position = worldviewproj_matrix * pos;
gl_TexCoord[0] = vec4( tex.xy, 0.0, 0.0 );
gl_FrontColor = vec4( gl_in[0].gl_FrontColor );
TexCoord = tex.xy;
color = vdata[0].color;
EmitVertex();
}

Expand Down

0 comments on commit 5652545

Please sign in to comment.