Adding multiple passes to a custom material

Software: Away3D 4.x

seanClusta, Jr. Member
Posted: 20 October 2014 01:38 PM   Total Posts: 38

Could anyone explain how to add multiple custom passes to a custom material?
I have created a custom material which extends MaterialBase and a custom pass which extends MaterialPassBase. I have used addPass(new CustomPass()) to tie the shader pass to the material. This all works fine.

I would like to write shader passes with individual characteristics, i.e. one will deform the positions of a geometries vertices in the vertex shader - let’s call it FFDPass, and another one works exclusively on the fragment shader, there will be multiple of these, i.e. WireFramePass or GlowPass.

I could add both shader functionalities into a single pass but would like to be able to separate them so I can create new materials which layer them, i.e.

public function SingleLightColorMaterial(color:uint{
super
();
addPass(new FFDPass());
addPass(new SingleLightColorPass(color));

or

public function WireFrameMaterial(color:uint{
super
();
addPass(new FFDPass());
addPass(new WireFramePass(color));

I have tried just creating 2 separate passes and adding them but it seems the 2nd pass overwrites the first. Is there any documentation or could someone give a quick explanation of how to run passes consecutively?

Thanks

   
   
‹‹ Shadow Problem

X

Away3D Forum

Member Login

Username

Password

Remember_me



X