2 * Copyright 2011, Blender Foundation.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #include "device_memory.h"
26 #include "kernel_types.h"
28 #include "util_param.h"
29 #include "util_string.h"
30 #include "util_thread.h"
31 #include "util_types.h"
32 #include "util_vector.h"
52 /* Scene Device Data */
57 device_vector<float4> bvh_nodes;
58 device_vector<uint> object_node;
59 device_vector<float4> tri_woop;
60 device_vector<uint> prim_visibility;
61 device_vector<uint> prim_index;
62 device_vector<uint> prim_object;
65 device_vector<float4> tri_normal;
66 device_vector<float4> tri_vnormal;
67 device_vector<float4> tri_vindex;
68 device_vector<float4> tri_verts;
71 device_vector<float4> objects;
74 device_vector<uint4> attributes_map;
75 device_vector<float> attributes_float;
76 device_vector<float4> attributes_float3;
79 device_vector<float4> light_distribution;
80 device_vector<float4> light_data;
83 device_vector<uint4> svm_nodes;
84 device_vector<uint> shader_flag;
87 device_vector<float> filter_table;
90 device_vector<uint> sobol_directions;
93 device_vector<uchar4> tex_image[TEX_IMAGE_MAX];
98 /* Scene Parameters */
102 enum { OSL, SVM } shadingsystem;
103 bool use_multi_closure;
104 enum BVHType { BVH_DYNAMIC, BVH_STATIC } bvh_type;
106 bool use_bvh_spatial_split;
112 use_multi_closure = true;
113 bvh_type = BVH_DYNAMIC;
114 use_bvh_cache = false;
115 use_bvh_spatial_split = false;
123 bool modified(const SceneParams& params)
124 { return !(shadingsystem == params.shadingsystem
125 && bvh_type == params.bvh_type
126 && use_bvh_cache == params.use_bvh_cache
127 && use_bvh_spatial_split == params.use_bvh_spatial_split
128 && use_qbvh == params.use_qbvh); }
139 Background *background;
140 Integrator *integrator;
143 vector<Object*> objects;
144 vector<Mesh*> meshes;
145 vector<Shader*> shaders;
146 vector<Light*> lights;
149 ImageManager *image_manager;
150 LightManager *light_manager;
151 ShaderManager *shader_manager;
152 MeshManager *mesh_manager;
153 ObjectManager *object_manager;
155 /* default shaders */
158 int default_background;
167 /* mutex must be locked manually by callers */
170 Scene(const SceneParams& params);
173 void device_update(Device *device, Progress& progress);
181 #endif /* __SCENE_H__ */