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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2018-03-01 13:54:01 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2018-03-01 13:54:01 +0300
commit7377d411b47d50cd943cd33e3e55c0409bb79f91 (patch)
treee623f792356d08ea03dd37b28de0b57a1695b3af /intern/cycles/render/mesh.h
parent172614fb7dac799d373e778a541e8d9f78228221 (diff)
Cycles volume: fast empty space optimization by generating a tight mesh
around the volume. We generate a tight mesh around the active voxels of the volume in order to effectively skip empty space, and start volume ray marching as close to interesting volume data as possible. See code comments for details on how the mesh generation algorithm works. This gives up to 2x speedups in some scenes. Reviewed by: brecht, dingto Reviewers: #cycles Subscribers: lvxejay, jtheninja, brecht Differential Revision: https://developer.blender.org/D3038
Diffstat (limited to 'intern/cycles/render/mesh.h')
-rw-r--r--intern/cycles/render/mesh.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/intern/cycles/render/mesh.h b/intern/cycles/render/mesh.h
index 07d8bbdbf31..c0d1513bee0 100644
--- a/intern/cycles/render/mesh.h
+++ b/intern/cycles/render/mesh.h
@@ -202,7 +202,8 @@ public:
array<int> triangle_patch; /* must be < 0 for non subd triangles */
array<float2> vert_patch_uv;
- bool has_volume; /* Set in the device_update_flags(). */
+ float volume_isovalue;
+ bool has_volume; /* Set in the device_update_flags(). */
bool has_surface_bssrdf; /* Set in the device_update_flags(). */
array<float3> curve_keys;
@@ -264,7 +265,7 @@ public:
void reserve_curves(int numcurves, int numkeys);
void resize_subd_faces(int numfaces, int num_ngons, int numcorners);
void reserve_subd_faces(int numfaces, int num_ngons, int numcorners);
- void clear();
+ void clear(bool preserve_voxel_data = false);
void add_vertex(float3 P);
void add_vertex_slow(float3 P);
void add_triangle(int v0, int v1, int v2, int shader, bool smooth);
@@ -335,13 +336,15 @@ public:
void update_osl_attributes(Device *device, Scene *scene, vector<AttributeRequestSet>& mesh_attributes);
void update_svm_attributes(Device *device, DeviceScene *dscene, Scene *scene, vector<AttributeRequestSet>& mesh_attributes);
+ void device_update_preprocess(Device *device, Scene *scene, Progress& progress);
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress);
- void device_update_flags(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress);
void device_free(Device *device, DeviceScene *dscene);
void tag_update(Scene *scene);
+ void create_volume_mesh(Scene *scene, Mesh *mesh, Progress &progress);
+
protected:
/* Calculate verts/triangles/curves offsets in global arrays. */
void mesh_calc_offset(Scene *scene);
@@ -370,6 +373,10 @@ protected:
void device_update_displacement_images(Device *device,
Scene *scene,
Progress& progress);
+
+ void device_update_volume_images(Device *device,
+ Scene *scene,
+ Progress& progress);
};
CCL_NAMESPACE_END