Game Development Community

Decals?

by Jason "fireVein" Culwell · in Torque Game Engine Advanced · 04/29/2008 (9:45 pm) · 10 replies

Does anyone know if decals are working in TGEA? I have tried both a jpg ang png, and the console reports no errors. Is there something else I have to do to get them working?

datablock DecalData(CrossbowDecal1)
{
   sizeX       = 0.5;
   sizeY       = 0.5;
   textureName = "~/data/shapes/spacerifle/bullethole1";
};


datablock ProjectileData(CrossbowProjectile)
{
...
   decals[0] = CrossbowDecal1;
...
};

About the author

http://www.microdotproductions.com - I am a self taught programmer that has been hacking away at code for a little over 10 years now. I am a very passionate and persistent programmer, and gamer. I love challenges and problem solving.


#1
04/30/2008 (10:18 pm)
No you have to enable them in code. If I might toot my own horn for just a second, this resource might be helpful to you. If you are using TGEA 1.7 there is only a bit of difference and the conversion should be easy.

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=14044
#2
05/01/2008 (5:27 pm)
Thanks, Ron! I greatly appreciate the push in the right direction, its just what I needed.
#3
05/29/2008 (6:03 am)
Are there plans to re-enable decals in TGEA in a future update? Any time soon?
#4
05/29/2008 (6:29 am)
Actually re-enabling decals is not that hard , let's see
first expose the DecalData to the console

in scenegraph/decalManager.h add this after the DecalData class
// > pg decal
DECLARE_CONSOLETYPE(DecalData)
// < pg decal

in scenegraph/decalManager.cc before void DecalData::initPersistFields() function add
// > pg decals
IMPLEMENT_CONSOLETYPE(DecalData)
IMPLEMENT_SETDATATYPE(DecalData)
IMPLEMENT_GETDATATYPE(DecalData)
 // < pg decals

Then make decals a supported Type
in console\consoleTypes.h add this before the #endif
// > pg decals
DefineConsoleType( TypeDecalDataPtr, DecalData*);
// < pg decals


That 'should' be it.

To test go to player.cc and in void PlayerData::initPersistFields() un comment
addField("decalData",         TypeDecalDataPtr, Offset(decalData, PlayerData));
   addField("decalOffset",TypeF32, Offset(decalOffset, PlayerData));

As well as any where else that the decal information has been commented out. ( I can't recall all the places currently but it should be clear.

With any luck once you do a FULL REBUILD you should have foot prints, similarly you can un comment out the decal in projectiles to get bullet holes

* PS be sure your datablocks have decals set*
#5
05/29/2008 (6:46 am)
I had to uncomment a few other sections in preload, packData, and unpackData in player.cc
DefineConsoleType seemed redundant with DECLARE_CONSOLETYPE so I left that part out.

After that, it worked.

Thanks!!
#6
01/14/2009 (3:41 am)
just out of curiosity why would they have turned off the decals that seems to me like a pretty general thing in a lot of games
#7
01/14/2009 (10:24 am)
@Maverick: In the words of one programmer a few years ago: "It was a feature that not many people were using." Same explanation for footpuffs and the watersplash effect. It supposedly didn't make sense to have such old-school effects in such a shiny new shader driven engine. Luckily it is easy to re-enable.
#8
01/14/2009 (2:19 pm)
well what did they plan for us to use for bullet holes and things of the sort then
#9
01/14/2009 (2:23 pm)
actually question 2 are they still enabled in 1.7.1 and what significant features does 1.8 have
#10
01/14/2009 (4:44 pm)
They're still disabled. There is an excellent Plastic Gem resource that shows how to re-enable them though, it's simple and relatively pain free.
Plastic Gem 34 - TGEa Decals

In the programming department 1.8 has some sweeping changes in the graphics subsystem that allows for MacOS compatibility. New-features-wise there is nothing new. Due to performance concerns most people seem to be staying with 1.7.1 over 1.8 unless cross-platform compatibility is a concern.