diff options
author | Ton Roosendaal <ton@blender.org> | 2006-08-31 14:36:45 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-08-31 14:36:45 +0400 |
commit | 32c51f3338d2ddd7cec84c24aafb1cf7df410f5a (patch) | |
tree | 59e19afcf97a1427b99243a33a8aa776989b3f1f /source/blender/makesdna/DNA_lamp_types.h | |
parent | e2e6bce283b91eeaee4cb5e475831f4a92efbcb1 (diff) |
Render feature request:
Auto-clip Lamp Buffer
Setting a good range for clipping start/end for Lamp buffers is important
for good quality shadow (depth details). That can be quite a hassle, when
many lamps or animated objects are involved.
This option allows to have the clipping range calculated based on the
visible vertices in the spotbundle. For clip start and clip end it can
be set individually. Typically the clip start defines quality most.
The shadow buffer 'bias' value is corrected for this automatic clipping
too, to ensure that ranges that differ give same biasing appearance.
(If this wasn't done, you would see lighted areas become darker or
lighter, or even artefacts, when the range changes suddenly
NOTE: since it only checks for vertices, be aware that large planes can
give errors.
Implementation note: zbuffer values are non-linear (1/z) because that
allows linear interpolation while filling scanlines. That's the main
reason for the precision to be highest close to the eye (or lamp).
It's even a useful feature, since you want details to be precise
when they're closeby.
Since these values are also in the -1 to 1 range, using floats here
wouldn't solve problems a lot. Maybe trying a 64 bits Z once might
be an interesting coding job.
Diffstat (limited to 'source/blender/makesdna/DNA_lamp_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_lamp_types.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h index 4a910ebf136..f42b9d7f03d 100644 --- a/source/blender/makesdna/DNA_lamp_types.h +++ b/source/blender/makesdna/DNA_lamp_types.h @@ -58,7 +58,7 @@ typedef struct Lamp { float clipsta, clipend, shadspotsize; float bias, soft; - short bufsize, samp, buffers, filtertype, pad; + short bufsize, samp, buffers, filtertype, bufflag; short ray_samp, ray_sampy, ray_sampz, ray_samp_type; short area_shape; @@ -111,6 +111,10 @@ typedef struct Lamp { /* Since it is used with LOCAL lamp, can't use LA_SHAD */ #define LA_YF_SOFT 16384 +/* bufflag, auto clipping */ +#define LA_SHADBUF_AUTO_START 1 +#define LA_SHADBUF_AUTO_END 2 + /* filtertype */ #define LA_SHADBUF_BOX 0 #define LA_SHADBUF_TENT 1 |