diff options
author | Mai Lavelle <mai.lavelle@gmail.com> | 2016-04-11 23:49:09 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-04-12 00:12:11 +0300 |
commit | ebfdd7da83200f2890b28dd5ef9a0fc8c6ab9137 (patch) | |
tree | 8ccb1ad1af787ccf3d186b687324e4056f9665df /intern/cycles/blender/blender_mesh.cpp | |
parent | 7d033717ad52bf92235e65224b6b3940de7ec473 (diff) |
Cycles microdisplacement: perform subdivision dicing in raster space
NOTE: this is only the first of many patches towards completing the subdivison
and displacement system in Cycles. These patches will be reviewed and committed
one by one over the coming weeks.
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D1909
Diffstat (limited to 'intern/cycles/blender/blender_mesh.cpp')
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 9eb4626eb3c..48c14a34aad 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -18,6 +18,7 @@ #include "mesh.h" #include "object.h" #include "scene.h" +#include "camera.h" #include "blender_sync.h" #include "blender_session.h" @@ -655,6 +656,7 @@ static void create_mesh(Scene *scene, static void create_subd_mesh(Scene *scene, Mesh *mesh, + BL::Object b_ob, BL::Mesh& b_mesh, PointerRNA *cmesh, const vector<uint>& used_shaders) @@ -691,8 +693,10 @@ static void create_subd_mesh(Scene *scene, SubdParams sdparams(mesh, used_shaders[0], true, need_ptex); sdparams.dicing_rate = RNA_float_get(cmesh, "dicing_rate"); - //scene->camera->update(); - //sdparams.camera = scene->camera; + + scene->camera->update(); + sdparams.camera = scene->camera; + sdparams.objecttoworld = get_transform(b_ob.matrix_world()); /* tesselate */ DiagSplit dsplit(sdparams); @@ -805,7 +809,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob, if(b_mesh) { if(render_layer.use_surfaces && !hide_tris) { if(cmesh.data && experimental && RNA_boolean_get(&cmesh, "use_subdivision")) - create_subd_mesh(scene, mesh, b_mesh, &cmesh, used_shaders); + create_subd_mesh(scene, mesh, b_ob, b_mesh, &cmesh, used_shaders); else create_mesh(scene, mesh, b_mesh, used_shaders); |