2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-11-18 10:57:06 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* 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 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-11-18 10:57:06 +00:00
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation (2008).
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2011-02-27 20:20:01 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_lamp.c
|
|
|
|
|
* \ingroup RNA
|
|
|
|
|
*/
|
|
|
|
|
|
2008-11-18 10:57:06 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
2013-03-07 02:44:55 +00:00
|
|
|
#include "BLI_math_base.h"
|
|
|
|
|
|
2013-03-10 14:57:19 +00:00
|
|
|
#include "BLF_translation.h"
|
|
|
|
|
|
2008-11-18 10:57:06 +00:00
|
|
|
#include "RNA_define.h"
|
2011-03-19 10:26:15 +00:00
|
|
|
#include "RNA_enum_types.h"
|
2008-11-18 10:57:06 +00:00
|
|
|
#include "rna_internal.h"
|
|
|
|
|
|
|
|
|
|
#include "DNA_lamp_types.h"
|
2009-01-10 22:57:33 +00:00
|
|
|
#include "DNA_material_types.h"
|
|
|
|
|
#include "DNA_texture_types.h"
|
2008-11-18 10:57:06 +00:00
|
|
|
|
|
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
2009-07-15 19:20:59 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
#include "BKE_context.h"
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
#include "BKE_depsgraph.h"
|
|
|
|
|
#include "BKE_main.h"
|
2009-07-15 19:20:59 +00:00
|
|
|
#include "BKE_texture.h"
|
|
|
|
|
|
2011-11-02 18:55:32 +00:00
|
|
|
#include "ED_node.h"
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
#include "WM_api.h"
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2008-11-30 00:57:32 +00:00
|
|
|
static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lamp *la = (Lamp *)ptr->data;
|
2008-11-30 00:57:32 +00:00
|
|
|
|
2012-12-25 06:31:42 +00:00
|
|
|
CLAMP(value, 128, 10240);
|
2012-03-05 23:30:41 +00:00
|
|
|
la->bufsize = value;
|
2008-11-30 00:57:32 +00:00
|
|
|
la->bufsize &= (~15); /* round to multiple of 16 */
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static PointerRNA rna_Lamp_sky_settings_get(PointerRNA *ptr)
|
2009-01-03 05:41:58 +00:00
|
|
|
{
|
2009-02-02 19:57:57 +00:00
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_LampSkySettings, ptr->id.data);
|
2009-01-03 05:41:58 +00:00
|
|
|
}
|
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_Lamp_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lamp *la = (Lamp *)ptr->data;
|
|
|
|
|
rna_iterator_array_begin(iter, (void *)la->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr)
|
2009-01-10 22:57:33 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lamp *la = (Lamp *)ptr->data;
|
2009-07-28 18:54:02 +00:00
|
|
|
Tex *tex;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
tex = give_current_lamp_texture(la);
|
2009-07-28 18:54:02 +00:00
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
2009-07-28 18:54:02 +00:00
|
|
|
static void rna_Lamp_active_texture_set(PointerRNA *ptr, PointerRNA value)
|
2009-07-15 19:20:59 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lamp *la = (Lamp *)ptr->data;
|
2009-10-12 13:12:45 +00:00
|
|
|
|
|
|
|
|
set_current_lamp_texture(la, value.data);
|
2009-07-15 19:20:59 +00:00
|
|
|
}
|
|
|
|
|
|
2012-05-01 02:50:17 +00:00
|
|
|
static int rna_use_shadow_get(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lamp *la = (Lamp *)ptr->data;
|
2012-05-02 10:10:05 +00:00
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
if (la->type == LA_SPOT)
|
2012-05-02 10:10:05 +00:00
|
|
|
return la->mode & LA_SHAD_BUF;
|
|
|
|
|
else
|
|
|
|
|
return la->mode & LA_SHAD_RAY;
|
2012-05-01 02:50:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_use_shadow_set(PointerRNA *ptr, int value)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lamp *la = (Lamp *)ptr->data;
|
2012-05-01 20:08:23 +00:00
|
|
|
if (value) {
|
2012-05-12 11:01:29 +00:00
|
|
|
if (la->type == LA_SPOT)
|
2012-05-02 10:10:05 +00:00
|
|
|
la->mode |= LA_SHAD_BUF;
|
|
|
|
|
else
|
|
|
|
|
la->mode |= LA_SHAD_RAY;
|
2012-05-01 02:50:17 +00:00
|
|
|
}
|
|
|
|
|
else
|
2012-05-12 11:01:29 +00:00
|
|
|
la->mode &= ~(LA_SHAD_BUF | LA_SHAD_RAY);
|
2012-05-01 02:50:17 +00:00
|
|
|
}
|
|
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
static StructRNA *rna_Lamp_refine(struct PointerRNA *ptr)
|
2009-01-10 22:57:33 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lamp *la = (Lamp *)ptr->data;
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
switch (la->type) {
|
2009-01-10 22:57:33 +00:00
|
|
|
case LA_LOCAL:
|
2009-09-16 18:04:01 +00:00
|
|
|
return &RNA_PointLamp;
|
2009-01-10 22:57:33 +00:00
|
|
|
case LA_SUN:
|
|
|
|
|
return &RNA_SunLamp;
|
|
|
|
|
case LA_SPOT:
|
|
|
|
|
return &RNA_SpotLamp;
|
|
|
|
|
case LA_HEMI:
|
|
|
|
|
return &RNA_HemiLamp;
|
|
|
|
|
case LA_AREA:
|
|
|
|
|
return &RNA_AreaLamp;
|
|
|
|
|
default:
|
|
|
|
|
return &RNA_Lamp;
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-11-30 00:57:32 +00:00
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_Lamp_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Lamp *la = ptr->id.data;
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
|
2010-12-05 18:59:23 +00:00
|
|
|
DAG_id_tag_update(&la->id, 0);
|
2012-03-05 23:30:41 +00:00
|
|
|
if (scene->gm.matmode == GAME_MAT_GLSL)
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la);
|
2010-02-13 13:49:27 +00:00
|
|
|
else
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_LAMP | ND_LIGHTING, la);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
}
|
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Lamp *la = ptr->id.data;
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
|
2010-12-05 18:59:23 +00:00
|
|
|
DAG_id_tag_update(&la->id, 0);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
}
|
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Lamp *la = ptr->id.data;
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
|
2010-12-05 18:59:23 +00:00
|
|
|
DAG_id_tag_update(&la->id, 0);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_LAMP | ND_SKY, la);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
}
|
|
|
|
|
|
2010-02-04 19:24:20 +00:00
|
|
|
/* only for rad/deg conversion! can remove later */
|
|
|
|
|
static float rna_Lamp_spot_size_get(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Lamp *la = ptr->id.data;
|
2011-03-28 02:34:55 +00:00
|
|
|
return DEG2RADF(la->spotsize);
|
2010-02-04 19:24:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Lamp_spot_size_set(PointerRNA *ptr, float value)
|
|
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
Lamp *la = ptr->id.data;
|
|
|
|
|
la->spotsize = RAD2DEGF(value);
|
2010-02-04 19:24:20 +00:00
|
|
|
}
|
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
static void rna_Lamp_use_nodes_update(bContext *C, PointerRNA *ptr)
|
2011-11-02 18:55:32 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Lamp *la = (Lamp *)ptr->data;
|
2011-11-02 18:55:32 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (la->use_nodes && la->nodetree == NULL)
|
2013-03-18 16:34:57 +00:00
|
|
|
ED_node_shader_default(C, &la->id);
|
2011-11-02 18:55:32 +00:00
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
rna_Lamp_update(CTX_data_main(C), CTX_data_scene(C), ptr);
|
2011-11-02 18:55:32 +00:00
|
|
|
}
|
2010-02-04 19:24:20 +00:00
|
|
|
|
2008-11-18 10:57:06 +00:00
|
|
|
#else
|
2012-06-14 14:04:55 +00:00
|
|
|
/* Don't define icons here, so they don't show up in the Lamp UI (properties Editor) - DingTo */
|
2011-01-11 02:30:01 +00:00
|
|
|
EnumPropertyItem lamp_type_items[] = {
|
|
|
|
|
{LA_LOCAL, "POINT", 0, "Point", "Omnidirectional point light source"},
|
|
|
|
|
{LA_SUN, "SUN", 0, "Sun", "Constant direction parallel ray light source"},
|
|
|
|
|
{LA_SPOT, "SPOT", 0, "Spot", "Directional cone light source"},
|
|
|
|
|
{LA_HEMI, "HEMI", 0, "Hemi", "180 degree constant light source"},
|
|
|
|
|
{LA_AREA, "AREA", 0, "Area", "Directional area light source"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2011-01-11 02:30:01 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_def_lamp_mtex(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
|
|
static EnumPropertyItem prop_texture_coordinates_items[] = {
|
2011-12-04 17:36:13 +00:00
|
|
|
{TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"},
|
|
|
|
|
{TEXCO_VIEW, "VIEW", 0, "View", "Use view coordinates for the texture coordinates"},
|
|
|
|
|
{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "LampTextureSlot", "TextureSlot");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_sdna(srna, "MTex");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Lamp Texture Slot", "Texture slot for textures in a Lamp datablock");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "texco");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_texture_coordinates_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Texture Coordinates", "");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "object");
|
|
|
|
|
RNA_def_property_struct_type(prop, "Object");
|
2009-05-28 23:23:47 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Object", "Object to use for mapping with Object texture coordinates");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_map_color", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_COL);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color", "Let the texture affect the basic color of the lamp");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_map_shadow", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mapto", LAMAP_SHAD);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shadow", "Let the texture affect the shadow color of the lamp");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2009-07-21 12:57:55 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color_factor", PROP_FLOAT, PROP_NONE);
|
2009-07-21 12:57:55 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "colfac");
|
|
|
|
|
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color Factor", "Amount texture affects color values");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2009-07-21 12:57:55 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "shadow_factor", PROP_FLOAT, PROP_NONE);
|
2009-10-01 17:15:23 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "shadowfac");
|
2009-07-21 12:57:55 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shadow Factor", "Amount texture affects shadow");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_lamp_sky_settings(BlenderRNA *brna)
|
2009-01-03 05:41:58 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
|
|
static EnumPropertyItem prop_skycolorspace_items[] = {
|
2009-06-16 00:52:21 +00:00
|
|
|
{0, "SMPTE", 0, "SMPTE", ""},
|
|
|
|
|
{1, "REC709", 0, "REC709", ""},
|
|
|
|
|
{2, "CIE", 0, "CIE", ""},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "LampSkySettings", NULL);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Lamp");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_nested(brna, srna, "SunLamp");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Lamp Sky Settings", "Sky related settings for a sun lamp");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sky_color_space", PROP_ENUM, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "sky_colorspace");
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_enum_items(prop, prop_skycolorspace_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sky Color Space", "Color space to use for internal XYZ->RGB color conversion");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "skyblendtype");
|
2011-03-19 10:26:15 +00:00
|
|
|
RNA_def_property_enum_items(prop, ramp_blend_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
|
|
|
|
/* Number values */
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 20.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Horizon Brightness", "Horizon brightness");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "spread", PROP_FLOAT, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 10.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Horizon Spread", "Horizon Spread");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sun_brightness", PROP_FLOAT, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 10.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sun Brightness", "Sun brightness");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sun_size", PROP_FLOAT, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 10.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sun Size", "Sun size");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "backscattered_light", PROP_FLOAT, PROP_NONE);
|
2009-04-12 17:28:41 +00:00
|
|
|
RNA_def_property_range(prop, -1.0f, 1.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Backscattered Light", "Backscattered light");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sun_intensity", PROP_FLOAT, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 10.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sun Intensity", "Sun intensity");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "atm_turbidity");
|
2009-04-12 17:28:41 +00:00
|
|
|
RNA_def_property_range(prop, 1.0f, 30.0f);
|
2010-06-15 01:28:17 +00:00
|
|
|
RNA_def_property_ui_range(prop, 2.0f, 10.0f, 1, 2);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "atmosphere_inscattering", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "atm_inscattering_factor");
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Atmosphere Inscatter", "Scatter contribution factor");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "atmosphere_extinction", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "atm_extinction_factor");
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Atmosphere Extinction", "Extinction scattering contribution factor");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "atmosphere_distance_factor", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "atm_distance_factor");
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 500.0f);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Atmosphere Distance Factor",
|
|
|
|
|
"Multiplier to convert blender units to physical distance");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sky_blend", PROP_FLOAT, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "skyblendfac");
|
|
|
|
|
RNA_def_property_range(prop, 0.0f, 2.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sky Blend", "Blend factor with sky");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sky_exposure", PROP_FLOAT, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 20.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sky Exposure", "Strength of sky shading exponential exposure correction");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
|
|
|
|
/* boolean */
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sky", "Apply sun effect on sky");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_atmosphere", PROP_BOOLEAN, PROP_NONE);
|
2009-01-03 05:41:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_AP);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Atmosphere", "Apply sun effect on atmosphere");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
}
|
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_def_lamp(BlenderRNA *brna)
|
2008-11-18 10:57:06 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "Lamp", "ID");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_refine_func(srna, "rna_Lamp_refine");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Lamp", "Lamp datablock for lighting a scene");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_LAMP_DATA);
|
2008-11-18 10:57:06 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
|
2011-01-11 02:30:01 +00:00
|
|
|
RNA_def_property_enum_items(prop, lamp_type_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Type", "Type of Lamp");
|
2013-03-10 14:57:19 +00:00
|
|
|
RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_ID_LAMP);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "dist");
|
2010-02-24 15:56:27 +00:00
|
|
|
RNA_def_property_range(prop, 0, INT_MAX);
|
2010-02-27 10:01:20 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 1000, 1, 3);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Distance",
|
|
|
|
|
"Falloff distance - the light is at half the original intensity at this point");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE);
|
2010-02-27 10:01:20 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 10, 1, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits");
|
2010-02-13 13:49:27 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "r");
|
|
|
|
|
RNA_def_property_array(prop, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color", "Light color");
|
2010-02-13 13:49:27 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_own_layer", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Layer", "Illuminate objects only on the same layers the lamp is on");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Negative", "Cast negative light");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_specular", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Specular", "Create specular highlights");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_diffuse", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Diffuse", "Do diffuse shading");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2011-11-02 18:55:32 +00:00
|
|
|
|
|
|
|
|
/* nodes */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
|
2011-11-02 18:55:32 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based lamps");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
|
2011-11-02 18:55:32 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
|
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2013-03-18 16:34:57 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
2011-11-02 18:55:32 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the lamp");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_use_nodes_update");
|
2009-10-03 11:23:31 +00:00
|
|
|
|
|
|
|
|
/* common */
|
|
|
|
|
rna_def_animdata_common(srna);
|
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
/* textures */
|
2010-09-03 14:53:54 +00:00
|
|
|
rna_def_mtex_common(brna, srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get",
|
2012-11-24 14:50:40 +00:00
|
|
|
"rna_Lamp_active_texture_set", NULL, "LampTextureSlot", "LampTextureSlots", "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_lamp_falloff(StructRNA *srna)
|
|
|
|
|
{
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
|
|
static EnumPropertyItem prop_fallofftype_items[] = {
|
2009-06-16 00:52:21 +00:00
|
|
|
{LA_FALLOFF_CONSTANT, "CONSTANT", 0, "Constant", ""},
|
|
|
|
|
{LA_FALLOFF_INVLINEAR, "INVERSE_LINEAR", 0, "Inverse Linear", ""},
|
|
|
|
|
{LA_FALLOFF_INVSQUARE, "INVERSE_SQUARE", 0, "Inverse Square", ""},
|
|
|
|
|
{LA_FALLOFF_CURVE, "CUSTOM_CURVE", 0, "Custom Curve", ""},
|
|
|
|
|
{LA_FALLOFF_SLIDERS, "LINEAR_QUADRATIC_WEIGHTED", 0, "Lin/Quad Weighted", ""},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_enum_items(prop, prop_fallofftype_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
|
2008-11-30 01:31:05 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_sphere", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SPHERE);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sphere", "Set light intensity to zero beyond lamp distance");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2008-11-18 10:57:06 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "linear_attenuation", PROP_FLOAT, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "att1");
|
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2010-05-04 05:15:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Linear Attenuation", "Linear distance attenuation");
|
2010-02-13 13:49:27 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "quadratic_attenuation", PROP_FLOAT, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "att2");
|
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2010-05-04 05:15:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Quadratic Attenuation", "Quadratic distance attenuation");
|
2010-02-13 13:49:27 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area)
|
|
|
|
|
{
|
|
|
|
|
PropertyRNA *prop;
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static EnumPropertyItem prop_shadow_items[] = {
|
2009-07-21 00:55:20 +00:00
|
|
|
{0, "NOSHADOW", 0, "No Shadow", ""},
|
2010-02-11 01:11:52 +00:00
|
|
|
{LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-07-21 00:55:20 +00:00
|
|
|
|
|
|
|
|
static EnumPropertyItem prop_spot_shadow_items[] = {
|
2009-06-16 00:52:21 +00:00
|
|
|
{0, "NOSHADOW", 0, "No Shadow", ""},
|
2011-11-26 12:30:01 +00:00
|
|
|
{LA_SHAD_BUF, "BUFFER_SHADOW", 0, "Buffer Shadow", "Let spotlight produce shadows using shadow buffer"},
|
2010-02-11 01:11:52 +00:00
|
|
|
{LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-07-21 00:55:20 +00:00
|
|
|
|
2009-07-20 20:34:14 +00:00
|
|
|
static EnumPropertyItem prop_ray_sampling_method_items[] = {
|
2009-06-16 00:52:21 +00:00
|
|
|
{LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""},
|
|
|
|
|
{LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-07-21 00:55:20 +00:00
|
|
|
|
|
|
|
|
static EnumPropertyItem prop_spot_ray_sampling_method_items[] = {
|
|
|
|
|
{LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""},
|
|
|
|
|
{LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""},
|
|
|
|
|
{LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-05-01 02:50:17 +00:00
|
|
|
static EnumPropertyItem prop_shadbuftype_items[] = {
|
|
|
|
|
{LA_SHADBUF_REGULAR, "REGULAR", 0, "Classical", "Classic shadow buffer"},
|
|
|
|
|
{LA_SHADBUF_HALFWAY, "HALFWAY", 0, "Classic-Halfway",
|
|
|
|
|
"Regular buffer, averaging the closest and 2nd closest Z value to reducing "
|
|
|
|
|
"bias artifacts"},
|
|
|
|
|
{LA_SHADBUF_IRREGULAR, "IRREGULAR", 0, "Irregular",
|
|
|
|
|
"Irregular buffer produces sharp shadow always, but it doesn't show up for raytracing"},
|
|
|
|
|
{LA_SHADBUF_DEEP, "DEEP", 0, "Deep",
|
|
|
|
|
"Deep shadow buffer supports transparency and better filtering, at the cost of "
|
|
|
|
|
"more memory usage and processing time"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2012-05-01 02:50:17 +00:00
|
|
|
|
|
|
|
|
static EnumPropertyItem prop_shadbuffiltertype_items[] = {
|
2012-05-01 20:08:23 +00:00
|
|
|
{LA_SHADBUF_BOX, "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples"},
|
2012-05-01 02:50:17 +00:00
|
|
|
{LA_SHADBUF_TENT, "TENT", 0, "Tent", "Apply the Tent Filter to shadow buffer samples"},
|
|
|
|
|
{LA_SHADBUF_GAUSS, "GAUSS", 0, "Gauss", "Apply the Gauss filter to shadow buffer samples"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2012-05-01 02:50:17 +00:00
|
|
|
|
|
|
|
|
static EnumPropertyItem prop_numbuffer_items[] = {
|
|
|
|
|
{1, "BUFFERS_1", 0, "1", "Only one buffer rendered"},
|
2012-05-07 15:50:57 +00:00
|
|
|
{4, "BUFFERS_4", 0, "4", "Render 4 buffers for better AA, this quadruples memory usage"},
|
|
|
|
|
{9, "BUFFERS_9", 0, "9", "Render 9 buffers for better AA, this uses nine times more memory"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2012-05-01 02:50:17 +00:00
|
|
|
|
|
|
|
|
/* GE only */
|
|
|
|
|
static EnumPropertyItem prop_ge_shadowbuffer_type_items[] = {
|
|
|
|
|
{LA_SHADMAP_SIMPLE, "SIMPLE", 0, "Simple", "Simple shadow maps"},
|
|
|
|
|
{LA_SHADMAP_VARIANCE, "VARIANCE", 0, "Variance", "Variance shadow maps"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2012-05-01 02:50:17 +00:00
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE);
|
2012-05-01 02:50:17 +00:00
|
|
|
RNA_def_property_boolean_funcs(prop, "rna_use_shadow_get", "rna_use_shadow_set");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
|
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
prop = RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_enum_items(prop, (spot) ? prop_spot_shadow_items : prop_shadow_items);
|
2012-05-01 02:50:17 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE);
|
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "bufsize");
|
2012-12-25 06:31:42 +00:00
|
|
|
RNA_def_property_range(prop, 128, 10240);
|
2012-05-01 02:50:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shadow Buffer Size",
|
|
|
|
|
"Resolution of the shadow buffer, higher values give crisper shadows "
|
|
|
|
|
"but use more memory");
|
|
|
|
|
RNA_def_property_int_funcs(prop, NULL, "rna_Lamp_buffer_size_set", NULL);
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_filter_type", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "filtertype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow Filter Type", "Type of shadow filter (Buffer Shadows)");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_sample_buffers", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "buffers");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_numbuffer_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow Sample Buffers",
|
|
|
|
|
"Number of shadow buffers to render for better AA, this increases memory usage");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_buffer_clip_start", PROP_FLOAT, PROP_DISTANCE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "clipsta");
|
|
|
|
|
RNA_def_property_range(prop, 0.0f, 9999.0f);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow Buffer Clip Start",
|
|
|
|
|
"Shadow map clip start, below which objects will not generate shadows");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
|
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
prop = RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE);
|
2012-05-01 02:50:17 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "clipend");
|
|
|
|
|
RNA_def_property_range(prop, 0.0f, 9999.0f);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow Buffer Clip End",
|
|
|
|
|
"Shadow map clip end, beyond which objects will not generate shadows");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_buffer_bias", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "bias");
|
|
|
|
|
RNA_def_property_range(prop, 0.001f, 5.0f);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow Buffer Bias", "Shadow buffer sampling bias");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_buffer_bleed_bias", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "bleedbias");
|
|
|
|
|
RNA_def_property_range(prop, 0.f, 1.f);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow Buffer Bleed Bias", "Bias for reducing light-bleed on variance shadow maps");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_buffer_soft", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "soft");
|
|
|
|
|
RNA_def_property_range(prop, 0.0f, 100.0f);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow Buffer Soft", "Size of shadow buffer sampling area");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_buffer_samples", PROP_INT, PROP_NONE);
|
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "samp");
|
|
|
|
|
RNA_def_property_range(prop, 1, 16);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Samples", "Number of shadow buffer samples");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_buffer_type", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "buftype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_shadbuftype_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow Buffer Type", "Type of shadow buffer");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "ge_shadow_buffer_type", PROP_ENUM, PROP_NONE);
|
|
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "shadowmap_type");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_ge_shadowbuffer_type_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Shadow Map Type", "The shadow mapping algorithm used");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_auto_clip_start", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_START);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Autoclip Start",
|
|
|
|
|
"Automatic calculation of clipping-start, based on visible vertices");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
|
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "use_auto_clip_end", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "bufflag", LA_SHADBUF_AUTO_END);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Autoclip End", "Automatic calculation of clipping-end, based on visible vertices");
|
2009-10-06 23:37:11 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-05-01 02:50:17 +00:00
|
|
|
prop = RNA_def_property(srna, "compression_threshold", PROP_FLOAT, PROP_NONE);
|
|
|
|
|
RNA_def_property_float_sdna(prop, NULL, "compressthresh");
|
|
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Compress", "Deep shadow map compression threshold");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "shadow_color", PROP_FLOAT, PROP_COLOR);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "shdwr");
|
|
|
|
|
RNA_def_property_array(prop, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shadow Color", "Color of shadows cast by the lamp");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Only Shadow", "Cast shadows only, without illuminating objects");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "shadow_ray_sample_method", PROP_ENUM, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_enum_items(prop, (area) ? prop_spot_ray_sampling_method_items : prop_ray_sampling_method_items);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method",
|
|
|
|
|
"Method for generating shadow samples: Adaptive QMC is fastest, "
|
|
|
|
|
"Constant QMC is less noisy but slower");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-18 10:57:06 +00:00
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
prop = RNA_def_property(srna, (area) ? "shadow_ray_samples_x" : "shadow_ray_samples", PROP_INT, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "ray_samp");
|
2009-05-21 07:40:43 +00:00
|
|
|
RNA_def_property_range(prop, 1, 64);
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_ui_text(prop, (area) ? "Shadow Ray Samples" : "Shadow Ray Samples X",
|
2012-03-18 09:27:36 +00:00
|
|
|
"Number of samples taken extra (samples x samples)");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (area) {
|
|
|
|
|
prop = RNA_def_property(srna, "shadow_ray_samples_y", PROP_INT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "ray_sampy");
|
2009-05-21 07:40:43 +00:00
|
|
|
RNA_def_property_range(prop, 1, 64);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shadow Ray Samples Y",
|
|
|
|
|
"Number of samples taken extra (samples x samples)");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "shadow_adaptive_threshold", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "adapt_thresh");
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shadow Adaptive Threshold", "Threshold for Adaptive Sampling (Raytraced shadows)");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "shadow_soft_size", PROP_FLOAT, PROP_DISTANCE);
|
2009-10-12 19:19:29 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "area_size");
|
2009-05-21 07:40:43 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shadow Soft Size", "Light size for ray shadow sampling (Raytraced shadows)");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_shadow_layer", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER_SHADOW);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shadow Layer", "Objects on the same layers only cast shadows");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2009-09-16 18:04:01 +00:00
|
|
|
static void rna_def_point_lamp(BlenderRNA *brna)
|
2009-01-10 22:57:33 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "PointLamp", "Lamp");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Lamp");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Point Lamp", "Omnidirectional point lamp");
|
2009-09-16 18:04:01 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_LAMP_POINT);
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
rna_def_lamp_falloff(srna);
|
|
|
|
|
rna_def_lamp_shadow(srna, 0, 0);
|
|
|
|
|
}
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_def_area_lamp(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static EnumPropertyItem prop_areashape_items[] = {
|
2009-06-16 00:52:21 +00:00
|
|
|
{LA_AREA_SQUARE, "SQUARE", 0, "Square", ""},
|
|
|
|
|
{LA_AREA_RECT, "RECTANGLE", 0, "Rectangle", ""},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
|
};
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "AreaLamp", "Lamp");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Lamp");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Area Lamp", "Directional area lamp");
|
2009-09-16 18:04:01 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_LAMP_AREA);
|
2009-01-10 22:57:33 +00:00
|
|
|
|
|
|
|
|
rna_def_lamp_shadow(srna, 0, 1);
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_umbra", PROP_BOOLEAN, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_UMBRA);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Umbra", "Emphasize parts that are fully shadowed (Constant Jittered sampling)");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_dither", PROP_BOOLEAN, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_DITHER);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Dither", "Use 2x2 dithering for sampling (Constant Jittered sampling)");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_jitter", PROP_BOOLEAN, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "ray_samp_type", LA_SAMP_JITTER);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Jitter", "Use noise for sampling (Constant Jittered sampling)");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "area_shape");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_areashape_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Shape", "Shape of the area lamp");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_DISTANCE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "area_size");
|
2009-05-21 07:40:43 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Size", "Size of the area of the area Lamp, X direction size for Rectangle shapes");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "size_y", PROP_FLOAT, PROP_DISTANCE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "area_sizey");
|
2009-05-21 07:40:43 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 100, 0.1, 3);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Size Y",
|
|
|
|
|
"Size of the area of the area Lamp in the Y direction for Rectangle shapes");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "k");
|
2009-05-21 07:40:43 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.001, 2.0, 0.1, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Gamma", "Light gamma correction value");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_spot_lamp(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "SpotLamp", "Lamp");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Lamp");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Spot Lamp", "Directional cone lamp");
|
2009-09-16 18:04:01 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_LAMP_SPOT);
|
2009-01-10 22:57:33 +00:00
|
|
|
|
|
|
|
|
rna_def_lamp_falloff(srna);
|
|
|
|
|
rna_def_lamp_shadow(srna, 1, 0);
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_square", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SQUARE);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Square", "Cast a square spot light shape");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
|
2008-11-29 14:35:50 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Halo", "Render spotlight with a volumetric halo");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "haint");
|
2009-05-21 07:40:43 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3);
|
2011-04-17 08:38:27 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "shadhalostep");
|
|
|
|
|
RNA_def_property_range(prop, 0, 12);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Halo Step", "Volumetric halo sampling frequency");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_update");
|
2008-11-29 14:35:50 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "spot_blend", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "spotblend");
|
2012-04-29 15:47:02 +00:00
|
|
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Spot Blend", "The softness of the spotlight edge");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE);
|
|
|
|
|
/* RNA_def_property_float_sdna(prop, NULL, "spotsize"); */
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_range(prop, M_PI / 180.0, M_PI);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam");
|
2012-05-12 11:01:29 +00:00
|
|
|
/* only for deg/rad conversion */
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "show_cone", PROP_BOOLEAN, PROP_NONE);
|
2010-01-25 14:47:32 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_CONE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Show Cone",
|
|
|
|
|
"Draw transparent cone in 3D view to visualize which objects are contained in it");
|
2010-01-25 14:47:32 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_sun_lamp(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "SunLamp", "Lamp");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Lamp");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp");
|
2009-09-16 18:04:01 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN);
|
2009-01-03 05:41:58 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
rna_def_lamp_shadow(srna, 0, 0);
|
|
|
|
|
|
|
|
|
|
/* sky */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE);
|
2009-09-16 18:04:01 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_struct_type(prop, "LampSkySettings");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL, NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps");
|
2009-06-02 23:53:40 +00:00
|
|
|
|
|
|
|
|
rna_def_lamp_sky_settings(brna);
|
2012-05-01 02:50:17 +00:00
|
|
|
|
|
|
|
|
/* BGE Only */
|
2012-05-12 11:01:29 +00:00
|
|
|
prop = RNA_def_property(srna, "shadow_frustum_size", PROP_FLOAT, PROP_NONE);
|
2012-05-01 02:50:17 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "shadow_frustum_size");
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.001, 100.0, 2, 1);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Frustum Size", "Size of the frustum used for creating the shadow map");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Lamp_draw_update");
|
2009-01-03 05:41:58 +00:00
|
|
|
}
|
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_def_hemi_lamp(BlenderRNA *brna)
|
2009-01-03 05:41:58 +00:00
|
|
|
{
|
2009-01-10 03:44:02 +00:00
|
|
|
StructRNA *srna;
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "HemiLamp", "Lamp");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Lamp");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Hemi Lamp", "180 degree constant lamp");
|
2009-09-16 18:04:01 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_LAMP_HEMI);
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RNA_def_lamp(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
rna_def_lamp(brna);
|
2009-09-16 18:04:01 +00:00
|
|
|
rna_def_point_lamp(brna);
|
2009-01-10 22:57:33 +00:00
|
|
|
rna_def_area_lamp(brna);
|
|
|
|
|
rna_def_spot_lamp(brna);
|
|
|
|
|
rna_def_sun_lamp(brna);
|
|
|
|
|
rna_def_hemi_lamp(brna);
|
|
|
|
|
rna_def_lamp_mtex(brna);
|
2008-11-18 10:57:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|