PlanarReflection broken.
by Stefan Lundmark · in Torque Game Engine Advanced · 10/05/2006 (12:29 pm) · 8 replies
mapTo = "glass"; baseTex[0] = "glass.png"; //baseTex[1] = "$backbuff"; pixelSpecular[0] = true; specular[0] = "1.0 1.0 1.0 0.1"; specularPower[0] = 32.0; //shader = ReflectBump; planarReflection[0] = true; //planarReflection = true;
Makes the material completely transparent. The material is mapped onto an interior texture and the plane is flat.
About the author
#2
So you are saying it should work? I will take another look then, thanks.
10/06/2006 (9:08 am)
I had, which is why I put it up there but commented.So you are saying it should work? I will take another look then, thanks.
#3
10/09/2006 (1:41 pm)
It should work. I think you need to pass in more texture parameters. Here's the block we are using on the new MS4 demo:new CustomMaterial( ReflectFloor )
{
mapTo = "reflect";
texture[1] = "$backbuff";
texture[0] = "reflect";
texture[2] = "reflect.normal";
texture[3] = "$lightmap";
shader = ReflectBump;
version = 2.0;
planarReflection = true;
specular[0] = "1 1 1 1";
specularPower[0] = 64.0;
fallback[0] = ReflectFloor_1_1;
};
#4


If anyone knows how to get this effect looking better, please chime in at any time. Thanks
10/19/2006 (8:38 pm)
Thanks for the help Brian. The planar reflections seem to be working, but I'm not clear how to edit the reflection properties. For example, is there a way to only have it reflect at 25% opacity? Also, the reflection is blowing out the lighting on the scene. You can see what I'm talking about in the screenshots below. Also, I am using the same exact custom material as shown above (with different textures, of course).

If anyone knows how to get this effect looking better, please chime in at any time. Thanks
#5
10/19/2006 (8:50 pm)
This one works for me:new CustomMaterial( floor )
{
mapTo = floor;
texture[1] = "$backbuff";
texture[0] = "floor";
texture[2] = "floor_normal";
shader = ReflectBump;
version = 2.0;
planarReflection = true;
};
#6
Off the top of my head...
The amount of reflectivity is controled through the Alpha Channel of the Normal Map (although don't hold me to that, it could be the alpha channel of the diffuse, try both, but be aware one masks the specularity). It can also be masked. #000000 (black) colored pixels are completely reflective and #FFFFFFF(white) are completely opaque, and anything in between is the respective reflectivity.
Tim A
10/19/2006 (9:20 pm)
Stefan,Off the top of my head...
The amount of reflectivity is controled through the Alpha Channel of the Normal Map (although don't hold me to that, it could be the alpha channel of the diffuse, try both, but be aware one masks the specularity). It can also be masked. #000000 (black) colored pixels are completely reflective and #FFFFFFF(white) are completely opaque, and anything in between is the respective reflectivity.
Tim A
#7
10/23/2006 (12:57 pm)
Yes, it should be able to be controlled with the alpha channel of the floor I think. Based on another post you've made SRO, I'm not sure you are aware that PhotoShop does not save out the alpha channel properly to .PNG files. I know an old SuperPNG plugin fixes this, but I'm not sure what the current solution is.
#8
http://www.garagegames.com/mg/forums/result.thread.php?qt=29617
10/23/2006 (3:22 pm)
Check out this thread:http://www.garagegames.com/mg/forums/result.thread.php?qt=29617
Torque Owner Brian Ramage
Black Jacket Games