2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-11-30 22:48:43 +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-30 22:48:43 +00:00
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation (2008).
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:20:01 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_world.c
|
|
|
|
* \ingroup RNA
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2009-01-05 04:10:59 +00:00
|
|
|
#include <float.h>
|
2008-11-30 22:48:43 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
#include "DNA_material_types.h"
|
|
|
|
#include "DNA_texture_types.h"
|
2008-11-30 22:48:43 +00:00
|
|
|
#include "DNA_world_types.h"
|
|
|
|
|
2010-07-19 19:57:28 +00:00
|
|
|
#include "WM_types.h"
|
|
|
|
|
2008-11-30 22:48:43 +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"
|
|
|
|
|
2010-01-27 21:40:08 +00:00
|
|
|
static PointerRNA rna_World_lighting_get(PointerRNA *ptr)
|
2009-01-05 03:44:19 +00:00
|
|
|
{
|
2010-01-27 21:40:08 +00:00
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_WorldLighting, ptr->id.data);
|
2009-01-05 03:44:19 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static PointerRNA rna_World_stars_get(PointerRNA *ptr)
|
2009-01-10 22:57:33 +00:00
|
|
|
{
|
2009-02-02 19:57:57 +00:00
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_WorldStarsSettings, ptr->id.data);
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
2009-02-02 19:57:57 +00:00
|
|
|
static PointerRNA rna_World_mist_get(PointerRNA *ptr)
|
2009-01-10 22:57:33 +00:00
|
|
|
{
|
2009-02-02 19:57:57 +00:00
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_WorldMistSettings, ptr->id.data);
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_World_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
World *wo = (World *)ptr->data;
|
|
|
|
rna_iterator_array_begin(iter, (void *)wo->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_World_active_texture_get(PointerRNA *ptr)
|
2009-01-10 22:57:33 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
World *wo = (World *)ptr->data;
|
2009-07-28 18:54:02 +00:00
|
|
|
Tex *tex;
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
tex = give_current_world_texture(wo);
|
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_World_active_texture_set(PointerRNA *ptr, PointerRNA value)
|
2009-07-15 19:20:59 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
World *wo = (World *)ptr->data;
|
2009-10-12 13:12:45 +00:00
|
|
|
|
|
|
|
set_current_world_texture(wo, value.data);
|
2009-07-15 19:20:59 +00:00
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_World_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
|
|
|
World *wo = 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(&wo->id, 0);
|
2009-12-08 17:23:48 +00:00
|
|
|
WM_main_add_notifier(NC_WORLD, wo);
|
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_World_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
|
|
|
World *wo = 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(&wo->id, 0);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_WORLD | ND_WORLD_DRAW, wo);
|
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-11-19 11:10:56 +00:00
|
|
|
/* so camera mist limits redraw */
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_World_draw_mist_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2010-11-19 11:10:56 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
World *wo = ptr->id.data;
|
2010-11-19 11:10:56 +00:00
|
|
|
|
2010-12-05 18:59:23 +00:00
|
|
|
DAG_id_tag_update(&wo->id, 0);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_WORLD | ND_WORLD_DRAW, wo);
|
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
|
2010-11-19 11:10:56 +00:00
|
|
|
}
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_World_stars_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2010-11-15 08:53:35 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
World *wo = ptr->id.data;
|
2010-11-15 08:53:35 +00:00
|
|
|
|
2010-12-05 18:59:23 +00:00
|
|
|
DAG_id_tag_update(&wo->id, 0);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_WORLD | ND_WORLD_STARS, wo);
|
2010-11-15 08:53:35 +00:00
|
|
|
}
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
static void rna_World_use_nodes_update(bContext *C, PointerRNA *ptr)
|
2011-11-02 18:55:32 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
World *wrld = (World *)ptr->data;
|
2011-11-02 18:55:32 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (wrld->use_nodes && wrld->nodetree == NULL)
|
2013-03-18 16:34:57 +00:00
|
|
|
ED_node_shader_default(C, &wrld->id);
|
2011-11-02 18:55:32 +00:00
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
rna_World_update(CTX_data_main(C), CTX_data_scene(C), ptr);
|
2011-11-02 18:55:32 +00:00
|
|
|
}
|
2010-11-15 08:53:35 +00:00
|
|
|
|
2008-11-30 22:48:43 +00:00
|
|
|
#else
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static void rna_def_world_mtex(BlenderRNA *brna)
|
2009-01-05 03:44:19 +00:00
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
static EnumPropertyItem texco_items[] = {
|
2011-11-26 12:30:01 +00:00
|
|
|
{TEXCO_VIEW, "VIEW", 0, "View", "Use view vector for the texture coordinates"},
|
|
|
|
{TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates (interior mist)"},
|
|
|
|
{TEXCO_ANGMAP, "ANGMAP", 0, "AngMap", "Use 360 degree angular coordinates, e.g. for spherical light probes"},
|
2010-02-11 01:11:52 +00:00
|
|
|
{TEXCO_H_SPHEREMAP, "SPHERE", 0, "Sphere", "For 360 degree panorama sky, spherical mapped, only top half"},
|
2011-12-19 23:52:17 +00:00
|
|
|
{TEXCO_EQUIRECTMAP, "EQUIRECT", 0, "Equirectangular", "For 360 degree panorama sky, equirectangular mapping"},
|
2010-02-11 01:11:52 +00:00
|
|
|
{TEXCO_H_TUBEMAP, "TUBE", 0, "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half"},
|
2011-11-26 12:30:01 +00:00
|
|
|
{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, "WorldTextureSlot", "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, "World Texture Slot", "Texture slot for textures in a World datablock");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
|
|
|
/* map to */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_map_blend", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_BLEND);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Blend", "Affect the color progression of the background");
|
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_World_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_map_horizon", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_HORIZ);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Horizon", "Affect the color of the horizon");
|
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_World_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_map_zenith_up", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENUP);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Zenith Up", "Affect the color of the zenith above");
|
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_World_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_map_zenith_down", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mapto", WOMAP_ZENDOWN);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Zenith Down", "Affect the color of the zenith below");
|
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_World_update");
|
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, texco_items);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Texture Coordinates",
|
|
|
|
"Texture coordinates used to map the texture onto the background");
|
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_World_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
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");
|
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_World_update");
|
2009-07-21 12:57:55 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
|
2009-10-01 17:15:23 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "blendfac");
|
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, "Blend Factor", "Amount texture affects color progression of the background");
|
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_World_update");
|
2009-07-21 12:57:55 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "horizon_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, "Horizon Factor", "Amount texture affects color of the horizon");
|
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_World_update");
|
2009-07-21 12:57:55 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "zenith_up_factor", PROP_FLOAT, PROP_NONE);
|
2009-10-01 17:15:23 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "zenupfac");
|
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, "Zenith Up Factor", "Amount texture affects color of the zenith above");
|
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_World_update");
|
2009-07-21 12:57:55 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "zenith_down_factor", PROP_FLOAT, PROP_NONE);
|
2009-10-01 17:15:23 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "zendownfac");
|
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, "Zenith Down Factor", "Amount texture affects color of the zenith below");
|
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_World_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
2010-01-27 21:40:08 +00:00
|
|
|
static void rna_def_lighting(BlenderRNA *brna)
|
2009-01-10 22:57:33 +00:00
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
|
|
|
static EnumPropertyItem blend_mode_items[] = {
|
2010-02-10 22:18:00 +00:00
|
|
|
{WO_AOMUL, "MULTIPLY", 0, "Multiply", "Multiply direct lighting with ambient occlusion, darkening the result"},
|
|
|
|
{WO_AOADD, "ADD", 0, "Add", "Add light and shadow"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
};
|
2009-01-05 03:44:19 +00:00
|
|
|
|
|
|
|
static EnumPropertyItem prop_color_items[] = {
|
2009-06-16 00:52:21 +00:00
|
|
|
{WO_AOPLAIN, "PLAIN", 0, "White", "Plain diffuse energy (white.)"},
|
2010-02-10 22:18:00 +00:00
|
|
|
{WO_AOSKYCOL, "SKY_COLOR", 0, "Sky Color", "Use horizon and zenith color for diffuse energy"},
|
|
|
|
{WO_AOSKYTEX, "SKY_TEXTURE", 0, "Sky Texture", "Does full Sky texture render for diffuse energy"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
};
|
2009-01-05 03:44:19 +00:00
|
|
|
|
|
|
|
static EnumPropertyItem prop_sample_method_items[] = {
|
2011-05-15 17:59:48 +00:00
|
|
|
{WO_AOSAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", "Fastest and gives the most noise"},
|
2010-02-10 22:18:00 +00:00
|
|
|
{WO_AOSAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", "Fast in high-contrast areas"},
|
|
|
|
{WO_AOSAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", "Best quality"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
};
|
2009-01-05 03:44:19 +00:00
|
|
|
|
|
|
|
static EnumPropertyItem prop_gather_method_items[] = {
|
2010-02-10 22:18:00 +00:00
|
|
|
{WO_AOGATHER_RAYTRACE, "RAYTRACE", 0, "Raytrace", "Accurate, but slow when noise-free results are required"},
|
|
|
|
{WO_AOGATHER_APPROX, "APPROXIMATE", 0, "Approximate", "Inaccurate, but faster and without noise"},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
};
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "WorldLighting", NULL);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_struct_sdna(srna, "World");
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_nested(brna, srna, "World");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Lighting", "Lighting for a World datablock");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2010-01-27 21:40:08 +00:00
|
|
|
/* ambient occlusion */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_ambient_occlusion", PROP_BOOLEAN, PROP_NONE);
|
2009-01-05 04:10:59 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_AMB_OCC);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Ambient Occlusion",
|
|
|
|
"Use Ambient Occlusion to add shadowing based on distance between objects");
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "ao_factor", PROP_FLOAT, PROP_FACTOR);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "aoenergy");
|
|
|
|
RNA_def_property_range(prop, 0, INT_MAX);
|
|
|
|
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
|
2010-02-14 06:18:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending");
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "ao_blend_type", PROP_ENUM, PROP_NONE);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "aomix");
|
|
|
|
RNA_def_property_enum_items(prop, blend_mode_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Blend Mode", "Defines how AO mixes with material shading");
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
|
|
|
/* environment lighting */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_environment_light", PROP_BOOLEAN, PROP_NONE);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_ENV_LIGHT);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Environment Lighting", "Add light coming from the environment");
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "environment_energy", PROP_FLOAT, PROP_NONE);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ao_env_energy");
|
2010-08-22 16:44:48 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, FLT_MAX, 1, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Environment Color", "Defines the strength of environment light");
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "environment_color", PROP_ENUM, PROP_NONE);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "aocolor");
|
|
|
|
RNA_def_property_enum_items(prop, prop_color_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Environment Color", "Defines where the color of the environment light comes from");
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
|
|
|
/* indirect lighting */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_indirect_light", PROP_BOOLEAN, PROP_NONE);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_INDIRECT_LIGHT);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Indirect Lighting", "Add indirect light bouncing of surrounding objects");
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "indirect_factor", PROP_FLOAT, PROP_FACTOR);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ao_indirect_energy");
|
|
|
|
RNA_def_property_range(prop, 0, INT_MAX);
|
|
|
|
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Indirect Factor", "Factor for how much surrounding objects contribute to light");
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "indirect_bounces", PROP_INT, PROP_UNSIGNED);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "ao_indirect_bounces");
|
2010-11-21 03:45:35 +00:00
|
|
|
RNA_def_property_range(prop, 1, SHRT_MAX);
|
2011-04-02 12:54:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Bounces", "Number of indirect diffuse light bounces");
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
|
|
|
/* gathering parameters */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "gather_method", PROP_ENUM, PROP_NONE);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "ao_gather_method");
|
|
|
|
RNA_def_property_enum_items(prop, prop_gather_method_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Gather Method", "");
|
|
|
|
RNA_def_property_update(prop, 0, "rna_World_update");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "passes", PROP_INT, PROP_NONE);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "ao_approx_passes");
|
|
|
|
RNA_def_property_range(prop, 0, 10);
|
2012-07-04 15:52:07 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Passes", "Number of preprocessing passes to reduce over-occlusion");
|
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_World_update");
|
2009-01-05 04:10:59 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "aodist");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Distance",
|
|
|
|
"Length of rays, defines how far away other faces give occlusion effect");
|
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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "aodistfac");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Strength",
|
|
|
|
"Attenuation falloff strength, the higher, the less influence distant objects have");
|
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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "bias", PROP_FLOAT, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "aobias");
|
|
|
|
RNA_def_property_range(prop, 0, 0.5);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Bias",
|
|
|
|
"Bias (in radians) to prevent smoothed faces from showing banding "
|
|
|
|
"(for Raytrace Constant Jittered)");
|
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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_thresh");
|
|
|
|
RNA_def_property_range(prop, 0, 1);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Threshold",
|
|
|
|
"Samples below this threshold will be considered fully shadowed/unshadowed and skipped "
|
|
|
|
"(for Raytrace Adaptive QMC)");
|
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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "adapt_to_speed", PROP_FLOAT, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ao_adapt_speed_fac");
|
|
|
|
RNA_def_property_range(prop, 0, 1);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Adapt To Speed",
|
|
|
|
"Use the speed vector pass to reduce AO samples in fast moving pixels - "
|
|
|
|
"higher values result in more aggressive sample reduction "
|
|
|
|
"(requires Vec pass enabled, for Raytrace Adaptive QMC)");
|
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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ao_approx_error");
|
2009-04-12 17:28:41 +00:00
|
|
|
RNA_def_property_range(prop, 0.0001, 10);
|
2011-04-02 12:54:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Error Tolerance", "Low values are slower and higher quality");
|
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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ao_approx_correction");
|
|
|
|
RNA_def_property_range(prop, 0, 1);
|
2009-05-20 13:56:22 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 1, 0.1, 2);
|
2011-04-02 12:54:17 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Correction", "Ad-hoc correction for over-occlusion due to the approximation");
|
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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AODIST);
|
2011-05-15 17:59:48 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Falloff", "Distance will be used to attenuate 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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_cache", PROP_BOOLEAN, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "aomode", WO_AOCACHE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Pixel Cache",
|
|
|
|
"Cache AO results in pixels and interpolate over neighboring pixels for speedup");
|
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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "aosamp");
|
2011-09-06 15:44:44 +00:00
|
|
|
RNA_def_property_range(prop, 1, 128);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Samples",
|
|
|
|
"Amount of ray samples. Higher values give smoother results and longer rendering times");
|
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_World_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "sample_method", PROP_ENUM, PROP_NONE);
|
2009-01-05 03:44:19 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "ao_samp_method");
|
|
|
|
RNA_def_property_enum_items(prop, prop_sample_method_items);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Sample Method", "Method for generating shadow samples (for Raytrace)");
|
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_World_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_world_mist(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
2009-04-24 11:36:48 +00:00
|
|
|
|
|
|
|
static EnumPropertyItem falloff_items[] = {
|
2011-11-26 12:30:01 +00:00
|
|
|
{0, "QUADRATIC", 0, "Quadratic", "Use quadratic progression"},
|
|
|
|
{1, "LINEAR", 0, "Linear", "Use linear progression"},
|
|
|
|
{2, "INVERSE_QUADRATIC", 0, "Inverse Quadratic", "Use inverse quadratic progression"},
|
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, "WorldMistSettings", NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_sdna(srna, "World");
|
|
|
|
RNA_def_struct_nested(brna, srna, "World");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "World Mist", "Mist settings for a World data-block");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_MIST);
|
2010-05-16 08:36:29 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Mist", "Occlude objects with the environment color as they are further away");
|
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_World_draw_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "misi");
|
|
|
|
RNA_def_property_range(prop, 0, 1);
|
2011-11-02 12:18:51 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Minimum", "Overall minimum intensity of the mist effect");
|
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_World_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "start", PROP_FLOAT, PROP_DISTANCE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "miststa");
|
|
|
|
RNA_def_property_range(prop, 0, FLT_MAX);
|
|
|
|
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
|
2009-06-11 18:19:08 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera");
|
2010-11-19 11:10:56 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_draw_mist_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "mistdist");
|
|
|
|
RNA_def_property_range(prop, 0, FLT_MAX);
|
|
|
|
RNA_def_property_ui_range(prop, 0, 10000, 10, 2);
|
2011-10-20 07:56:04 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Depth", "Distance over which the mist effect fades in");
|
2010-11-19 11:10:56 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_draw_mist_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "misthi");
|
|
|
|
RNA_def_property_range(prop, 0, 100);
|
2009-06-11 18:19:08 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height");
|
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_World_update");
|
2009-04-24 11:36:48 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
|
2009-04-24 11:36:48 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "mistype");
|
|
|
|
RNA_def_property_enum_items(prop, falloff_items);
|
2009-06-11 18:19:08 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Falloff", "Type of transition used to fade mist");
|
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_World_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_world_stars(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "WorldStarsSettings", NULL);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_struct_sdna(srna, "World");
|
|
|
|
RNA_def_struct_nested(brna, srna, "World");
|
2011-10-20 07:56:04 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "World Stars", "Stars settings for a World data-block");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_stars", PROP_BOOLEAN, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_STARS);
|
2010-05-16 08:36:29 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Stars", "Enable starfield generation");
|
2010-11-15 08:53:35 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_stars_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_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "starsize");
|
|
|
|
RNA_def_property_range(prop, 0, 10);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Size", "Average screen dimension of stars");
|
2012-03-18 07:38:51 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_draw_update"); /* use normal update since this isn't visualized */
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_DISTANCE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "starmindist");
|
|
|
|
RNA_def_property_range(prop, 0, 1000);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance to the camera for stars");
|
2010-11-15 08:53:35 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_stars_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "average_separation", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "stardist");
|
|
|
|
RNA_def_property_range(prop, 2, 1000);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Average Separation", "Average distance between any two stars");
|
2010-11-15 08:53:35 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_stars_update");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color_random", PROP_FLOAT, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "starcolnoise");
|
|
|
|
RNA_def_property_range(prop, 0, 1);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color Randomization", "Randomize star colors");
|
2010-11-15 08:53:35 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_World_stars_update");
|
2009-01-05 03:44:19 +00:00
|
|
|
}
|
|
|
|
|
2008-11-30 22:48:43 +00:00
|
|
|
void RNA_def_world(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
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, "World", "ID");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "World",
|
|
|
|
"World datablock describing the environment and ambient lighting of a scene");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_WORLD_DATA);
|
2008-11-30 22:48:43 +00:00
|
|
|
|
2009-02-02 11:51:10 +00:00
|
|
|
rna_def_animdata_common(srna);
|
2010-09-03 14:53:54 +00:00
|
|
|
rna_def_mtex_common(brna, srna, "rna_World_mtex_begin", "rna_World_active_texture_get",
|
2012-05-12 11:01:29 +00:00
|
|
|
"rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", "rna_World_update");
|
2008-11-30 22:48:43 +00:00
|
|
|
|
2008-12-02 23:45:11 +00:00
|
|
|
/* colors */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR);
|
2008-11-30 22:48:43 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "horr");
|
2008-12-02 23:45:11 +00:00
|
|
|
RNA_def_property_array(prop, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon");
|
2010-07-19 19:57:28 +00:00
|
|
|
/* RNA_def_property_update(prop, 0, "rna_World_update"); */
|
2010-10-13 01:10:56 +00:00
|
|
|
/* render-only uses this */
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update");
|
2010-07-19 19:57:28 +00:00
|
|
|
|
2009-06-07 11:12:35 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR);
|
2008-12-02 23:45:11 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "zenr");
|
|
|
|
RNA_def_property_array(prop, 3);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith");
|
2013-01-06 15:02:23 +00:00
|
|
|
RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update");
|
2008-11-30 22:48:43 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR);
|
2008-12-02 23:45:11 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ambr");
|
|
|
|
RNA_def_property_array(prop, 3);
|
2011-05-15 17:59:48 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color of the world");
|
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_World_update");
|
2008-11-30 22:48:43 +00:00
|
|
|
|
|
|
|
/* exp, range */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE);
|
2008-11-30 22:48:43 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "exp");
|
|
|
|
RNA_def_property_range(prop, 0.0, 1.0);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for 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_World_update");
|
2008-11-30 22:48:43 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color_range", PROP_FLOAT, PROP_NONE);
|
2008-11-30 22:48:43 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "range");
|
|
|
|
RNA_def_property_range(prop, 0.2, 5.0);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1");
|
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_World_update");
|
2008-11-30 22:48:43 +00:00
|
|
|
|
|
|
|
/* sky type */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_sky_blend", PROP_BOOLEAN, PROP_NONE);
|
2008-11-30 22:48:43 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith");
|
2013-01-06 15:02:23 +00:00
|
|
|
RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update");
|
2008-11-30 22:48:43 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_sky_paper", PROP_BOOLEAN, PROP_NONE);
|
2008-11-30 22:48:43 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates");
|
2013-01-06 15:02:23 +00:00
|
|
|
RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update");
|
2008-11-30 22:48:43 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_sky_real", PROP_BOOLEAN, PROP_NONE);
|
2008-11-30 22:48:43 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle");
|
2013-01-06 15:02:23 +00:00
|
|
|
RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update");
|
2009-01-05 04:10:59 +00:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
/* nested structs */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "light_settings", PROP_POINTER, PROP_NONE);
|
2009-09-16 18:04:01 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
2010-01-27 21:40:08 +00:00
|
|
|
RNA_def_property_struct_type(prop, "WorldLighting");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_World_lighting_get", NULL, NULL, NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Lighting", "World lighting settings");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "mist_settings", 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, "WorldMistSettings");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL, NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Mist", "World mist settings");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "star_settings", 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, "WorldStarsSettings");
|
2010-08-03 05:14:59 +00:00
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL, NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Stars", "World stars settings");
|
2009-01-10 22:57:33 +00:00
|
|
|
|
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 worlds");
|
|
|
|
|
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 world");
|
|
|
|
RNA_def_property_update(prop, 0, "rna_World_use_nodes_update");
|
|
|
|
|
2010-01-27 21:40:08 +00:00
|
|
|
rna_def_lighting(brna);
|
2009-01-10 22:57:33 +00:00
|
|
|
rna_def_world_mist(brna);
|
|
|
|
rna_def_world_stars(brna);
|
|
|
|
rna_def_world_mtex(brna);
|
2008-11-30 22:48:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|