DTS Objects (some stock) won't calc pixelsize for LOD - RESOLVED
by Henry Todd · in Torque 3D Professional · 01/12/2010 (8:54 am) · 32 replies
I discovered this while trying to test some simple 1st/3rd person code I was hacking together. It would seem that the 3ds DTS exporter is incapable of producing a DTS that can LOD at all. Every DTS model I've made using 3ds 2009's exporter absolutely refuses to identify pixel values in the shape editor, and likewise refuses to LOD properly. This seems to be a rather severe issue with the LOD system.
In fact, the swarmGun model that comes with the game also doesn't like to return pixel values -- go ahead and load it up in the shape editor and zoom in/out, you'll see what I mean. The debris model? Yes. Rocket? No. Something is definitely screwy in pixel size calculation. I can't find any common ground between the objects that do handle pixel size calculations and the ones that don't, very confusing.
When it doesn't get a pixel size value, it seems to just stick in ... whatever. Many models use LOD 2 when they don't intend to have more than 1 LOD, so generally all of these models are rendering correctly in-game -- until you try one that actually has LOD states, confirming that it's not just the shape editor reporting an incorrect value.
I'm not sure if it's the exporter or the engine, but either way it needs a fix. That max2dts exporter is what a good % of us are using. The confusing bit is that the detail levels are being picked up correctly, I can scroll through them in the editor with the detail level editing box, but the pixel size doesn't change when zooming in/out.
Other random example: forgeSoldier doesn't return pixelsize values, but the elf does. Both DTS, both seem to be identically rigged.
**edit: My simple test object does return pixelSize values in the shape editor when exported as DAE. That's a definite workaround, but not a solution by any means. This is definitely an issue with DTS files.
In fact, the swarmGun model that comes with the game also doesn't like to return pixel values -- go ahead and load it up in the shape editor and zoom in/out, you'll see what I mean. The debris model? Yes. Rocket? No. Something is definitely screwy in pixel size calculation. I can't find any common ground between the objects that do handle pixel size calculations and the ones that don't, very confusing.
When it doesn't get a pixel size value, it seems to just stick in ... whatever. Many models use LOD 2 when they don't intend to have more than 1 LOD, so generally all of these models are rendering correctly in-game -- until you try one that actually has LOD states, confirming that it's not just the shape editor reporting an incorrect value.
I'm not sure if it's the exporter or the engine, but either way it needs a fix. That max2dts exporter is what a good % of us are using. The confusing bit is that the detail levels are being picked up correctly, I can scroll through them in the editor with the detail level editing box, but the pixel size doesn't change when zooming in/out.
Other random example: forgeSoldier doesn't return pixelsize values, but the elf does. Both DTS, both seem to be identically rigged.
**edit: My simple test object does return pixelSize values in the shape editor when exported as DAE. That's a definite workaround, but not a solution by any means. This is definitely an issue with DTS files.
About the author
Recent Threads
#23
Chris,
I checked the dtssdk, it does not set those values to -1.
05/04/2010 (1:17 am)
..this is going nowhere fast.Chris,
I checked the dtssdk, it does not set those values to -1.
#24
First I have heard of this problem. I'm more than happy to discuss this in another thread if you want to => I can have it sorted out for the next beta if I can get some sample files to figure out what is wrong.
I'm not sure where the dtssdk is maintained anymore, but the one that came with TGE 1.5.1 certainly set those values correctly. The following appears in dtsSDKPlus/ShapeMimic.cpp, ShapeMimic::generateDetails:
05/04/2010 (3:37 pm)
Quote:BTW, PhysX exporting using collada doesn't work without errors more than 70% of the time(Russell claimed the same in an email to me while I developed Physit!), YET PhysX exporting using DTS works 100% of the time.
First I have heard of this problem. I'm more than happy to discuss this in another thread if you want to => I can have it sorted out for the next beta if I can get some sample files to figure out what is wrong.
Quote:Chris, I checked the dtssdk, it does not set those values to -1.
I'm not sure where the dtssdk is maintained anymore, but the one that came with TGE 1.5.1 certainly set those values correctly. The following appears in dtsSDKPlus/ShapeMimic.cpp, ShapeMimic::generateDetails:
DetailLevel detail; detail.subshape = i; detail.objectDetail = j; detail.size = (F32) subtree->validDetails[j]; detail.avgError = -1; detail.maxError = -1; detail.polyCount = 0;
#25
#2. I thought you meant the dtssdkplus. Anyways..
Nobody has maintained the max DTS exporters in a few years.
- I have released the most up to date package of exporters for Max yet I failed to notice this issue as I thought LOD just worked. Silly me. GG compiled exporters and my compiled exporters both fail this concept of pixel size LOD. - Any clue on where I could place those settings in the dtssdk instead of using the sdkplus ? I don't normally work on exporters as you can tell.
05/04/2010 (5:06 pm)
#1. sometimes meshes from opencollada or colladamax from Max, import into T3D with all objects named "Null". I'll make a note to export a few examples. ..and of course, that is entirely for a different discussion.#2. I thought you meant the dtssdkplus. Anyways..
Nobody has maintained the max DTS exporters in a few years.
- I have released the most up to date package of exporters for Max yet I failed to notice this issue as I thought LOD just worked. Silly me. GG compiled exporters and my compiled exporters both fail this concept of pixel size LOD. - Any clue on where I could place those settings in the dtssdk instead of using the sdkplus ? I don't normally work on exporters as you can tell.
#26
You just need to find out where the DetailLevel structure is being set up (for each detail level) and set the avgError and maxError values to -1. I've never seen them used anywhere else, so I suspect in the max exporter they are either (wrongly) initialised to 0 (try doing a text search for one of them) or not initialised at all.
05/04/2010 (7:43 pm)
Quote:Any clue on where I could place those settings in the dtssdk instead of using the sdkplus?
You just need to find out where the DetailLevel structure is being set up (for each detail level) and set the avgError and maxError values to -1. I've never seen them used anywhere else, so I suspect in the max exporter they are either (wrongly) initialised to 0 (try doing a text search for one of them) or not initialised at all.
#27
thx for the post.
05/05/2010 (12:21 pm)
Sure, I can find that. I was hoping your knowledge on this section of dts extended so far as to be able to give me direct line numbers. Selfish of me, I know. ;)thx for the post.
#28
06/05/2010 (11:39 am)
Logged as TQA-229.
#29
I have compiled the standard exporter with the proper settings for LOD use(as discussed above).
This is ONLY for the following Max versions: 9, 2009, 2010, 2011
Download RAR
Resource: www.torquepowered.com/community/resources/view/19893
06/22/2010 (10:58 pm)
While I hope that the workaround/fix is added to T3D's codebase just for the sake of the fix being available to those who will not see these:I have compiled the standard exporter with the proper settings for LOD use(as discussed above).
This is ONLY for the following Max versions: 9, 2009, 2010, 2011
Download RAR
Resource: www.torquepowered.com/community/resources/view/19893
#30
09/17/2010 (6:11 pm)
Fixed in 1.1 Beta 3.
#31
..was Chris' hack/fix added ?
09/17/2010 (6:21 pm)
how exactly was this fixed since it was an exporter issue ?..was Chris' hack/fix added ?
#32
tsShape.cpp @ Lines 1069-1091
I still suggest using the Max exporters I compiled, to be doubly-double-bird safe! :P
09/22/2010 (9:11 am)
sort of the same fix for 1.1B3tsShape.cpp @ Lines 1069-1091
I still suggest using the Max exporters I compiled, to be doubly-double-bird safe! :P
Torque Owner TheGasMan
G.A.S. [+others]
//Edit:
BTW, PhysX exporting using collada doesn't work without errors more than 70% of the time(Russell claimed the same in an email to me while I developed Physit!), YET PhysX exporting using DTS works 100% of the time.