diff --git a/shader/lighting/texture.frag b/shader/lighting/texture.frag index 387554cc3..99ebf6421 100644 --- a/shader/lighting/texture.frag +++ b/shader/lighting/texture.frag @@ -10,6 +10,7 @@ void main() { vec3 pos = texture(screenTexture, vTexPos).xyz; vec3 distVec = pos - lightPos.xyz; float dist = dot(distVec, distVec); +// float dist = dot(distVec.xy, distVec.xy); // if (dist > rad) { // discard; // } diff --git a/src/Dodge/Data/Config.hs b/src/Dodge/Data/Config.hs index b4a92c7f3..d8e33ee89 100644 --- a/src/Dodge/Data/Config.hs +++ b/src/Dodge/Data/Config.hs @@ -59,7 +59,7 @@ data Config = Config , _gr_downsize_res :: ResFactor , _gr_world_res :: ResFactor , _gr_num_shadow_casters :: NumShadowCasters - , _windowX :: Int --size + , _windowX :: Int --size in pixels , _windowY :: Int , _windowPosX :: Int --position in os , _windowPosY :: Int diff --git a/src/Render.hs b/src/Render.hs index bdedf373a..522525df2 100644 --- a/src/Render.hs +++ b/src/Render.hs @@ -162,7 +162,8 @@ renderShadows isclouds cam cfig shadrendertype nWalls nSils nCaps positiontextur flip VFSM.mapM_ (VFSM.fromList lightPoints) $ \(V3 x y z, rad, V3 r g b) -> do withArray [x,y,z,1,r,g,b,rad] $ glNamedBufferSubData (pdata ^. lightUBO) 0 32 -- note that the stencil shadows rely on the depth buffer - let d = rad * cam ^. camZoom + let d = 0.5 * rad * cam ^. camZoom -- rad * cam ^. camZoom + -- I don't know how this should be multiplied V2 x' y' = worldPosToResOffset cfig cam (V2 x y) -- this is probably too strict, it will be possible for high up lights -- to have some of their light cast high up cut off