Blender Git Loki

Git Commits -> Revision 65b25df

Revision 65b25df by Lukas Stockner (master)
October 25, 2018, 12:50 (GMT)
Cycles: Overhaul ensure_valid_reflection to fix issues with normal- and bumpmapping

This function is supposed to prevent the black artifacts caused by strong normal- or bumpmapping, but failed in some cases.

Now the code correctly handles all test files and previous issues I am aware of and also has extensive comments describing
the algorithm and the math behind it.

Basically, the main problem was that there can be multiple valid solutions that fulfil the reflection angle criterium,
but I had assumed that only one would exist and therefore simply picked the first solution with a positive term in srqt().
Now, the code uses additional validity checks and a simple heuristic to pick the best valid solution.

Additionally, the code messed up very shallow reflections even if the normal map strength was zero due to the constant
limit for the outgoing ray angle, which caused shallow incoming rays to fail the initial test even when reflected directly
on Ng. Now, the code accounts for this by reducing the threshold in the case of a shallow incoming ray, ensuring that at
least N=Ng is always a valid solution.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3816

Commit Details:

Full Hash: 65b25df8018cdef8952d2e49ad66f55c6b0b3e2b
Parent Commit: 2046817
Lines Changed: +129, -32

2 Modified Paths:

/intern/cycles/kernel/kernel_montecarlo.h (+82, -15) (Diff)
/intern/cycles/kernel/shaders/stdosl.h (+47, -17) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021