Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Romanov <a.romanov@blend4web.com>2016-06-07 10:33:32 +0300
committerAlexander Romanov <a.romanov@blend4web.com>2016-06-07 10:42:29 +0300
commit0da13ad1ebea9e880a0cd7e1d8b32ea567aef174 (patch)
tree53fc3b010e14d615161f908a6b93fdc3b333e284 /source/blender/blenkernel/intern/scene.c
parent441a440cbbb700511d6d1ec01e2f149355adcc02 (diff)
World space switch for BI nodes.
At the moment light shading in Blender is produced in viewspace. Apparently, that's why shader nodes work with normals in camera space. But it is not convenient for artists. The more convenient approach is implemented in Cycles where normals are represented in world space. Blend4Web Team designed the engine keeping in mind shader parameters readability, so normals are interpreted in world space as well. And now our users have to use some tweaks, like empty node group with the name "Replace", which is replacing one input by another on the engine side (replacing working configuration in Blender Viewport by the configuration that has the same behavior in the engine). This patch adds the ability to switch to world space for normals and lamp vector in BI and Viewport. This patch is very important to us and we crave to see this patch in Blender 2.7 because it will significantly simplify Blend4Web material creation workflow. {F315547} {F315548} Reviewers: campbellbarton, brecht Reviewed By: brecht Subscribers: homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov Differential Revision: https://developer.blender.org/D2046
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r--source/blender/blenkernel/intern/scene.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index d307ba1811b..d16e6d5d17a 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -2193,6 +2193,12 @@ bool BKE_scene_use_shading_nodes_custom(Scene *scene)
return (type && type->flag & RE_USE_SHADING_NODES_CUSTOM);
}
+bool BKE_scene_use_world_space_shading(Scene *scene)
+{
+ const RenderEngineType *type = RE_engines_find(scene->r.engine);
+ return (type && (type->flag & RE_USE_SHADING_NODES) || (scene->r.mode & R_USE_WS_SHADING));
+}
+
bool BKE_scene_use_spherical_stereo(Scene *scene)
{
RenderEngineType *type = RE_engines_find(scene->r.engine);