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:
authorTon Roosendaal <ton@blender.org>2011-04-27 15:58:34 +0400
committerTon Roosendaal <ton@blender.org>2011-04-27 15:58:34 +0400
commitda376e0237517543aa21740ee2363234ee1c20ae (patch)
tree014a513ed8d0eccc5e54fef42347781e85bae56a /intern/cycles/blender/blender_sync.h
parent693780074388111e7b9ef1c3825e462f398dc6c4 (diff)
Cycles render engine, initial commit. This is the engine itself, blender modifications and build instructions will follow later.
Cycles uses code from some great open source projects, many thanks them: * BVH building and traversal code from NVidia's "Understanding the Efficiency of Ray Traversal on GPUs": http://code.google.com/p/understanding-the-efficiency-of-ray-traversal-on-gpus/ * Open Shading Language for a large part of the shading system: http://code.google.com/p/openshadinglanguage/ * Blender for procedural textures and a few other nodes. * Approximate Catmull Clark subdivision from NVidia Mesh tools: http://code.google.com/p/nvidia-mesh-tools/ * Sobol direction vectors from: http://web.maths.unsw.edu.au/~fkuo/sobol/ * Film response functions from: http://www.cs.columbia.edu/CAVE/software/softlib/dorf.php
Diffstat (limited to 'intern/cycles/blender/blender_sync.h')
-rw-r--r--intern/cycles/blender/blender_sync.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h
new file mode 100644
index 00000000000..f1fce37bfaf
--- /dev/null
+++ b/intern/cycles/blender/blender_sync.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * 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,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __BLENDER_SYNC_H__
+#define __BLENDER_SYNC_H__
+
+#include "MEM_guardedalloc.h"
+#include "RNA_types.h"
+#include "RNA_access.h"
+#include "RNA_blender_cpp.h"
+
+#include "blender_util.h"
+
+#include "scene.h"
+#include "session.h"
+
+#include "util_map.h"
+#include "util_set.h"
+#include "util_transform.h"
+#include "util_vector.h"
+
+CCL_NAMESPACE_BEGIN
+
+class Background;
+class Camera;
+class Film;
+class Light;
+class Mesh;
+class Object;
+class Scene;
+class Shader;
+class ShaderGraph;
+class ShaderNode;
+
+class BlenderSync {
+public:
+ BlenderSync(BL::BlendData b_data, BL::Scene b_scene, Scene *scene_, bool preview_);
+ ~BlenderSync();
+
+ /* sync */
+ bool sync_recalc();
+ void sync_data(BL::SpaceView3D b_v3d);
+ void sync_camera(int width, int height);
+ void sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height);
+
+ /* get parameters */
+ static SceneParams get_scene_params(BL::Scene b_scene);
+ static SessionParams get_session_params(BL::Scene b_scene, bool background);
+
+private:
+ /* sync */
+ void sync_lamps();
+ void sync_materials();
+ void sync_objects(BL::SpaceView3D b_v3d);
+ void sync_film();
+ void sync_integrator();
+ void sync_view();
+ void sync_world();
+ void sync_shaders();
+
+ void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree);
+ Mesh *sync_mesh(BL::Object b_ob, bool object_updated);
+ void sync_object(BL::Object b_parent, int b_index, BL::Object b_object, Transform& tfm);
+ void sync_light(BL::Object b_ob, Transform& tfm);
+
+ /* util */
+ void find_shader(BL::ID id, vector<uint>& used_shaders);
+ bool object_is_modified(BL::Object b_ob);
+ bool object_is_mesh(BL::Object b_ob);
+ bool object_is_light(BL::Object b_ob);
+
+ /* variables */
+ BL::BlendData b_data;
+ BL::Scene b_scene;
+
+ id_map<void*, Shader> shader_map;
+ id_map<ObjectKey, Object> object_map;
+ id_map<void*, Mesh> mesh_map;
+ id_map<void*, Light> light_map;
+ void *world_map;
+ bool world_recalc;
+
+ Scene *scene;
+ bool preview;
+};
+
+CCL_NAMESPACE_END
+
+#endif /* __BLENDER_SYNC_H__ */
+