Skip to content

Commit

Permalink
Implement Point Light Shadows (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
datacrystals committed Jun 21, 2022
1 parent 73067bd commit 1e943f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ void ERS_CLASS_DepthMaps::UpdateDepthMap(ERS_STRUCT_PointLight* Light, ERS_STRUC

DepthShader->SetVec3("LightPos", Light->Pos);
DepthShader->SetFloat("FarPlane", Light->MaxDistance);
DepthShader->SetInt("ShadowMapIndex", Light->DepthMap.DepthMapTextureIndex);
DepthShader->SetInt("ShadowMapLayer", Light->DepthMap.DepthMapTextureIndex);
Renderer_->RenderSceneNoTextures(TargetScene, DepthShader);

}
Expand Down
4 changes: 2 additions & 2 deletions Source/EditorAssets/Projects/DefaultProject/10046.ERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ layout (triangles) in;
layout (triangle_strip, max_vertices=18) out;

uniform mat4 ShadowMatrices[6];
uniform int ShadowMapIndex;
uniform int ShadowMapLayer;

out vec4 FragPos; // FragPos from GS (output per emitvertex)

void main()
{
for(int face = 0; face < 6; ++face)
{
gl_Layer = (ShadowMapIndex*6) + face; // built-in variable that specifies to which face we render.
gl_Layer = (ShadowMapLayer*6) + face; // built-in variable that specifies to which face we render.
for(int i = 0; i < 3; ++i) // for each triangle's vertices
{
FragPos = gl_in[i].gl_Position;
Expand Down

0 comments on commit 1e943f8

Please sign in to comment.