Detail numbers have no relation to pixel size
by Jeff Gran · in Artist Corner · 07/28/2005 (7:34 am) · 23 replies
From the Max DTS Exporter Docs:
I have just been trying to get LODs working on a model. I have 3 detail levels. I have tried multiple combinations of detail numbers, including: 500, 200, 50; 128, 50, 2; 500, 128, 25; etc. No matter what the numbers are, the models always switch out at exactly the same point: between pixel size 46.5-46.8 and pixel size 4.75-4.76 (based on the numbers shown in the Torque Show Tool Pro).
Has anyone been able to control the exact point at which the LODs switch?
I am using 3DS Max 7. Is this a Max thing? A Max 7 thing?
Quote:
The detail level markers indicate to the exporter what detail is to be drawn at a given distance. The number corresponds to the pixel size in the game engine at which the shape will draw with these meshes.
E.g., if you have markers named 'detail2' and 'detail36', then when the size is 36 or greater the shape would be drawn with the highest detail level. When the size is between 2 and 36 it would be drawn with the lower detail level ending with the number 2, and when the size was less than 2 nothing would draw.
I have just been trying to get LODs working on a model. I have 3 detail levels. I have tried multiple combinations of detail numbers, including: 500, 200, 50; 128, 50, 2; 500, 128, 25; etc. No matter what the numbers are, the models always switch out at exactly the same point: between pixel size 46.5-46.8 and pixel size 4.75-4.76 (based on the numbers shown in the Torque Show Tool Pro).
Has anyone been able to control the exact point at which the LODs switch?
I am using 3DS Max 7. Is this a Max thing? A Max 7 thing?
#3
07/28/2005 (8:07 am)
Using multires.
#4
07/28/2005 (8:51 am)
I just tried an experiment using multires and the same model I was using before. I got slightly different results but still not what I expected. Using multires with SIZES = 100,50,20 the models switched at around 60 pixels and around 14 pixels. Same exact results with SIZES = 500,150,2. This makes no sense to me. Magnus (or anyone) are you sure you have exact control over this?
#5
07/28/2005 (8:57 am)
Yep. My LODs are accurate up to +/-1 pixel in showtool. I use slightly lower values though, usually 128,64,32,2.
#6
07/28/2005 (9:06 am)
Magnus, does it work if you set them to a value that isn't a power of 2 ? Set your 64 to 100 and see if it does the same thing.
#7
07/28/2005 (9:11 am)
I'm off into the nice sun to barbecue now but I'll give it a try later tonight.
#8
I just went back to max 5 since I still have it installed, and tried a test sphere with both multires and manual detail sizes, and it worked correctly within 1-2 pixels. It appears this is a bug with the max 7 exporter.
Thanks for the help in diagnosing it, M. :)
07/28/2005 (9:12 am)
Yeah, I've been trying crazy numbers just for the sake of testing.I just went back to max 5 since I still have it installed, and tried a test sphere with both multires and manual detail sizes, and it worked correctly within 1-2 pixels. It appears this is a bug with the max 7 exporter.
Thanks for the help in diagnosing it, M. :)
#9
07/28/2005 (9:16 am)
Sounds strange, it's the same exporter for both 6 and 7 isn't it? Anyway, now I'm really gone though and I'll still try it out when I get back.
#10
07/28/2005 (9:18 am)
Jeff. have you tired the unmessdts utility to see if this changes anything?
#11
I'm sure it'll get annoying fast to have to unmess everything I export, but at least it works. :)
Thanks, Joe.
07/28/2005 (9:33 am)
Joe, I just tried it, and that did the trick. Heh, after all this time I finally find a use for UnMessDTS. I always thought it was just for if your mesh comes out all crazy triangles.... a "mess".I'm sure it'll get annoying fast to have to unmess everything I export, but at least it works. :)
Thanks, Joe.
#13
This community is really cool.
07/28/2005 (1:02 pm)
Todd - Thanks for the tip... actually I found your resource when I was searching for the unmess.exe (not realizing I already had it on my HD :P), and I've been using it all morning. It really is a time saver! Thanks for putting that up for the community. This community is really cool.
#14
07/28/2005 (3:50 pm)
Ah, yeah. I always run unmess on my models. (I use a script to export my current file to DTS and it automatically runs unmessdts.exe =).
#15
Just put it on a toolbar or quad menu (and copy unmessdts.exe to somewhere where the system can find it, like your windows dir).
07/28/2005 (4:00 pm)
Oh yeah... and the script if anyone want it. I'd submit it as a resource, but right now I don't really have the time nor the energy. It's really quite simply though so it doesn't really deserve being a resource. =)macroScript ExportDTS
category:"WIT"
internalcategory:"WIT"
buttontext:"ExportDTS"
toolTip:"ExportDTS"
(
fname = maxfilepath + getFilenameFile(maxFileName) + ".dts"
exportFile fname
DOSCommand ("unmessdts.exe \"" + fname + "\" \"" + fname + "\"")
)Just put it on a toolbar or quad menu (and copy unmessdts.exe to somewhere where the system can find it, like your windows dir).
#16
07/29/2005 (3:52 am)
Cool, thanks Magnus. I had to change it a little bit for my needs, but this is even faster now. :)
#17
I have a model with 2 LODs, one at 150 and another at 32. Works perfect in show tool after unmessing, but in-game, the switch between the two models happends at about 500 pixels high, and the model never disappears, as it should when less than 32 pixels high.
I just re-downloaded the stock engine and tried it there with the same result. Can anyone confirm the accuracy of the LOD popping in-game? I did it by taking screen captures and measuring the pixel height in photoshop....
08/03/2005 (1:52 pm)
Um, "re-opening" this issue. When I run my models through unmessdts the LODs display correctly in the TSTPro, but not in-game. I have a model with 2 LODs, one at 150 and another at 32. Works perfect in show tool after unmessing, but in-game, the switch between the two models happends at about 500 pixels high, and the model never disappears, as it should when less than 32 pixels high.
I just re-downloaded the stock engine and tried it there with the same result. Can anyone confirm the accuracy of the LOD popping in-game? I did it by taking screen captures and measuring the pixel height in photoshop....
#18
08/03/2005 (2:51 pm)
Hmm, thats strange because I did the same testing by taking screenshots and testing the sizes in photoshop and they were pretty much dead on +/- 2 pixels.
#19
08/03/2005 (3:16 pm)
Hmm, well I just tried taking screen captures and verifying the pixel heights reported in the showtool pro. They're wrong as well. Not off by as much but still off. I tried measuring both the bounding box and the mesh, and neither matched the HUD's reported pixel height. Anyone know how that number is calculated?
#20
08/03/2005 (3:36 pm)
I have no idea. I tried measuring in showtool too and for me it's completely off (tried measuring everything, height, width, height+width, diagonal, you name it). Not sure what to say, but... well... I'm inclined to recommend what I do; screw it and don't worry about it. Just tweak your values until it looks right in the game instead. =)
Torque Owner Magnus Blikstad