mirror of
https://github.com/ZDoom/ZDRay.git
synced 2025-02-02 20:51:25 +00:00
Sync shader code from vkdoom
This commit is contained in:
parent
f2ecc9c4fb
commit
85f1687769
2 changed files with 9 additions and 5 deletions
|
@ -71,8 +71,8 @@ vec4 TracePointLightRay(vec3 origin, vec3 lightpos, float tmin, vec4 rayColor)
|
|||
// Blend with surface texture
|
||||
rayColor = BlendTexture(surface, GetSurfaceUV(result.primitiveIndex, result.primitiveWeights), rayColor);
|
||||
|
||||
// Stop if it isn't a portal, or there is no light left
|
||||
if (surface.PortalIndex == 0 || rayColor.r + rayColor.g + rayColor.b <= 0.0)
|
||||
// Stop if there is no light left
|
||||
if (rayColor.r + rayColor.g + rayColor.b <= 0.0)
|
||||
return vec4(0.0);
|
||||
|
||||
// Move to surface hit point
|
||||
|
|
|
@ -54,12 +54,16 @@ vec4 TraceSunRay(vec3 origin, float tmin, vec3 dir, float tmax, vec4 rayColor)
|
|||
|
||||
SurfaceInfo surface = GetSurface(result.primitiveIndex);
|
||||
|
||||
// Stop if we hit the sky.
|
||||
if (surface.Sky > 0.0)
|
||||
return rayColor;
|
||||
|
||||
// Blend with surface texture
|
||||
rayColor = BlendTexture(surface, GetSurfaceUV(result.primitiveIndex, result.primitiveWeights), rayColor);
|
||||
|
||||
// Stop if it isn't a portal, or there is no light left
|
||||
if (surface.PortalIndex == 0 || rayColor.r + rayColor.g + rayColor.b <= 0.0)
|
||||
return rayColor * surface.Sky;
|
||||
// Stop if there is no light left
|
||||
if (rayColor.r + rayColor.g + rayColor.b <= 0.0)
|
||||
return vec4(0.0);
|
||||
|
||||
// Move to surface hit point
|
||||
origin += dir * result.t;
|
||||
|
|
Loading…
Reference in a new issue