Page MenuHome

Fix T49861: Interlace stereo drawing
ClosedPublic

Authored by Dalai Felinto (dfelinto) on Jan 2 2017, 1:04 PM.

Details

Summary

I wonder if we still need the if VERSION == 120, same goes for TEXTURE/IMAGE.
Anyways, this patch addressed stereo 3d interlace drawing.

There are other parts of BLender using interlace, but I didn't port them
(they may need new shaders, or changes in the current shader).

part of T49043

Diff Detail

Repository
rB Blender
Branch
fix-2.8-interlace
Build Status
Buildable 380
Build 380: arc lint + arc unit

Event Timeline

Dalai Felinto (dfelinto) retitled this revision from to Fix T49861: Interlace stereo drawing I wonder if we still need the if __VERSION__ == 120, same goes for TEXTURE/IMAGE. Anyways, this patch addressed stereo 3d interlace drawing. There are other parts of BLender using interlace, but I didn't port....
Dalai Felinto (dfelinto) updated this object.

I prefer a shader that does exactly what you need: interlace two images. That way interlacing doesn't have any unused stipple code, and stippling will not have any extra interlace code. If we get rid of USE_TEXTURE_RECTANGLE (and decide it's always true), we can also avoid making 2 shaders that do the same things.

Another idea -- Swap the image inputs once on CPU if needed. This reduces the interlace options to {ROW, COLUMN, CHECKER}. Which also reduces logic needed in the shader.

Dalai Felinto (dfelinto) retitled this revision from Fix T49861: Interlace stereo drawing I wonder if we still need the if __VERSION__ == 120, same goes for TEXTURE/IMAGE. Anyways, this patch addressed stereo 3d interlace drawing. There are other parts of BLender using interlace, but I didn't port... to Fix T49861: Interlace stereo drawing.Jan 6 2017, 10:25 AM
Dalai Felinto (dfelinto) updated this object.
Dalai Felinto (dfelinto) edited edge metadata.
  • From review: make exclusive interlace shader
  • optimize shader using bitwise
  • Forgot to cleanup basic shader

This is much better :D

source/blender/windowmanager/intern/wm_stereo.c
156–157

Most recent call was glActiveTexture(GL_TEXTURE0 + activeTex + (eye = 1))

Could assume activeTex > 0 and always call glActiveTexture(GL_TEXTURE0) here

or

use GL_TEXTURE0 + 0 for eye 0
use GL_TEXTURE0 + 1 for eye 1

bind eye 1 then eye 0 so that GL_TEXTURE0 is already active when this function exits.

  • From review, simplify glActiveTexture logic

@Mike Erwin (merwin) - all good now.

Mike Erwin (merwin) edited edge metadata.

I'll test the GLSL 120 path on Mac. What is a good simple way to test?

This revision is now accepted and ready to land.Jan 9 2017, 4:09 PM

@Mike Erwin (merwin) :

  • Turn "Views" on (in render layer panel).
  • In the "Window" menu go to "set stereo 3d" and set mode to interlace
  • Make sure the 3d view is in "camera" mode