TzuChieh / Photon-v2

A program that takes photographs of a virtual world.
https://tzuchieh.github.io/Photon-v2-site/engine_docs/v2.0.0-beta/Photon/html/index.html
MIT License
84 stars 5 forks source link

Self-intersection issue on emitters. #12

Open TzuChieh opened 6 years ago

TzuChieh commented 6 years ago

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]
TzuChieh commented 6 years ago

Possible fixes:

TzuChieh commented 2 months ago