Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-12-17 17:05:40 +0300
committerTon Roosendaal <ton@blender.org>2005-12-17 17:05:40 +0300
commit128b187db1561b65d0cc558ae3185d032eb49c17 (patch)
tree3076da03e3016b4f57e495e1d708edcb0d672b34 /source/blender/render
parent16aa8ea1b0b951d15dc04b2c9412a6b58f63447b (diff)
Orange: New option "Shadow Bias", to extend the boundary between shadow or
no shadow a little bit. Uses same threshold function as the "Bias" button. (That latter still works, and will use an automatic bias value based on the geometry, to prevent terminator errors in raytracing). Anyhoo, with this manual bias you can get rid of terminator problems for weird diffuse shaders now as well (like tangent or fresnel). Committed a few more files than needed, that's just code cleanup.
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/rendercore.c6
-rw-r--r--source/blender/render/intern/source/shadbuf.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 1a2f942fd2a..739b4a4757f 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -1658,6 +1658,12 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
else
phongcorr= 0.0;
}
+ else if(ma->sbias!=0.0f) {
+ if(inp>ma->sbias)
+ phongcorr= (inp-ma->sbias)/(inp*(1.0-ma->sbias));
+ else
+ phongcorr= 0.0;
+ }
else phongcorr= 1.0;
/* diffuse shaders */
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index c942232bebb..9ff3c104d0a 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -443,7 +443,7 @@ float testshadowbuf(struct ShadBuf *shb, float *rco, float *dxco, float *dyco, f
int xs,ys, zs, bias;
short a,num;
- /* if(inp <= 0.0) return 1.0; */
+ if(inp <= 0.0) return 0.0;
/* rotate renderco en osaco */
siz= 0.5*(float)shb->size;