tornavis/source/blender/makesdna/DNA_lamp_types.h

207 lines
4.7 KiB
C
Raw Normal View History

/*
2002-10-12 13:37:38 +02:00
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
2002-10-12 13:37:38 +02:00
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
2002-10-12 13:37:38 +02:00
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
2010-02-12 14:34:04 +01:00
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2002-10-12 13:37:38 +02:00
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
2002-10-12 13:37:38 +02:00
*/
#ifndef DNA_LAMP_TYPES_H
#define DNA_LAMP_TYPES_H
/** \file DNA_lamp_types.h
* \ingroup DNA
*/
2002-10-12 13:37:38 +02:00
#include "DNA_ID.h"
#ifndef MAX_MTEX
#define MAX_MTEX 18
#endif
2002-10-12 13:37:38 +02:00
struct MTex;
* 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)
2007-09-16 15:50:34 +02:00
struct CurveMapping;
struct AnimData;
2.5: Blender "Animato" - New Animation System Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future. Highlights of the new system: * Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action. - F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves. - The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc. * F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated. * Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place) * F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place) * NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still) There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details: http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html So, what currently works: * I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code. * Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock. * Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc. Notes: * Drivers haven't been hooked up yet * Only objects and data directly linked to objects can be animated. * Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change). * Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor) * I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review. In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
2009-01-17 04:12:50 +01:00
struct Ipo;
2002-10-12 13:37:38 +02:00
typedef struct Lamp {
ID id;
struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
2002-10-12 13:37:38 +02:00
short type, flag;
int mode;
2002-10-12 13:37:38 +02:00
short colormodel, totex;
float r, g, b, k;
float shdwr, shdwg, shdwb, shdwpad;
2002-10-12 13:37:38 +02:00
float energy, dist, spotsize, spotblend;
float haint;
* 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)
2007-09-16 15:50:34 +02:00
float att1, att2; /* Quad1 and Quad2 attenuation */
* 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)
2007-09-16 15:50:34 +02:00
struct CurveMapping *curfalloff;
short falloff_type;
short pad2;
2002-10-12 13:37:38 +02:00
float clipsta, clipend, shadspotsize;
float bias, soft, compressthresh, pad5[3];
short bufsize, samp, buffers, filtertype;
char bufflag, buftype;
2002-10-12 13:37:38 +02:00
short ray_samp, ray_sampy, ray_sampz;
short ray_samp_type;
short area_shape;
Area lights and more... - New lamp type added "Area". This uses the radiosity formula (Stoke) to calculate the amount of energy which is received from a plane. Result is very nice local light, which nicely spreads out. - Area lamps have a 'gamma' option to control the light spread - Area lamp builtin sizes: square, rect, cube & box. Only first 2 are implemented. Set a type, and define area size - Button area size won't affect the amount of energy. But scaling the lamp in 3d window will do. This is to cover the case when you scale an entire scene, the light then will remain identical If you just want to change area lamp size, use buttons when you dont want to make the scene too bright or too dark - Since area lights realistically are sensitive for distance (quadratic), the effect it has is quickly too much, or too less. For this the "Dist" value in Lamp can be used. Set it at Dist=10 to have reasonable light on distance 10 Blender units (assumed you didnt scale lamp object). - I tried square sized specularity, but this looked totally weird. Not committed - Plan is to extend area light with 3d dimensions, boxes and cubes. - Note that area light is one-sided, towards negative Z. I need to design a nice drawing method for it. Area Shadow - Since there are a lot of variables associated with soft shadow, they now only are available for Area lights. Allowing spot & normal lamp to have soft shadow is possible though, but will require a reorganisation of the Lamp buttons. Is a point of research & feedback still. - Apart from area size, you now can individually set amount of samples in X and Y direction (for area lamp type 'Rect'). For box type area lamp, this will become 3 dimensions - Area shadows have four options: "Clip circle" : only uses a circular shape of samples, gives smoother results "Dither" : use a 2x2 dither mask "Jitter" : applys a pseudo-random offset to samples "Umbra" : extra emphasis on area that's fully in shadow. Raytrace speedup - improved filling in faces in Octree. Large faces occupied too many nodes - added a coherence check; rays fired sequentially that begin and end in same octree nodes, and that don't intersect, are quickly rejected - rendering shadow scenes benefits from this 20-40%. My statue test monkey file now renders in 19 seconds (was 30). Plus: - adjusted specular max to 511, and made sure Blinn spec has again this incredible small spec size - for UI rounded theme: the color "button" displayed RGB color too dark - fixed countall() function, to also include Subsurf totals - removed setting the 'near' clipping for pressing dot-key numpad - when you press the buttons-window icon for 'Shading Context' the context automaticilly switches as with F5 hotkey Please be warned that this is not a release... settings in files might not work as it did, nor guaranteed to work when we do a release. :)
2003-12-29 17:52:51 +01:00
float area_size, area_sizey, area_sizez;
float adapt_thresh;
short ray_samp_method;
short pad1;
/* texact is for buttons */
2002-10-12 13:37:38 +02:00
short texact, shadhalostep;
/* sun/sky */
short sun_effect_type;
short skyblendtype;
float horizon_brightness;
float spread;
float sun_brightness;
float sun_size;
float backscattered_light;
float sun_intensity;
float atm_turbidity;
float atm_inscattering_factor;
float atm_extinction_factor;
float atm_distance_factor;
float skyblendfac;
float sky_exposure;
2010-06-14 02:24:42 +02:00
short sky_colorspace;
char pad4[6];
2.5: Blender "Animato" - New Animation System Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future. Highlights of the new system: * Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action. - F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves. - The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc. * F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated. * Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place) * F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place) * NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still) There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details: http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html So, what currently works: * I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code. * Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock. * Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc. Notes: * Drivers haven't been hooked up yet * Only objects and data directly linked to objects can be animated. * Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change). * Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor) * I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review. In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
2009-01-17 04:12:50 +01:00
struct Ipo *ipo; // XXX depreceated... old animation system
struct MTex *mtex[18]; /* MAX_MTEX */
2010-06-14 02:24:42 +02:00
short pr_texture;
char pad6[6];
/* preview */
struct PreviewImage *preview;
2002-10-12 13:37:38 +02:00
} Lamp;
/* **************** LAMP ********************* */
/* flag */
#define LA_DS_EXPAND 1
/* NOTE: this must have the same value as MA_DS_SHOW_TEXS,
* otherwise anim-editors will not read correctly
*/
#define LA_DS_SHOW_TEXS 4
2002-10-12 13:37:38 +02:00
/* type */
#define LA_LOCAL 0
#define LA_SUN 1
#define LA_SPOT 2
#define LA_HEMI 3
Area lights and more... - New lamp type added "Area". This uses the radiosity formula (Stoke) to calculate the amount of energy which is received from a plane. Result is very nice local light, which nicely spreads out. - Area lamps have a 'gamma' option to control the light spread - Area lamp builtin sizes: square, rect, cube & box. Only first 2 are implemented. Set a type, and define area size - Button area size won't affect the amount of energy. But scaling the lamp in 3d window will do. This is to cover the case when you scale an entire scene, the light then will remain identical If you just want to change area lamp size, use buttons when you dont want to make the scene too bright or too dark - Since area lights realistically are sensitive for distance (quadratic), the effect it has is quickly too much, or too less. For this the "Dist" value in Lamp can be used. Set it at Dist=10 to have reasonable light on distance 10 Blender units (assumed you didnt scale lamp object). - I tried square sized specularity, but this looked totally weird. Not committed - Plan is to extend area light with 3d dimensions, boxes and cubes. - Note that area light is one-sided, towards negative Z. I need to design a nice drawing method for it. Area Shadow - Since there are a lot of variables associated with soft shadow, they now only are available for Area lights. Allowing spot & normal lamp to have soft shadow is possible though, but will require a reorganisation of the Lamp buttons. Is a point of research & feedback still. - Apart from area size, you now can individually set amount of samples in X and Y direction (for area lamp type 'Rect'). For box type area lamp, this will become 3 dimensions - Area shadows have four options: "Clip circle" : only uses a circular shape of samples, gives smoother results "Dither" : use a 2x2 dither mask "Jitter" : applys a pseudo-random offset to samples "Umbra" : extra emphasis on area that's fully in shadow. Raytrace speedup - improved filling in faces in Octree. Large faces occupied too many nodes - added a coherence check; rays fired sequentially that begin and end in same octree nodes, and that don't intersect, are quickly rejected - rendering shadow scenes benefits from this 20-40%. My statue test monkey file now renders in 19 seconds (was 30). Plus: - adjusted specular max to 511, and made sure Blinn spec has again this incredible small spec size - for UI rounded theme: the color "button" displayed RGB color too dark - fixed countall() function, to also include Subsurf totals - removed setting the 'near' clipping for pressing dot-key numpad - when you press the buttons-window icon for 'Shading Context' the context automaticilly switches as with F5 hotkey Please be warned that this is not a release... settings in files might not work as it did, nor guaranteed to work when we do a release. :)
2003-12-29 17:52:51 +01:00
#define LA_AREA 4
Major update, all implemented a bit in a hurry, and probably will need bugfixes at some point. Extended the range of the depth and cdepth parameters as reqested by leope. Bumpmapping should now be a bit more similar to the Blender render. Added support for all remaining lightsources in yafray, tried to make use of as much of the existing Blender parameters as possible. Blender Lamp: added switch to enable rendering with shadowbuffer ('softlight' in yafray). All other parameters are similar to the Blender settings, for yafray both the bias parameter and the shadowbuffer size can be lower than equivalent Blender settings, since the yafray buffer is floating point. Remember that 6 shadowmaps are created in this case, so can use quite a bit of memory with large buffer settings. When 'ray shadow' is enabled for this lamp type, it is possible to set a light radius to create a spherical arealight source ('spherelight' in yafray), when this is 0, it is exported as a pointlight instead. Blender Spot: as in Blender now supports 'halo' rendering. Halo spots always use shadowbuffers, so when enabled the buttons for shadowmap settings will appear. The 'ray shadow' button can still be used to disable shadows cast onto other objects, independent of halo shadows. One thing to remember, halo's don't work with empty backgrounds, something must be behind the spotlight for it to be visible. And finally, the photonlight: probably the most confusing (as more things related to yafray), the photonlight is not a real lightsource, it is only used as a source to shoot photons from. Since indirect lighting is already supported (and looks better as well) only caustics mode is supported. So to be able to use this properly other lightsources must be used with it. For the photonlighting to be 'correct' similar lightsettings as for the 'source' light are needed. Probably the best way to do this, when you are happy with the lighting setup you have, and want to add caustics, copy the light you want to enable for caustics (shift-D) and leave everything as is, then change the mode to 'Photon'. To not waiste any photons, the photonlight behaves similar to the spotlight, you can set the width of the beam with the 'angle' parameter. Make sure that any object that needs to cast caustics is within that beam, make the beam width as small as possible to tightly fit the object. The following other parameters can be set: -photons: the number of photons to shoot. -search: the number of photons to search when rendering, the higher, the blurrier the caustics. -depth: the amount of photon bounces allowed, since the primary use is for caustics, you probably best set this to the same level as the 'ray depth' parameter. -Blur: this controls the amount of caustics blur (in addition to the search parameter), very low values will cause very sharp caustics, which when used with a low photonnumber, probably lead to only some noisy specks being rendered. -Use QMC: Use quasi monte carlo sampling, can lead to cleaner results, but also can sometimes cause patterns. Since the photonlight has no meaning to Blender, when using photonlights and switching back to the internal render, the light doesn't do anything, and no type button will be selected. The lightsource can still be selected, but unless switching to yafray, no parameters can set. Apologies to Anexus, I had no time to really do something with your code, I'll still look at it later, to see if I can improve anything in my implementation.
2004-07-29 00:37:12 +02:00
/* yafray: extra lamp type used for caustic photonmap */
#define LA_YF_PHOTON 5
2002-10-12 13:37:38 +02:00
/* mode */
#define LA_SHAD_BUF 1
2002-10-12 13:37:38 +02:00
#define LA_HALO 2
#define LA_LAYER 4
* 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)
2007-09-16 15:50:34 +02:00
#define LA_QUAD 8 /* no longer used */
2002-10-12 13:37:38 +02:00
#define LA_NEG 16
#define LA_ONLYSHADOW 32
#define LA_SPHERE 64
#define LA_SQUARE 128
#define LA_TEXTURE 256
#define LA_OSATEX 512
/* #define LA_DEEP_SHADOW 1024 */ /* not used anywhere */
#define LA_NO_DIFF 2048
#define LA_NO_SPEC 4096
#define LA_SHAD_RAY 8192
Major update, all implemented a bit in a hurry, and probably will need bugfixes at some point. Extended the range of the depth and cdepth parameters as reqested by leope. Bumpmapping should now be a bit more similar to the Blender render. Added support for all remaining lightsources in yafray, tried to make use of as much of the existing Blender parameters as possible. Blender Lamp: added switch to enable rendering with shadowbuffer ('softlight' in yafray). All other parameters are similar to the Blender settings, for yafray both the bias parameter and the shadowbuffer size can be lower than equivalent Blender settings, since the yafray buffer is floating point. Remember that 6 shadowmaps are created in this case, so can use quite a bit of memory with large buffer settings. When 'ray shadow' is enabled for this lamp type, it is possible to set a light radius to create a spherical arealight source ('spherelight' in yafray), when this is 0, it is exported as a pointlight instead. Blender Spot: as in Blender now supports 'halo' rendering. Halo spots always use shadowbuffers, so when enabled the buttons for shadowmap settings will appear. The 'ray shadow' button can still be used to disable shadows cast onto other objects, independent of halo shadows. One thing to remember, halo's don't work with empty backgrounds, something must be behind the spotlight for it to be visible. And finally, the photonlight: probably the most confusing (as more things related to yafray), the photonlight is not a real lightsource, it is only used as a source to shoot photons from. Since indirect lighting is already supported (and looks better as well) only caustics mode is supported. So to be able to use this properly other lightsources must be used with it. For the photonlighting to be 'correct' similar lightsettings as for the 'source' light are needed. Probably the best way to do this, when you are happy with the lighting setup you have, and want to add caustics, copy the light you want to enable for caustics (shift-D) and leave everything as is, then change the mode to 'Photon'. To not waiste any photons, the photonlight behaves similar to the spotlight, you can set the width of the beam with the 'angle' parameter. Make sure that any object that needs to cast caustics is within that beam, make the beam width as small as possible to tightly fit the object. The following other parameters can be set: -photons: the number of photons to shoot. -search: the number of photons to search when rendering, the higher, the blurrier the caustics. -depth: the amount of photon bounces allowed, since the primary use is for caustics, you probably best set this to the same level as the 'ray depth' parameter. -Blur: this controls the amount of caustics blur (in addition to the search parameter), very low values will cause very sharp caustics, which when used with a low photonnumber, probably lead to only some noisy specks being rendered. -Use QMC: Use quasi monte carlo sampling, can lead to cleaner results, but also can sometimes cause patterns. Since the photonlight has no meaning to Blender, when using photonlights and switching back to the internal render, the light doesn't do anything, and no type button will be selected. The lightsource can still be selected, but unless switching to yafray, no parameters can set. Apologies to Anexus, I had no time to really do something with your code, I'll still look at it later, to see if I can improve anything in my implementation.
2004-07-29 00:37:12 +02:00
/* yafray: lamp shadowbuffer flag, softlight */
/* Since it is used with LOCAL lamp, can't use LA_SHAD */
/* #define LA_YF_SOFT 16384 */ /* no longer used */
#define LA_LAYER_SHADOW 32768
#define LA_SHAD_TEX (1<<16)
#define LA_SHOW_CONE (1<<17)
/* layer_shadow */
#define LA_LAYER_SHADOW_BOTH 0
#define LA_LAYER_SHADOW_CAST 1
#define LA_LAYER_SHADOW_RECEIVE 2
2002-10-12 13:37:38 +02:00
/* sun effect type*/
#define LA_SUN_EFFECT_SKY 1
#define LA_SUN_EFFECT_AP 2
* 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)
2007-09-16 15:50:34 +02:00
/* 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
#define LA_SHADBUF_HALFWAY 2
#define LA_SHADBUF_DEEP 3
/* 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
#define LA_SHADBUF_GAUSS 2
Area lights and more... - New lamp type added "Area". This uses the radiosity formula (Stoke) to calculate the amount of energy which is received from a plane. Result is very nice local light, which nicely spreads out. - Area lamps have a 'gamma' option to control the light spread - Area lamp builtin sizes: square, rect, cube & box. Only first 2 are implemented. Set a type, and define area size - Button area size won't affect the amount of energy. But scaling the lamp in 3d window will do. This is to cover the case when you scale an entire scene, the light then will remain identical If you just want to change area lamp size, use buttons when you dont want to make the scene too bright or too dark - Since area lights realistically are sensitive for distance (quadratic), the effect it has is quickly too much, or too less. For this the "Dist" value in Lamp can be used. Set it at Dist=10 to have reasonable light on distance 10 Blender units (assumed you didnt scale lamp object). - I tried square sized specularity, but this looked totally weird. Not committed - Plan is to extend area light with 3d dimensions, boxes and cubes. - Note that area light is one-sided, towards negative Z. I need to design a nice drawing method for it. Area Shadow - Since there are a lot of variables associated with soft shadow, they now only are available for Area lights. Allowing spot & normal lamp to have soft shadow is possible though, but will require a reorganisation of the Lamp buttons. Is a point of research & feedback still. - Apart from area size, you now can individually set amount of samples in X and Y direction (for area lamp type 'Rect'). For box type area lamp, this will become 3 dimensions - Area shadows have four options: "Clip circle" : only uses a circular shape of samples, gives smoother results "Dither" : use a 2x2 dither mask "Jitter" : applys a pseudo-random offset to samples "Umbra" : extra emphasis on area that's fully in shadow. Raytrace speedup - improved filling in faces in Octree. Large faces occupied too many nodes - added a coherence check; rays fired sequentially that begin and end in same octree nodes, and that don't intersect, are quickly rejected - rendering shadow scenes benefits from this 20-40%. My statue test monkey file now renders in 19 seconds (was 30). Plus: - adjusted specular max to 511, and made sure Blinn spec has again this incredible small spec size - for UI rounded theme: the color "button" displayed RGB color too dark - fixed countall() function, to also include Subsurf totals - removed setting the 'near' clipping for pressing dot-key numpad - when you press the buttons-window icon for 'Shading Context' the context automaticilly switches as with F5 hotkey Please be warned that this is not a release... settings in files might not work as it did, nor guaranteed to work when we do a release. :)
2003-12-29 17:52:51 +01:00
/* area shape */
#define LA_AREA_SQUARE 0
#define LA_AREA_RECT 1
#define LA_AREA_CUBE 2
#define LA_AREA_BOX 3
/* ray_samp_method */
#define LA_SAMP_CONSTANT 0
#define LA_SAMP_HALTON 1
#define LA_SAMP_HAMMERSLEY 2
Area lights and more... - New lamp type added "Area". This uses the radiosity formula (Stoke) to calculate the amount of energy which is received from a plane. Result is very nice local light, which nicely spreads out. - Area lamps have a 'gamma' option to control the light spread - Area lamp builtin sizes: square, rect, cube & box. Only first 2 are implemented. Set a type, and define area size - Button area size won't affect the amount of energy. But scaling the lamp in 3d window will do. This is to cover the case when you scale an entire scene, the light then will remain identical If you just want to change area lamp size, use buttons when you dont want to make the scene too bright or too dark - Since area lights realistically are sensitive for distance (quadratic), the effect it has is quickly too much, or too less. For this the "Dist" value in Lamp can be used. Set it at Dist=10 to have reasonable light on distance 10 Blender units (assumed you didnt scale lamp object). - I tried square sized specularity, but this looked totally weird. Not committed - Plan is to extend area light with 3d dimensions, boxes and cubes. - Note that area light is one-sided, towards negative Z. I need to design a nice drawing method for it. Area Shadow - Since there are a lot of variables associated with soft shadow, they now only are available for Area lights. Allowing spot & normal lamp to have soft shadow is possible though, but will require a reorganisation of the Lamp buttons. Is a point of research & feedback still. - Apart from area size, you now can individually set amount of samples in X and Y direction (for area lamp type 'Rect'). For box type area lamp, this will become 3 dimensions - Area shadows have four options: "Clip circle" : only uses a circular shape of samples, gives smoother results "Dither" : use a 2x2 dither mask "Jitter" : applys a pseudo-random offset to samples "Umbra" : extra emphasis on area that's fully in shadow. Raytrace speedup - improved filling in faces in Octree. Large faces occupied too many nodes - added a coherence check; rays fired sequentially that begin and end in same octree nodes, and that don't intersect, are quickly rejected - rendering shadow scenes benefits from this 20-40%. My statue test monkey file now renders in 19 seconds (was 30). Plus: - adjusted specular max to 511, and made sure Blinn spec has again this incredible small spec size - for UI rounded theme: the color "button" displayed RGB color too dark - fixed countall() function, to also include Subsurf totals - removed setting the 'near' clipping for pressing dot-key numpad - when you press the buttons-window icon for 'Shading Context' the context automaticilly switches as with F5 hotkey Please be warned that this is not a release... settings in files might not work as it did, nor guaranteed to work when we do a release. :)
2003-12-29 17:52:51 +01:00
/* ray_samp_type */
#define LA_SAMP_ROUND 1
#define LA_SAMP_UMBRA 2
#define LA_SAMP_DITHER 4
#define LA_SAMP_JITTER 8
2002-10-12 13:37:38 +02:00
/* mapto */
#define LAMAP_COL 1
#define LAMAP_SHAD 2
#endif /* DNA_LAMP_TYPES_H */