knightcrawler25 / GLSL-PathTracer

A toy physically based GPU path tracer (C++/OpenGL/GLSL)
MIT License
1.87k stars 176 forks source link

Absorption #89

Closed markusmoenig closed 1 year ago

markusmoenig commented 1 year ago

Hi,

this BSDF Light shader has an easy to use absorption parameter for liquids: https://www.shadertoy.com/view/Dtl3WS.

How can I recreate an absorption parameter like this using GLSL-PathTracer ?

Thanks

knightcrawler25 commented 1 year ago

Hey,

You'll first need to make the material transmissive (specTrans = 1.0) and then set Medium Type = Absorb You can then tweak the absorption color using the Medium Color and the Medium Density parameters

image

markusmoenig commented 1 year ago

Thanks!