[Bf-committers] Stereoscopy Implementation Proposal

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


Hi,
(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:

pipeline.c
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)

rendercore.c
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] -
https://github.com/dfelinto/blender/commit/cb47c64528d46619428e361d7c4999e684380ebb
[2] - http://dalaifelinto.com/ftp/multiview/multiview_panel.jpg
[3] - http://wiki.blender.org/index.php/Dev:Source/Render/Pipeline /
http://wiki.blender.org/index.php/File:Render_pipeline_API.png

Thanks,
Dalai
--


More information about the Bf-committers mailing list