Skip to content

Commit

Permalink
Transparency fix in advanced renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
favreau committed Nov 10, 2021
1 parent cc2835f commit 733e71a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bioexplorer/core/module/ispc/render/AdvancedRenderer.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,8 @@ inline vec3f AdvancedRenderer_shadeRay(
const uniform AdvancedRenderer* uniform self, varying ScreenSample& sample)
{
Ray ray = sample.ray;
float maxt = self->fogStart + self->fogThickness;

vec4f color = make_vec4f(0.f);
vec3f bgColor = make_vec3f(0.f);
if (self->showBackground)
Expand All @@ -839,7 +841,8 @@ inline vec3f AdvancedRenderer_shadeRay(
uint32 depth = 0;
float oldlocalRefraction = 1.f;

sample.z = inf;
sample.z = maxt;
ray.t = maxt;
bool moreRebounds = true;

while (moreRebounds && depth < self->maxBounces && color.w < 0.95f)
Expand Down Expand Up @@ -950,7 +953,8 @@ inline vec3f AdvancedRenderer_shadeRay(
++depth;
}

ray.t = inf - ray.t;
maxt -= ray.t;
ray.t = maxt;
ray.primID = -1;
ray.geomID = -1;
ray.instID = -1;
Expand Down

0 comments on commit 733e71a

Please sign in to comment.