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/makesdna/DNA_lamp_types.h
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/makesdna/DNA_lamp_types.h')
-rw-r--r--source/blender/makesdna/DNA_lamp_types.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h
index e1d4e4c1cc1..f8cc2378cb1 100644
--- a/source/blender/makesdna/DNA_lamp_types.h
+++ b/source/blender/makesdna/DNA_lamp_types.h
@@ -43,6 +43,7 @@
struct MTex;
struct Ipo;
+struct CurveMapping;
typedef struct Lamp {
ID id;
@@ -54,7 +55,13 @@ typedef struct Lamp {
float energy, dist, spotsize, spotblend;
float haint;
+
+
float att1, att2; /* Quad1 and Quad2 attenuation */
+ int pad2;
+ struct CurveMapping *curfalloff;
+ short falloff_type;
+ short pad3;
float clipsta, clipend, shadspotsize;
float bias, soft;
@@ -104,7 +111,7 @@ typedef struct Lamp {
#define LA_SHAD_BUF 1
#define LA_HALO 2
#define LA_LAYER 4
-#define LA_QUAD 8
+#define LA_QUAD 8 /* no longer used */
#define LA_NEG 16
#define LA_ONLYSHADOW 32
#define LA_SPHERE 64
@@ -119,6 +126,14 @@ typedef struct Lamp {
/* Since it is used with LOCAL lamp, can't use LA_SHAD */
#define LA_YF_SOFT 16384
+/* falloff_type */
+#define LA_FALLOFF_CONSTANT 0
+#define LA_FALLOFF_INVLINEAR 1
+#define LA_FALLOFF_INVSQUARE 2
+#define LA_FALLOFF_CURVE 3
+#define LA_FALLOFF_SLIDERS 4
+
+
/* buftype, no flag */
#define LA_SHADBUF_REGULAR 0
#define LA_SHADBUF_IRREGULAR 1