Game Development Community

Decal Issues w/ 1.5

by Jay Verba · in Torque Game Engine · 02/13/2007 (11:43 am) · 8 replies

I need to draw a decal on the fly that follows my cursor and conforms to the terrain so that my player can target an area on the ground to place an object. I figured the best way to do this was to expose DecalManager::addDecal() to script via ConsoleMethod.

Here's what I've got...

ConsoleMethod( DecalManager, addDecal, void, 5, 5, "(Point3F pos, Point3F norm, DecalData* decalData)")
{
	Point3F pos;
	Point3F norm;
	DecalData* decal;
	SceneState* temp;
	SceneRenderImage* temp2;
	//pos.z++;
	dSscanf(argv[2], "%g %g %g", &pos.x, &pos.y, &pos.z);
	dSscanf(argv[3], "%g %g %g", &norm.x, &norm.y, &norm.z);
	decal = static_cast<DecalData*>(Sim::findObject(argv[4]));
	object->addDecal(pos, norm, decal);
	object->renderDecal();
}

The data comes across just fine, and it even adds the decal to the Q, but nothing is showing up in game. How do get the DecalManager to fire it's rendering method?

I am open to suggestions if you think there is a better way to do this. (i.e. not using decals at all)

#1
02/14/2007 (5:28 am)
Bump. This forum doesn't list the "views" a post has had, so I don't know if any of you have even looked at this. If anyone has any clue about this, please throw me a bone. I just need a direction to stumble in.
#2
02/14/2007 (5:59 am)
Do you have the decal batch rendering installed? You can always check the decalmanager as its running and see if it tries to render this specific decal.
#3
02/14/2007 (6:01 am)
I do have decal batch rendering installed.

I have run in debug mode and check the decal manager. My decal is in the Queue, but it's not showing up anywhere. I've checked the $prefs::decalson etc... and all of those are as they should be.

Is there a file format restriction I dont' know about? Trying a .bmp atm.
#4
02/14/2007 (6:38 am)
Tried with a .png, with no success. Also added about 5 to the Z value of the the transform incase it was rendering it exactly even with the terrain for some reason.

No dice.


This is really frustrating.
#5
02/14/2007 (8:54 am)
Shameless bump.
#6
02/14/2007 (11:45 am)
Have you considered temporarily hardcoding where the decal shows up? It might be appearing off in some random part of the map where you can't see it.
#7
02/14/2007 (1:04 pm)
I can try, but AddDecal() takes a point3F pos and that data is correct.... so we'll see
#8
02/16/2007 (6:21 am)
The real question is... WWBGD?

(What Would Ben Garney Do?)