Dynamic Reflection for animated objects??
by James Brad Barnette · in Torque Game Engine Advanced · 06/30/2007 (7:55 pm) · 10 replies
Does dynamic reflection not work for animated DTS objects?
I have taken the dynamic reflection definision in the demo the on on the sphere. and I have replaced the space orcs material definition with it
new CustomMaterial(SpaceOrc)
{
mapTo = Orc_Material;
texture[0] = "$dynamicCubemap";
shader = ReflectSphere;
version = 2.0;
};
Shouldn't this produce a orce with a realtime mirror like surface?
I'm getting a black spaceOrc with a red glowing eye
I have taken the dynamic reflection definision in the demo the on on the sphere. and I have replaced the space orcs material definition with it
new CustomMaterial(SpaceOrc)
{
mapTo = Orc_Material;
texture[0] = "$dynamicCubemap";
shader = ReflectSphere;
version = 2.0;
};
Shouldn't this produce a orce with a realtime mirror like surface?
I'm getting a black spaceOrc with a red glowing eye
#2
sequence28 = "./player_standjump.dsq standjump";
sequence29 = "./player_looknw.dsq looknw";
sequence30 = "./player_dance.dsq dance";
sequence31 = "./player_range.dsq range";
};
{
dynamicReflection = "true";
};
I'm still getting black.
07/01/2007 (4:34 pm)
Ok I ddded it to the end of the player.cs at the bottom after the sequences like so:sequence28 = "./player_standjump.dsq standjump";
sequence29 = "./player_looknw.dsq looknw";
sequence30 = "./player_dance.dsq dance";
sequence31 = "./player_range.dsq range";
};
{
dynamicReflection = "true";
};
I'm still getting black.
#3
The sphere itself is defined like this in scene.cs already.
07/01/2007 (4:47 pm)
Sorry I wasn't more specific, James. Try putting it inside the LightMaleHumanArmor datablock.The sphere itself is defined like this in scene.cs already.
#4
Player characters have two different datablock types associated with them:
(class) PlayerData -- this defines values on the Player class itself. Normally located in the /server directory.
(class) TSShapeConstructor -- this defines values associated with the model the player will be using. Specifically, it contains links between raw .dsq (animation) files, and assigns them specific sequence numbers so the engine can both procedurally and "by name" call various animations. It is normally located in the /data directory, and commonly where the animation and model/texture files reside.
NOTE: My response isn't intended to answer the root question (I don't honestly know the answer to that), but to point out the difference between the two datablocks associated with the Player class, and the purposes of each.
Also one final comment: the syntax you used to add the field wouldn't work in any case--if you look carefully at your { } blocks, you've added the persistent field outside of the datablock declaration--and I'm certain that actually gives you a syntax error when compiling the script.
07/01/2007 (5:02 pm)
As Eric points out, you've placed your change in the wrong datablock.Player characters have two different datablock types associated with them:
(class) PlayerData -- this defines values on the Player class itself. Normally located in the /server directory.
(class) TSShapeConstructor -- this defines values associated with the model the player will be using. Specifically, it contains links between raw .dsq (animation) files, and assigns them specific sequence numbers so the engine can both procedurally and "by name" call various animations. It is normally located in the /data directory, and commonly where the animation and model/texture files reside.
NOTE: My response isn't intended to answer the root question (I don't honestly know the answer to that), but to point out the difference between the two datablocks associated with the Player class, and the purposes of each.
Also one final comment: the syntax you used to add the field wouldn't work in any case--if you look carefully at your { } blocks, you've added the persistent field outside of the datablock declaration--and I'm certain that actually gives you a syntax error when compiling the script.
#5
07/01/2007 (5:44 pm)
Ok I got it working and yeah it is the alpha channel that is casue only the armore to be reflective. once I delete the alpha channel the whole this is reflective. I gotta admit though it looks like crap. The cube map looks to be upside down or may at 90 degrees or something, none of the reflection angles look right.
#6
what I'm looking for is a realtime reflection.
I noted that there is this variable that the system gives
$reflectBuff
Has anyone tried using it?
I'm looking for something like a mirror that you can walk up to and see your reflection in.
I tried it replacing $dynamicCubemap in the materials.cs and it did produce a better result but it is is not reflecting the clowing spheres as they circle him.
I would go as far as saying that it performed faster as vell but I don't know how to verify it.
07/01/2007 (5:58 pm)
Ok and besides this is not updating and I have a SM3.0 Video card. what I'm looking for is a realtime reflection.
I noted that there is this variable that the system gives
$reflectBuff
Has anyone tried using it?
I'm looking for something like a mirror that you can walk up to and see your reflection in.
I tried it replacing $dynamicCubemap in the materials.cs and it did produce a better result but it is is not reflecting the clowing spheres as they circle him.
I would go as far as saying that it performed faster as vell but I don't know how to verify it.
#7
Note, these both only work with interiors, and the Planar Reflection docs say that terrain is not reflected. I don't know if this has been fixed.
If you need it on a DTS, you might find out what kind of reflective shaders are out there and adapt it for TGEA.
Hey, I never promised you a rose garden! ;)
ETA: You might also look at the Water Shader's reflections for ideas ...
07/01/2007 (7:35 pm)
For a mirror, either use the mirror entity or the Planar Reflection shader (see Materials Overview, above).Note, these both only work with interiors, and the Planar Reflection docs say that terrain is not reflected. I don't know if this has been fixed.
If you need it on a DTS, you might find out what kind of reflective shaders are out there and adapt it for TGEA.
Hey, I never promised you a rose garden! ;)
ETA: You might also look at the Water Shader's reflections for ideas ...
#8
Basicly I need to have a greyscale map controling houw reflective the area is.
I need a diffuse map for decals and painted areas. The grey scalle map could actually be placed in the alpha channel of this map. as well as support for a normal map.
this is what I'm looking for
I would be willing to pay if someone could set me up a shader like this.
07/02/2007 (1:26 am)
What I'm working on is an airplane and part of it is chrome that you should see your reflection on it when you walk up to it.Basicly I need to have a greyscale map controling houw reflective the area is.
I need a diffuse map for decals and painted areas. The grey scalle map could actually be placed in the alpha channel of this map. as well as support for a normal map.
this is what I'm looking for

I would be willing to pay if someone could set me up a shader like this.
#9
by default foliage etc wouldn't get reflected / refracted as well as they are rendered after those effects.
07/02/2007 (6:54 am)
Reflection restrictions can be changed by the user basing on the desire by changing the rendering order in the renderinstmgr.hby default foliage etc wouldn't get reflected / refracted as well as they are rendered after those effects.
#10
06/26/2009 (8:50 pm)
hey it looks that u have menage to get reflections! can you plz pm me on email or msn plx ? dariusz1989@gmail.com :) (msn and mail)
Torque Owner Eric Forhan
Make sure you have dynamicReflection = true; wherever player.dts is defined (I think it's in player.cs).
You'll probably notice only the shoulderpads reflect. My guess would be an alpha map.
Also, the dynamic cubemap seems to be generated either at mission load or via the main player camera. Both of those are guesses -- all I know is that simply moving the orc or shiny octopus around didn't change the reflection.
I'm having a lot of trouble finding TGEA/TSE shader information on the art side of the equation. The demo actually does some pretty cool stuff, but figuring it out will be a combination of their Materials Overview and trial-and-error.