Photon-v2
Photon-v2 copied to clipboard
Self-intersection issue on emitters.
Currently, emitters are single-sided. If a ray hits some back-facing emitters, its intersection point may be slightly in front of the emitter. Consequently, if the emitter's material is double-sided and picks a sample direction on the same hemisphere with V, we will intersect ourself and this time causing light leaks. The amount of leaking light is tiny but visible. This scene demonstrate the issue:
## camera(pinhole) [real fov-degree 30] [vector3r position "0 0 0"] [vector3r direction "0 0 -1"]
## sample-generator(stratified) [integer sample-amount 18] [integer num-strata-2d-x 256] [integer num-strata-2d-y 256]
## renderer(sampling) [integer width 1280] [integer height 720] [string filter-name gaussian] [string estimator bvpt]
-> light-source(sphere) @source1 [real radius 1] [real watts 200] [vector3r linear-srgb "1 1 1"]
-> light-source(rectangle) @source2 [real width 2] [real height 2] [real watts 200] [vector3r linear-srgb "1 1 1"]
-> actor(light) @light1 [light-source light-source @source2]
-> actor(light) translate(@light1) [vector3r factor "0 0.5 -6"]
-> actor(light) rotate(@light1) [vector3r axis "1 0 0"][real degree 180]
Possible fixes:
- make materials strictly single-sided by default
- use the technique introduced in Ray Tracing Gems
- use EFloat like pbrt-v3 does
- offset the ray origin along the sample direction a tiny bit (grazing angles may fail)
- [ ] Test if this is fixed after recent surface hit refinement update