Skip to content

Commit

Permalink
Add opacity correction to direct volume rendering shader
Browse files Browse the repository at this point in the history
  • Loading branch information
mlavik1 committed Apr 19, 2024
1 parent 09eec03 commit 86203c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Assets/Shaders/DirectVolumeRenderingShader.shader
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@
#endif
#endif

// Opacity correction
float blendFactor = 1.0f / _SamplingRateMultiplier;
src.a = 1.0f - pow(1.0f - src.a, blendFactor);
src.rgb *= src.a;
col = (1.0f - col.a) * src + col;

Expand Down

0 comments on commit 86203c2

Please sign in to comment.