Skip to content

Commit

Permalink
Fix an issue #60
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-cast committed Feb 18, 2018
1 parent 5593917 commit 12a227c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Skybox/Time of day/Shader/cloud.fxsub
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ sampler NoiseMapSamp = sampler_state {
float ComputeRayPlaneIntersection(float3 position, float3 viewdir, float3 n, float dist)
{
float a = dot(n, viewdir);
if (a > 0.0) return -1;

float t = -(dot(position, n) + dist) / a;
return t;
if (a > 0.0)
{
return -1;
}
else
{
float t = -(dot(position, n) + dist) / a;
return t;
}
}

float3 ComputeDensity(ScatteringParams setting, float depth)
Expand Down

0 comments on commit 12a227c

Please sign in to comment.