How to add a step into rendering process

Software: Away3D 4.x

_kihu, Jr. Member
Posted: 01 February 2013 10:33 AM   Total Posts: 43

The title might be confusing, as I’m a little disoriented in 3D graphics terminology…

I’m writing a custom Filter3D, so it’s a fullscreen post-processing effect. I’m using a depth map, in the same way the DepthOfField filter does. The depth map is passed to my filter as a texture.

So currently the rendering is done in two steps:
- render the depth map, put into depth texture
- render the scene

I want to add one more step before rendering the scene:
- render the depth map, put into depth texture
- render my effect, put into ‘effect texture’
- render the scene

The motivation behind this is that I want to add blur only to my effect, not to the whole scene.

I’m guessing this cannot be achieved without altering View3D class significantly. Has any of you dealed with this kind of issue? What is the least painful way to solve this?

   

_kihu, Jr. Member
Posted: 05 February 2013 12:20 PM   Total Posts: 43   [ # 1 ]

The answer is in the BloomFilter3D class

override public function setRenderTargets(mainTarget Texturestage3DProxy Stage3DProxy) : void
  {
   _brightPassTask
.target _hBlurTask.getMainInputTexture(stage3DProxy);
   
_hBlurTask.target _vBlurTask.getMainInputTexture(stage3DProxy);
   
_vBlurTask.target _compositeTask.getMainInputTexture(stage3DProxy);
   
// use bright pass's input as composite's input
   
_compositeTask.overlayTexture _brightPassTask.getMainInputTexture(stage3DProxy);

   
super.setRenderTargets(mainTargetstage3DProxy);
  

In the final task here, prefiltered texture is accessed at index 0 (fs0) and unfiltered scene is passed as “overlayTexture” and put at fs1.

Thanks for reading.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X