Skip to content

Commit

Permalink
Fix player setup menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdolan committed Feb 11, 2024
1 parent e7f1778 commit 54faef2
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/client/renderer/shaders/mesh_vs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,19 @@ void main(void) {
vertex.diffusemap = in_diffusemap;
vertex.color = vec4(1.0);

vec3 texcoord = lightgrid_uvw(vec3(model * position));

vertex.ambient = sample_lightgrid_ambient(texcoord);
vertex.diffuse = sample_lightgrid_diffuse(texcoord);
vertex.direction = sample_lightgrid_direction(texcoord);
vertex.caustics = sample_lightgrid_caustics(texcoord);
vertex.fog = sample_lightgrid_fog(texcoord);
if (view_type == VIEW_PLAYER_MODEL) {
vertex.ambient = vec3(0.333);
vertex.diffuse = vec3(0.666);
vertex.direction = vec3(0.0, 0.0, 1.0);
} else {
vec3 texcoord = lightgrid_uvw(vec3(model * position));

vertex.ambient = sample_lightgrid_ambient(texcoord);
vertex.diffuse = sample_lightgrid_diffuse(texcoord);
vertex.direction = sample_lightgrid_direction(texcoord);
vertex.caustics = sample_lightgrid_caustics(texcoord);
vertex.fog = sample_lightgrid_fog(texcoord);
}

gl_Position = projection3D * vec4(vertex.position, 1.0);

Expand Down

0 comments on commit 54faef2

Please sign in to comment.