three-gpu-pathtracer icon indicating copy to clipboard operation
three-gpu-pathtracer copied to clipboard

Shadow / Reflection catcher material

Open romarybi opened this issue 1 year ago • 1 comments

I am willing to put $200 towards a PR that implements this feature.

Feature Request

Shadow catcher is an important feature that is present in most renderers. It is also implemented in the three.js library as ShadowMaterial. I propose also adding such material to this library.

Implementation

I am not an expert in GLSL but the solution that I thought would work is creating a second renderTarget on which a grayscale shadow map is rendered and then multiplying it with the beauty render target. I'm not sure if this is the best practice for this library. Here is a good thread that I found useful when researching this issue thread.

An overview of how the shadow material should work:

  • Catches shadows from other scene objects (which block light + environment)
  • Non shadow pixels are fully transparent
  • Shadow is affected by light sources + environment
  • Shadow material is skipped if hit by secondary ray bounces

Reflection property:

  • Should also act as reflect material where reflection is rendered

romarybi avatar Jun 16 '23 16:06 romarybi