Separate cloud & surface lighting

This commit is contained in:
2025-11-20 14:01:54 +00:00
parent 1f1fa36b72
commit 602b162d41
5 changed files with 15 additions and 7 deletions
+8 -6
View File
@@ -26,6 +26,7 @@ import Shader.Data
away" from the shape colors.
-}
createLightMap ::
Bool -> -- True if it is for clouds
Camera ->
Config ->
ShadowRendering ->
@@ -42,12 +43,10 @@ createLightMap ::
[(Point3, Float, Point3)] -> -- Lights
RenderData ->
IO ()
createLightMap cam cfig shadrendertype = case shadrendertype of
createLightMap t cam cfig shadrendertype = case shadrendertype of
NoShadows -> const . const . const renderLightingNoShadows
NoLighting -> const . const . const . const . const . const renderFlatLighting
_ -> renderShadows cam cfig shadrendertype
-- where
-- shadrendertype = cfig ^. gr_shadow_rendering
_ -> renderShadows t cam cfig shadrendertype
renderLightingNoShadows ::
TO ->
@@ -118,6 +117,7 @@ renderFlatLighting pdata = do
glStencilOp GL_KEEP GL_KEEP GL_KEEP
renderShadows ::
Bool -> -- True if it is for clouds
Camera ->
Config ->
ShadowRendering ->
@@ -129,12 +129,14 @@ renderShadows ::
[(Point3, Float, Point3)] ->
RenderData ->
IO ()
renderShadows cam cfig shadrendertype nWalls nSils nCaps positiontexture normaltexture lightPoints pdata = do
renderShadows isclouds cam cfig shadrendertype nWalls nSils nCaps positiontexture normaltexture lightPoints pdata = do
glBindFramebuffer GL_FRAMEBUFFER $ pdata ^. fboLighting . _1 . unFBO
let llinesShad = _lightingLineShadowShader pdata
lcapShad = _lightingCapShader pdata
shadwall = _shadWallShader pdata
ltextShad = _lightingTextureShader pdata
ltextShad
| isclouds = pdata ^. lightingCloudShader
| otherwise = _lightingTextureShader pdata
-- we assume that the renderbuffer's depth has been correctly set elsewhere
-- we will not be changing that here
glDepthMask GL_FALSE