Game Development Community

(RESOLVED)[T3D 1.0.1 Bug] more than 15 items casting shadow in BL crashes the engine - RESOLVED

by Nicolas Buquet · in Torque 3D Professional · 04/19/2010 (10:21 am) · 7 replies

In BasicLighting mode, if you had more than 15 items (the Torque items, with itemData datablock) in the level, the engine crashes on a 'incRefCount' about drawPrimitiveBuffer?

Tested on Mac and Windows, with T3D 1.0.1.

If the sun doesn't cast shadow, then there is no crash.

If the same objects are added as staticShapes, there is no crash also.

If you launch the blank room, go in the editor, add 15 health kits that project shadow, when you had the 16th, the engine crashes.

You can reproduce it with adding the items in the .mis level file, or by adding the items by script in "onMissionLoaded" callback.

I have no idea from where the crash come!?

#1
04/19/2010 (10:25 am)
Rene fixed this for 1.1 , there was a bug in decalmanager.
www.torquepowered.com/community/forums/viewthread/101069
#2
04/19/2010 (10:30 am)
Thanks for the Very quick answer.

Do you know the fix (or else I will compare 1.0.1 to 1.1 : it was what I was doing).
#3
04/19/2010 (10:32 am)
I'm using 1.0 and it works for me.
#4
04/19/2010 (10:39 am)
Thanks again. I will see that with 1.0.
#5
04/19/2010 (10:44 am)
decalManager.cpp, line 1102 , add this:

mPrimBuffs.reserve( batches.size() );
mVBs.reserve( batches.size() );
#6
04/19/2010 (11:46 am)
Thank you a lot : it works now ! :-)

For others to know, lines added in method "DecalManager::prepRenderImage", just before the loop:
// Loop through batches allocating buffers and submitting render instances.
	for ( U32 i = 0; i < batches.size(); i++ )
    {
#7
06/05/2010 (2:03 pm)
logged: TQA-238