Skip to content

Commit

Permalink
Source: Fix flashlight
Browse files Browse the repository at this point in the history
  • Loading branch information
magcius committed Feb 8, 2025
1 parent ddc32c0 commit b7274d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SourceEngine/Materials/Material_Generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ layout(std140) uniform ub_ObjectParams {
vec4 u_SpecTintBoost;
#endif
#if defined USE_PROJECTED_LIGHT
mat4 u_ProjectedLightFromWorldMatrix;
Mat4x4 u_ProjectedLightFromWorldMatrix;
vec4 u_ProjectedLightColor;
vec4 u_ProjectedLightOrigin;
#endif
Expand Down Expand Up @@ -901,7 +901,7 @@ void mainPS() {
#if defined USE_PROJECTED_LIGHT
// Projected Light (Flashlight, env_projected_texture)
vec4 t_ProjectedLightCoord = u_ProjectedLightFromWorldMatrix * vec4(v_PositionWorld.xyz, 1.0);
vec4 t_ProjectedLightCoord = UnpackMatrix(u_ProjectedLightFromWorldMatrix) * vec4(v_PositionWorld.xyz, 1.0);
t_ProjectedLightCoord.xyz /= t_ProjectedLightCoord.www;
// Clip space is between -1 and 1. Move it into 0...1 space.
Expand Down

0 comments on commit b7274d1

Please sign in to comment.