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:
authorMatt Ebb <matt@mke3.net>2007-09-16 17:50:34 +0400
committerMatt Ebb <matt@mke3.net>2007-09-16 17:50:34 +0400
commit90daa8f81126a86f2cd419a6288b5f0b097d478b (patch)
tree4c84662f08c72e42845f8e6667aa5c190126c5c0 /source/blender/blenkernel/intern/colortools.c
parentc8fe5a0ed95fa15e955d3224fd6a2c8a8b648d73 (diff)
* Extra lamp falloff options, including custom curve!
This adds some new lamp attenuation options to the Lamp panel, replacing the old 'Quad' button. Yes, the panel layout is still nasty here, but I've ignored it for now to address properly in the panels cleanup work. * Constant http://mke3.net/blender/devel/rendering/falloff-constant.jpg Lamp doesn't decay with distance * Inverse Linear http://mke3.net/blender/devel/rendering/falloff-invlinear.jpg Default, and same as in older Blender without 'Quad' on. Decays linearly, with 'Dist' value as the lamp's half-energy-distance * Inverse Square http://mke3.net/blender/devel/rendering/falloff-invsquare.jpg A sharper, more realistic decay, good for most electric lights (i.e. not sunlight). This is similar to the old Quad option with slight changes. * Lin/Quad weighted Exactly the same as in older Blenders with the old 'Quad' button enabled. When this setting is chosen, two sliders are shown, 'Linear' and 'Quad' (previously Quad1 and Quad2), which controls the 'linearness' or 'quadraticness' of the falloff curve. Lamps in old files with the 'Quad' button on will be initialised to this setting. But much better for precise control over the lamp falloff now is: * Custom Curve This shows an extra 'Falloff Curve' panel, where you can use the standard Blender curve UI control to precisely control how the light falls off. The Y axis is intensity, and the X axis is distance, stretched over the length of the 'Dist' value. Some example curves and renders: http://mke3.net/blender/devel/rendering/falloff-curve1-curve.png http://mke3.net/blender/devel/rendering/falloff-curve1.jpg http://mke3.net/blender/devel/rendering/falloff-curve2-curve.png http://mke3.net/blender/devel/rendering/falloff-curve2.jpg http://mke3.net/blender/devel/rendering/falloff-curve3-curve.png http://mke3.net/blender/devel/rendering/falloff-curve3.jpg (whee)
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r--source/blender/blenkernel/intern/colortools.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index fda31d9e7c0..83b014cdd63 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -62,12 +62,18 @@ CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, floa
{
CurveMapping *cumap;
int a;
+ float clipminx, clipminy, clipmaxx, clipmaxy;
cumap= MEM_callocN(sizeof(CurveMapping), "new curvemap");
cumap->flag= CUMA_DO_CLIP;
if(tot==4) cumap->cur= 3; /* rhms, hack for 'col' curve? */
- BLI_init_rctf(&cumap->curr, minx, maxx, miny, maxy);
+ clipminx = MIN2(minx, maxx);
+ clipminy = MIN2(miny, maxy);
+ clipmaxx = MAX2(minx, maxx);
+ clipmaxy = MAX2(miny, maxy);
+
+ BLI_init_rctf(&cumap->curr, clipminx, clipmaxx, clipminy, clipmaxy);
cumap->clipr= cumap->curr;
cumap->white[0]= cumap->white[1]= cumap->white[2]= 1.0f;