[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50451] branches/cloth-eltopo: Merge from trunk r50428-r50450
Daniel Genrich
daniel.genrich at gmx.net
Thu Sep 6 12:37:01 CEST 2012
Revision: 50451
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50451
Author: genscher
Date: 2012-09-06 10:37:00 +0000 (Thu, 06 Sep 2012)
Log Message:
-----------
Merge from trunk r50428-r50450
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50428
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50450
Modified Paths:
--------------
branches/cloth-eltopo/intern/audaspace/intern/AUD_ReferenceHandler.cpp
branches/cloth-eltopo/intern/cycles/kernel/kernel_accumulate.h
branches/cloth-eltopo/intern/cycles/kernel/kernel_triangle.h
branches/cloth-eltopo/intern/cycles/kernel/kernel_types.h
branches/cloth-eltopo/intern/cycles/kernel/osl/CMakeLists.txt
branches/cloth-eltopo/intern/cycles/kernel/osl/osl_closures.cpp
branches/cloth-eltopo/intern/cycles/kernel/osl/osl_closures.h
branches/cloth-eltopo/intern/cycles/kernel/osl/osl_services.h
branches/cloth-eltopo/intern/cycles/kernel/osl/osl_shader.h
branches/cloth-eltopo/intern/ghost/GHOST_IEvent.h
branches/cloth-eltopo/intern/ghost/GHOST_IEventConsumer.h
branches/cloth-eltopo/intern/ghost/GHOST_ISystem.h
branches/cloth-eltopo/intern/ghost/GHOST_ISystemPaths.h
branches/cloth-eltopo/intern/ghost/GHOST_ITimerTask.h
branches/cloth-eltopo/intern/ghost/GHOST_IWindow.h
branches/cloth-eltopo/intern/ghost/GHOST_Path-api.h
branches/cloth-eltopo/intern/ghost/GHOST_Rect.h
branches/cloth-eltopo/intern/ghost/GHOST_Types.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_Buttons.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_CallbackEventConsumer.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_CallbackEventConsumer.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_DisplayManager.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_DisplayManager.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_DisplayManagerCarbon.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_DisplayManagerCarbon.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_DisplayManagerCocoa.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
branches/cloth-eltopo/intern/ghost/intern/GHOST_DisplayManagerWin32.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_DisplayManagerX11.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_DropTargetWin32.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_DropTargetX11.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_Event.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventButton.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventCursor.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventDragnDrop.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventKey.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventManager.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventManager.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventPrinter.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventString.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventTrackpad.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_EventWheel.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_ISystem.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_ISystemPaths.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_ModifierKeys.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_ModifierKeys.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_System.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemCarbon.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemCarbon.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemCocoa.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemCocoa.mm
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemPaths.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemPathsCarbon.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemPathsCocoa.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemPathsWin32.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemPathsX11.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemWin32.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemX11.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_SystemX11.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_TimerManager.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_TimerManager.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_TimerTask.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_Window.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_Window.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowCarbon.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowCarbon.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowCocoa.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowCocoa.mm
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowManager.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowManager.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowWin32.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowWin32.h
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowX11.cpp
branches/cloth-eltopo/intern/ghost/intern/GHOST_WindowX11.h
branches/cloth-eltopo/intern/ghost/test/gears/GHOST_C-Test.c
branches/cloth-eltopo/intern/ghost/test/gears/GHOST_Test.cpp
branches/cloth-eltopo/source/blender/blenfont/intern/blf_lang.c
branches/cloth-eltopo/source/blender/blenkernel/BKE_customdata.h
branches/cloth-eltopo/source/blender/blenkernel/BKE_mask.h
branches/cloth-eltopo/source/blender/blenkernel/BKE_object_deform.h
branches/cloth-eltopo/source/blender/blenkernel/BKE_script.h
branches/cloth-eltopo/source/blender/blenkernel/BKE_shrinkwrap.h
branches/cloth-eltopo/source/blender/blenkernel/intern/library.c
branches/cloth-eltopo/source/blender/blenkernel/intern/mball.c
branches/cloth-eltopo/source/blender/blenkernel/intern/sequencer.c
branches/cloth-eltopo/source/blender/blenkernel/intern/shrinkwrap.c
branches/cloth-eltopo/source/blender/blenkernel/intern/writeffmpeg.c
branches/cloth-eltopo/source/blender/blenlib/BLI_math_vector.h
branches/cloth-eltopo/source/blender/blenlib/BLI_path_util.h
branches/cloth-eltopo/source/blender/blenlib/intern/math_vector_inline.c
branches/cloth-eltopo/source/blender/blenloader/intern/readfile.c
branches/cloth-eltopo/source/blender/bmesh/bmesh.h
branches/cloth-eltopo/source/blender/bmesh/intern/bmesh_core.c
branches/cloth-eltopo/source/blender/bmesh/intern/bmesh_polygon.c
branches/cloth-eltopo/source/blender/bmesh/operators/bmo_connect.c
branches/cloth-eltopo/source/blender/bmesh/operators/bmo_subdivide.c
branches/cloth-eltopo/source/blender/compositor/COM_compositor.h
branches/cloth-eltopo/source/blender/compositor/intern/COM_Converter.cpp
branches/cloth-eltopo/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
branches/cloth-eltopo/source/blender/compositor/operations/COM_RenderLayersImageProg.h
branches/cloth-eltopo/source/blender/editors/animation/anim_filter.c
branches/cloth-eltopo/source/blender/editors/armature/reeb.c
branches/cloth-eltopo/source/blender/editors/armature/reeb.h
branches/cloth-eltopo/source/blender/editors/curve/editcurve.c
branches/cloth-eltopo/source/blender/editors/include/ED_mesh.h
branches/cloth-eltopo/source/blender/editors/include/ED_render.h
branches/cloth-eltopo/source/blender/editors/io/io_collada.h
branches/cloth-eltopo/source/blender/editors/io/io_ops.h
branches/cloth-eltopo/source/blender/editors/mesh/editmesh_slide.c
branches/cloth-eltopo/source/blender/editors/screen/glutil.c
branches/cloth-eltopo/source/blender/editors/space_sequencer/sequencer_draw.c
branches/cloth-eltopo/source/blender/editors/space_sequencer/sequencer_intern.h
branches/cloth-eltopo/source/blender/editors/uvedit/uvedit_intern.h
branches/cloth-eltopo/source/blender/ikplugin/BIK_api.h
branches/cloth-eltopo/source/blender/imbuf/intern/imbuf_cocoa.m
branches/cloth-eltopo/source/blender/makesdna/DNA_meshdata_types.h
branches/cloth-eltopo/source/blender/makesdna/DNA_scene_types.h
branches/cloth-eltopo/source/blender/makesdna/DNA_screen_types.h
branches/cloth-eltopo/source/blender/makesdna/DNA_sequence_types.h
branches/cloth-eltopo/source/blender/makesdna/DNA_userdef_types.h
branches/cloth-eltopo/source/blender/makesrna/intern/rna_scene.c
branches/cloth-eltopo/source/blender/makesrna/intern/rna_userdef.c
branches/cloth-eltopo/source/blender/modifiers/intern/MOD_weightvgproximity.c
branches/cloth-eltopo/source/blender/render/intern/include/render_types.h
branches/cloth-eltopo/source/blender/render/intern/include/sunsky.h
branches/cloth-eltopo/source/blender/render/intern/include/volumetric.h
branches/cloth-eltopo/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
branches/cloth-eltopo/source/gameengine/Expressions/PyObjectPlus.cpp
branches/cloth-eltopo/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
branches/cloth-eltopo/source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
branches/cloth-eltopo/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
branches/cloth-eltopo/source/gameengine/Ketsji/KX_PythonMain.cpp
Added Paths:
-----------
branches/cloth-eltopo/intern/cycles/kernel/osl/bsdf_phong.cpp
Modified: branches/cloth-eltopo/intern/audaspace/intern/AUD_ReferenceHandler.cpp
===================================================================
--- branches/cloth-eltopo/intern/audaspace/intern/AUD_ReferenceHandler.cpp 2012-09-06 09:44:32 UTC (rev 50450)
+++ branches/cloth-eltopo/intern/audaspace/intern/AUD_ReferenceHandler.cpp 2012-09-06 10:37:00 UTC (rev 50451)
@@ -22,7 +22,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file audaspace/intern/AUD_Reference.cpp
+/** \file audaspace/intern/AUD_ReferenceHandler.cpp
* \ingroup audaspaceintern
*/
Modified: branches/cloth-eltopo/intern/cycles/kernel/kernel_accumulate.h
===================================================================
--- branches/cloth-eltopo/intern/cycles/kernel/kernel_accumulate.h 2012-09-06 09:44:32 UTC (rev 50450)
+++ branches/cloth-eltopo/intern/cycles/kernel/kernel_accumulate.h 2012-09-06 10:37:00 UTC (rev 50451)
@@ -301,7 +301,7 @@
__device_inline void path_radiance_clamp(PathRadiance *L, float3 *L_sum, float clamp)
{
- #ifdef WITH_OSL
+ #ifdef __OSL__
using std::isfinite;
#endif
Modified: branches/cloth-eltopo/intern/cycles/kernel/kernel_triangle.h
===================================================================
--- branches/cloth-eltopo/intern/cycles/kernel/kernel_triangle.h 2012-09-06 09:44:32 UTC (rev 50450)
+++ branches/cloth-eltopo/intern/cycles/kernel/kernel_triangle.h 2012-09-06 10:37:00 UTC (rev 50451)
@@ -18,8 +18,6 @@
#include "kernel_projection.h"
-#include "util_param.h"
-
CCL_NAMESPACE_BEGIN
/* Point on triangle for Moller-Trumbore triangles */
Modified: branches/cloth-eltopo/intern/cycles/kernel/kernel_types.h
===================================================================
--- branches/cloth-eltopo/intern/cycles/kernel/kernel_types.h 2012-09-06 09:44:32 UTC (rev 50450)
+++ branches/cloth-eltopo/intern/cycles/kernel/kernel_types.h 2012-09-06 10:37:00 UTC (rev 50451)
@@ -22,7 +22,7 @@
#include "kernel_math.h"
#include "svm/svm_types.h"
-#include "util_param.h"
+#include "util_string.h"
#ifndef __KERNEL_GPU__
#define __KERNEL_CPU__
@@ -370,28 +370,28 @@
ATTR_STD_NOT_FOUND = ~0
} AttributeStandard;
-__device ustring attribute_standard_name(AttributeStandard std)
+__device string attribute_standard_name(AttributeStandard std)
{
if(std == ATTR_STD_VERTEX_NORMAL)
- return ustring("N");
+ return string("N");
else if(std == ATTR_STD_FACE_NORMAL)
- return ustring("Ng");
+ return string("Ng");
else if(std == ATTR_STD_UV)
- return ustring("uv");
+ return string("uv");
else if(std == ATTR_STD_GENERATED)
- return ustring("generated");
+ return string("generated");
else if(std == ATTR_STD_POSITION_UNDEFORMED)
- return ustring("undeformed");
+ return string("undeformed");
else if(std == ATTR_STD_POSITION_UNDISPLACED)
- return ustring("undisplaced");
+ return string("undisplaced");
else if(std == ATTR_STD_MOTION_PRE)
- return ustring("motion_pre");
+ return string("motion_pre");
else if(std == ATTR_STD_MOTION_POST)
- return ustring("motion_post");
+ return string("motion_post");
else if(std == ATTR_STD_PARTICLE)
- return ustring("particle");
+ return string("particle");
- return ustring();
+ return string();
}
/* Closure data */
Modified: branches/cloth-eltopo/intern/cycles/kernel/osl/CMakeLists.txt
===================================================================
--- branches/cloth-eltopo/intern/cycles/kernel/osl/CMakeLists.txt 2012-09-06 09:44:32 UTC (rev 50450)
+++ branches/cloth-eltopo/intern/cycles/kernel/osl/CMakeLists.txt 2012-09-06 10:37:00 UTC (rev 50451)
@@ -13,6 +13,7 @@
bsdf_ashikhmin_velvet.cpp
bsdf_diffuse.cpp
bsdf_oren_nayar.cpp
+ bsdf_phong.cpp
bsdf_microfacet.cpp
bsdf_reflection.cpp
bsdf_refraction.cpp
Copied: branches/cloth-eltopo/intern/cycles/kernel/osl/bsdf_phong.cpp (from rev 50450, trunk/blender/intern/cycles/kernel/osl/bsdf_phong.cpp)
===================================================================
--- branches/cloth-eltopo/intern/cycles/kernel/osl/bsdf_phong.cpp (rev 0)
+++ branches/cloth-eltopo/intern/cycles/kernel/osl/bsdf_phong.cpp 2012-09-06 10:37:00 UTC (rev 50451)
@@ -0,0 +1,277 @@
+/*
+ * Adapted from Open Shading Language with this license:
+ *
+ * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al.
+ * All Rights Reserved.
+ *
+ * Modifications Copyright 2012, Blender Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Sony Pictures Imageworks nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <OpenImageIO/fmath.h>
+
+#include <OSL/genclosure.h>
+#include "osl_closures.h"
+#include "util_math.h"
+
+CCL_NAMESPACE_BEGIN
+
+using namespace OSL;
+
+// vanilla phong - leaks energy at grazing angles
+// see Global Illumination Compendium entry (66)
+class PhongClosure : public BSDFClosure {
+public:
+ Vec3 m_N;
+ float m_exponent;
+ PhongClosure() : BSDFClosure(Labels::GLOSSY) { }
+
+ void setup() {};
+
+ bool mergeable (const ClosurePrimitive *other) const {
+ const PhongClosure *comp = (const PhongClosure *)other;
+ return m_N == comp->m_N && m_exponent == comp->m_exponent &&
+ BSDFClosure::mergeable(other);
+ }
+
+ size_t memsize () const { return sizeof(*this); }
+
+ const char *name () const { return "phong"; }
+
+ void print_on (std::ostream &out) const {
+ out << name() << " ((";
+ out << m_N[0] << ", " << m_N[1] << ", " << m_N[2] << "), ";
+ out << m_exponent << ")";
+ }
+
+ float albedo (const Vec3 &omega_out) const
+ {
+ return 1.0f;
+ }
+
+ Color3 eval_reflect (const Vec3 &omega_out, const Vec3 &omega_in, float& pdf) const
+ {
+ float cosNI = m_N.dot(omega_in);
+ float cosNO = m_N.dot(omega_out);
+ if (cosNI > 0 && cosNO > 0) {
+ // reflect the view vector
+ Vec3 R = (2 * cosNO) * m_N - omega_out;
+ float cosRI = R.dot(omega_in);
+ if (cosRI > 0) {
+ float common = 0.5f * (float) M_1_PI * powf(cosRI, m_exponent);
+ float out = cosNI * (m_exponent + 2) * common;
+ pdf = (m_exponent + 1) * common;
+ return Color3 (out, out, out);
+ }
+ }
+ return Color3 (0, 0, 0);
+ }
+
+ Color3 eval_transmit (const Vec3 &omega_out, const Vec3 &omega_in, float& pdf) const
+ {
+ return Color3 (0, 0, 0);
+ }
+
+ ustring sample (const Vec3 &Ng,
+ const Vec3 &omega_out, const Vec3 &domega_out_dx, const Vec3 &domega_out_dy,
+ float randu, float randv,
+ Vec3 &omega_in, Vec3 &domega_in_dx, Vec3 &domega_in_dy,
+ float &pdf, Color3 &eval) const
+ {
+ float cosNO = m_N.dot(omega_out);
+ if (cosNO > 0) {
+ // reflect the view vector
+ Vec3 R = (2 * cosNO) * m_N - omega_out;
+ domega_in_dx = (2 * m_N.dot(domega_out_dx)) * m_N - domega_out_dx;
+ domega_in_dy = (2 * m_N.dot(domega_out_dy)) * m_N - domega_out_dy;
+ Vec3 T, B;
+ make_orthonormals (R, T, B);
+ float phi = 2 * (float) M_PI * randu;
+ float cosTheta = powf(randv, 1 / (m_exponent + 1));
+ float sinTheta2 = 1 - cosTheta * cosTheta;
+ float sinTheta = sinTheta2 > 0 ? sqrtf(sinTheta2) : 0;
+ omega_in = (cosf(phi) * sinTheta) * T +
+ (sinf(phi) * sinTheta) * B +
+ ( cosTheta) * R;
+ if (Ng.dot(omega_in) > 0)
+ {
+ // common terms for pdf and eval
+ float cosNI = m_N.dot(omega_in);
+ // make sure the direction we chose is still in the right hemisphere
+ if (cosNI > 0)
+ {
+ float common = 0.5f * (float) M_1_PI * powf(cosTheta, m_exponent);
+ pdf = (m_exponent + 1) * common;
+ float out = cosNI * (m_exponent + 2) * common;
+ eval.setValue(out, out, out);
+ // Since there is some blur to this reflection, make the
+ // derivatives a bit bigger. In theory this varies with the
+ // exponent but the exact relationship is complex and
+ // requires more ops than are practical.
+ domega_in_dx *= 10;
+ domega_in_dy *= 10;
+ }
+ }
+ }
+ return Labels::REFLECT;
+ }
+};
+
+
+class PhongRampClosure : public BSDFClosure {
+public:
+ static const int MAXCOLORS = 8;
+ Vec3 m_N;
+ float m_exponent;
+ Color3 m_colors[MAXCOLORS];
+ PhongRampClosure() : BSDFClosure(Labels::GLOSSY) { }
+
+ void setup() {};
+
+ bool mergeable (const ClosurePrimitive *other) const {
+ const PhongRampClosure *comp = (const PhongRampClosure *)other;
+ if (! (m_N == comp->m_N && m_exponent == comp->m_exponent &&
+ BSDFClosure::mergeable(other)))
+ return false;
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list