[Bf-committers] Stereoscopy Implementation Proposal

Dalai Felinto dfelinto at gmail.com
Mon Apr 22 09:25:37 CEST 2013

(Ton and Brecht in particularly)
I'm having some trouble finding the best way to render the scene views.

Currently in my last branch commit [1] I got Blender to render multiple
layers and passes for each view,
but still without using the cameras set in the UI [2].

My last attempt (non-committed and not working) is roughly below:

static void do_render_3d(Render re*)
(. . .)
+       for (view = 0, srv = re->r.views.first; srv; srv = srv->next,
view++) {
+               re->r.actview = view;
+               if (render_scene_needs_vector(re))
+                       RE_Database_FromScene_Vectors(re, re->main,
re->scene, re->lay, view);
+               else
+                       RE_Database_FromScene(re, re->main, re->scene,
re->lay, 1, view);
(. . .)
+               threaded_tile_processor(re);
(. . .)
+               RE_Database_Free(re);
+       }

(in RE_Database_FromScene I set the camera based on the view id)

static void add_passes(RenderLayer *rl, int offset, ShadeInput *shi,
ShadeResult *shr)
(. . .)
        for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
(. . .)
+               if (rpass->view_id != *(&R.r.actview))
+                       continue;

This doesn't work because the rendering is happening after we leave
do_render_3d (so not during threaded_tile_processor as I thought). So the
for loop there is just wasting cpu and time (and R.r.actview is always the
last view id by the time we get to add_passes).

Anyways, do you have some ideas on how to better tackle this?
This approach was based on my interpretation of the old Render Pipeline
wiki page [3]. But I clearly got it wrong

[1] -
[2] - http://dalaifelinto.com/ftp/multiview/multiview_panel.jpg
[3] - http://wiki.blender.org/index.php/Dev:Source/Render/Pipeline /


More information about the Bf-committers mailing list