Blender Git Commit Log

Git Commits -> Revision 94aa87d

Revision 94aa87d by Janne Karhu (master)
October 19, 2010, 16:10 (GMT)
Fix for [#24293] Shadow pass is wrong

* The problem is that shadow pass is derived from the diffuse pass as
shad = shad'/diff, where shad' = shad*diff. In cases where diff is
0 and the division can't be done shad is left as shad' (=0).
* This all works just fine until the diffuse color is 0 on just one
channel (no red in material color for example). In this case the shadow
pass is left as 0 too regardless of the existence of an actual shadow,
so the end result is a colored shadow!
* The only real solution is to use the original shadow intensity to
determine if there actually is a shadow or not. This is now stored in
shr->shad[3] from the lamp shadow calculation.

Note: The best solution would probably be to calculate the shadow pass on
it's own and not to derive it from the diffuse pass, but I didn't dare to
start messing up the shading code totally.

Commit Details:

Full Hash: 94aa87dd62eb147c9d68627c020856cd46dc9cf2
SVN Revision: 32603
Parent Commit: 0a12a9b
Lines Changed: +10, -2

2 Modified Paths:

/source/blender/render/extern/include/RE_shader_ext.h (+1, -1) (Diff)
/source/blender/render/intern/source/shadeoutput.c (+9, -1) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021