Skip to content

Commit

Permalink
chore: Fix formatting of vertex shader (#3280)
Browse files Browse the repository at this point in the history
Fix formatting of vertex shader.
  • Loading branch information
luanpotter committed Sep 11, 2024
1 parent 3ae3ef5 commit 75e64a7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/flame_3d/shaders/spatial_material.vert
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ uniform VertexInfo {
} vertex_info;

void main() {
// Calculate the modelview projection matrix
mat4 modelViewProjection = vertex_info.projection * vertex_info.view * vertex_info.model;
// Calculate the modelview projection matrix
mat4 modelViewProjection = vertex_info.projection * vertex_info.view * vertex_info.model;

// Transform the vertex position
gl_Position = modelViewProjection * vec4(vertexPosition, 1.0);
// Transform the vertex position
gl_Position = modelViewProjection * vec4(vertexPosition, 1.0);

// Pass the interpolated values to the fragment shader
fragTexCoord = vertexTexCoord;
fragColor = vertexColor;
// Calculate the world-space position and normal
fragPosition = vec3(vertex_info.model * vec4(vertexPosition, 1.0));
fragNormal = mat3(transpose(inverse(vertex_info.model))) * vertexNormal;
// Pass the interpolated values to the fragment shader
fragTexCoord = vertexTexCoord;
fragColor = vertexColor;

// Calculate the world-space position and normal
fragPosition = vec3(vertex_info.model * vec4(vertexPosition, 1.0));
fragNormal = mat3(transpose(inverse(vertex_info.model))) * vertexNormal;
}

0 comments on commit 75e64a7

Please sign in to comment.