Refelcting terrain instead of BitmapCubeTexture

Software: Away3D Lite

Avatar
ddddesigns, Jr. Member
Posted: 28 July 2013 03:30 AM   Total Posts: 37

I get that you can create a method for reflecting the skybox onto the surface of the water but is it possible to just do a general reflection based on the camera angle, water plane’s surface and the actual environment around it?

I have a terrain, moving clouds and a stream of water.  I would like to reflect the cliffs on the other side of the stream as opposed to the skybox behind the cliff. 

As you can see in the picture I have attached, the reflection just doesn’t look right with the terrain.

In the second picture you can see the clouds are not being reflected.  They are a plane as well similar to the water plane but upside down so that it can be seen from below.

 

   

John Brookes, Moderator
Posted: 28 July 2013 12:58 PM   Total Posts: 732   [ # 1 ]

Use FresnelPlanarReflectionMethod
eg
reflectionTexture = new PlanarReflectionTexture();
yourWaterMaterial.addMethod(new FresnelPlanarReflectionMethod(reflectionTexture));
//rest of your methods eg waterMethod Fresnal etc

look at planar reflection example on how to setup a reflection texture.

   

Avatar
ddddesigns, Jr. Member
Posted: 28 July 2013 07:57 PM   Total Posts: 37   [ # 2 ]

That works…almost.  As soon as I assign the waterMethod to my new plane it can no longer render the view.

   

John Brookes, Moderator
Posted: 28 July 2013 09:30 PM   Total Posts: 732   [ # 3 ]

Works for me.

var reflectionMethod PlanarReflectionMethod = new PlanarReflectionMethod(reflectionTexture);
 
reflectiveMaterial = new TextureMaterial(new BitmapTexture(new BitmapData(512512true0xaa404070)));
 
reflectiveMaterial.alphaBlending true;
 
reflectiveMaterial.lightPicker lightPicker;
 
reflectiveMaterial.repeat true;
 
reflectiveMaterial.normalMethod waterMethod;
 
reflectiveMaterial.specularMethod fresnelMethod;
 
reflectiveMaterial.addMethod(new FresnelPlanarReflectionMethod(reflectionTexture)); 
   

Avatar
ddddesigns, Jr. Member
Posted: 28 July 2013 10:40 PM   Total Posts: 37   [ # 4 ]

Sure enough!  I guess it does.  I started with the Intermediate_PlanarReflections example.  It uses a ColorMaterial and not a TextureMaterial.  Even though I have been playing with Away3D for a long time, it seems there is a lot to learn.  What we need is a series of tutorials and a glossary of terms.  Not everyone using Away3D knows the difference between a Material, Mesh, and Texture.  Know what I mean?  Thanks for your help.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X