Game Development Community

Dynamic Cubemapping too dark

by Adam Beer · in Torque 3D Professional · 06/20/2009 (11:10 am) · 12 replies

I enabled the dynamic cubemap on my materiel and it turns the shape dark. You can see the cubemap working but it just makes the shape really dark. What controls how light a material is when you have the dynamic cubemap applied?

#2
07/08/2009 (11:47 pm)
I believe its currently the alpha channel of the cubemap itself. Its been requested to add a material parameter to do this as well.
#3
07/08/2009 (11:52 pm)
I think the material parameter is a great idea. Thanks Tom.
#4
12/15/2009 (8:29 am)
Sorry for bumping up this old thread,but is there any advance on the dynamic cube maps ?
6 months left,they're still not working.
#5
12/15/2009 (11:27 am)
Are we talking cubemaps from the "Reflection" option at the bottom of the Material Editor?

I thought that they were working. (but upside down or something).

Me asking for my cubemap relfection explaination to be added to the docs 'cos it's missing them.
www.torquepowered.com/community/forums/viewthread/104311/4#comment-698673
#6
12/15/2009 (11:46 am)
The option in the material editor is for the static cubemaps.
Dynamic cubemaps are handled using this:

sampler["cube0"] = "$dynamicCubemap";


But the cube sampler will sample only black color.
#7
12/15/2009 (1:49 pm)
Dynamic cubemaps work but only for ShapeBase objects and not through the material editor. Here is an example of that.

datablock ReflectorDesc( TestReflectorDesc )
{   
   cubeFaceSize = 256;
   nearDist = 0.5;
   farDist = 2000.0;
   objectTypeMask = 0xFFFFFFFF;   
};

datablock StaticShapeData( ReflectiveBall )
{
   category = "Test";
   shapeFile = "art/shapes/rocks/boulder.dts";
   cubeReflectorDesc = TestReflectorDesc;
};
#8
12/15/2009 (2:30 pm)
hi James,
i know it is working this way.
I want to pass the cubemap through the custom material,eventually to apply some TBN pocessing on it, like what i did in TSE.
#9
12/15/2009 (2:39 pm)
You can do that but you need a custom class to hold the CubeReflector which handles registering the dynamic cubemap for updates by the ReflectionManager. Probably it is black because it is never being rendered to.

What do you mean by TBN processing?
#10
12/15/2009 (2:52 pm)
This is usefull,i'll have to examine this reflector.
But i prefer the old style.

I mean to get the TBN(tangent,bitangent,normal) of each vertex and apply some operations on them,like moving to eye space.
Then i'll sample the cubemap color via the new texcoords.
It will allow me to create some visual effects.
This was easy to be done before,now i have to setup a new class.
What is the purpose of this ?
#11
03/29/2010 (5:40 pm)
Hey guys

I am trying to add a dynamic cube map to my material which has a diffuse map mapped to it. I am not to familiar with editing the .cs file so i was wondering where within the highlighted i enter in the:

sampler["cube0"] = "$dynamicCubemap";

i44.photobucket.com/albums/f29/slipmaggot75/material.jpg
and if thier is something i need to enable in the material editor or if my diffuse needs an alpha channel or anything else to makes the map work.

Thank you guys for taking the time to help out :)
#12
05/24/2010 (10:35 am)
Using the code from James Ford worked !
You will have to add "dynamicCubemap = true" to your ShapeBase object material definition.

singleton Material(DefaultMaterial67)
{
mapTo = "MossyRock02";
diffuseMap[0] = "art/shapes/rocks/MossyRock02";
specularPower[0] = "16";
pixelSpecular[0] = "1";

dynamicCubemap = true;

};