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 14, 2022
1 parent 3d3630d commit 950b9b6
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ void ERS_CLASS_DepthMaps::UpdateDepthMap(ERS_STRUCT_PointLight* Light, ERS_STRUC

void ERS_CLASS_DepthMaps::UpdateDepthMap(ERS_STRUCT_SpotLight* Light, ERS_STRUCT_Shader* DepthShader, glm::mat4* LightSpaceMatrix) {


// Check Settings
CheckSettings();

Expand All @@ -321,10 +320,8 @@ void ERS_CLASS_DepthMaps::UpdateDepthMap(ERS_STRUCT_SpotLight* Light, ERS_STRUCT
float FOV = glm::radians(130.0f);// * (0.01745329));
ObjectProjection = glm::perspective(FOV, AspectRatio, NearPlane, FarPlane); // Perspective models regular light source


// Re-Do Rotation
glm::vec3 XYZRotation = ERS_FUNCTION_ConvertRotationToFrontVector(Light->Rot);

glm::vec3 Front = glm::normalize(XYZRotation);
ObjectView = glm::lookAt(Light->Pos, Light->Pos+Front, glm::vec3(0.0f, 1.0f, 0.0f)); // Pos+Front
ObjectSpace = ObjectProjection * ObjectView;
Expand All @@ -339,8 +336,6 @@ void ERS_CLASS_DepthMaps::UpdateDepthMap(ERS_STRUCT_SpotLight* Light, ERS_STRUCT

glViewport(0, 0, DepthTextureArrayWidth_, DepthTextureArrayHeight_);
glBindFramebuffer(GL_FRAMEBUFFER, Light->DepthMap.FrameBufferObjectIDs[0]);


glClear(GL_DEPTH_BUFFER_BIT);
glActiveTexture(GL_TEXTURE0);
Renderer_->RenderSceneNoTextures(TargetScene, DepthShader);
Expand Down

0 comments on commit 950b9b6

Please sign in to comment.