*blog... kind of... *rss
PV3D 2.0: How to render in anaglyphic (stereo) mode
0 commentsNo, neither PV3D 2.0 does this render automatically, but again, this is just another example of what can you do being able to render the same scene to different targets.
The technical/physical part of this render is simple. Based on the main camera, you need to have to other cameras, A and B, one on each side of the main camera, if you displace the camera A -50 of the main camera, then you displace the camera B +50. The cameras need to be parallel, so you also have to displace the target of the cameras. Then, render the camera A and copy the red channel
render the camera B and copy the green and blue channels
so, again 2 renders per frame (which means, rendering 2x the amount of polys), then into a final Bitmap you mix all the channels.
Before doing it directly with bitmapData.copyChannel I tried using colorTransform and then using the additive blendMode. It worked, but wasn't as accurate as the proper way is, and it was much more slower.
The final test looks quite good I think, and the effect works with the proper glasses.

There is also another test done with the render mode, which was a quick modification of a test from Ralph.
I must say that it is not 100% correct, in theory the channel displacement should be only horizontal, in some camera angles the effect may not look right. I guess this could be somehow sorter, but I was too lazy again :P
And here you have the sources again! In case you wonder about how the ball.as was generated, I used a modified version of Jerome's AS3 Geom Class exporter.
The technical/physical part of this render is simple. Based on the main camera, you need to have to other cameras, A and B, one on each side of the main camera, if you displace the camera A -50 of the main camera, then you displace the camera B +50. The cameras need to be parallel, so you also have to displace the target of the cameras. Then, render the camera A and copy the red channel
render the camera B and copy the green and blue channels
so, again 2 renders per frame (which means, rendering 2x the amount of polys), then into a final Bitmap you mix all the channels.
Before doing it directly with bitmapData.copyChannel I tried using colorTransform and then using the additive blendMode. It worked, but wasn't as accurate as the proper way is, and it was much more slower.
The final test looks quite good I think, and the effect works with the proper glasses.

There is also another test done with the render mode, which was a quick modification of a test from Ralph.
I must say that it is not 100% correct, in theory the channel displacement should be only horizontal, in some camera angles the effect may not look right. I guess this could be somehow sorter, but I was too lazy again :P
And here you have the sources again! In case you wonder about how the ball.as was generated, I used a modified version of Jerome's AS3 Geom Class exporter.
*profile

traditional id: Ricardo Cabello Miguel
based in: London, UK
more: github, twitter, twitpic, soundcloud and flattr
*post nav
Caution
tha ltd. site
PV3D 2.0: Real Materials
FWA's Site of The Day!
"This is not a PC, this is a MAC"
PV3D 2.0: How to render in anaglyphic (stereo) mode
PV3D 2.0: How to do simple realtime shadows
Loop a FLV in AS3 (and AS2)
mrdoob.com v3
Google wrecked the internet
87eleven