Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: DaBrain on December 01, 2006, 04:09:07 pm

Title: Use the features! (Detail Box mini tutorial)
Post by: DaBrain on December 01, 2006, 04:09:07 pm
There has been a great feature... and nobody, except for Omniscaper really seemed to use it.
Now a small bug got fixed and it became the most easiest feature to use ever!

What is "detail box"?

Detail boxes are an addition to the lod system. They are really useful for large ships where large areas lack detail, and you can't create more detail, cause the lod0 has a high polycount already.
It's also useful for small ships. For details that are only notice able on close-ups. Like cockpits or semi-complete interiors.

Detail boxes determine the visibilty of subobjects.

How can I set them up?

Setting up a detail box is a really simple. You can do this in 3ds MAX, in PCS and possibly truespace.

In MAX you add this to the user defined properties:
$detail_box: 1
$box_min: -1500,-1500,-1500
$box_max: 1500,1500,1500

(Those values determine the size of the virtual box. In meters.=

In PCS you can do the same. Just add this to the 'properties' in 'SubObjects'.

And you're done! (No, ... really!)


10 minute example:

This is a really crappy model ... and it's set up pretty crappy too. ;)
I hope you still get the idea.

Each cube has 80k polygons(!)


(http://www.game-warden.com/forum/imagehosting/364570a726384a0.jpg)
Looks like they're part of the background, eh?

(http://www.game-warden.com/forum/imagehosting/364570a72681896.jpg)
They are not. ;)

(http://www.game-warden.com/forum/imagehosting/364570a726c9ce5.jpg)

(http://www.game-warden.com/forum/imagehosting/364570a7e7eb06b.jpg)

Short clip: Download (http://www.game-warden.com/starfox/Non_SF_related_stuff/FS2_features_DetailBox.avi) (12MB x264 codec)
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Vengence on December 01, 2006, 04:26:20 pm
Sooo... when you get closer to the borg cubes (lol) they get greebled?
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: DaBrain on December 01, 2006, 04:32:49 pm
Yeah. I turned down the model quality slider in the options to make the effect more visible. (Which made plopping-up worse.)

The model options acutally have an effect on the detail box size. So low-end user can decide to see less details and get more fps.

In a properly done version, the bigger plates should appear first, and then the smaller details.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: taylor on December 01, 2006, 04:45:12 pm
In MAX you add this to the user defined properties:
$detail_box: 1
$box_min: -1500,-1500,-1500
$box_max: 1500,1500,1500
A quick addition to this, the $detail_box option has two settings.  A value of "1" means that you have to be inside of the $box_min and $box_max to see the detail.  A value of "-1" means that you have to be outside of that box to see the detail.

I'm not the model guru, so I'm not totally sure all of the uses for this, but one application might be to have a very detailed subobject using this:
$detail_box: 1
$box_min: -1500,-1500,-1500
$box_max: 1500,1500,1500
and then a low detailed suboject using this:
$detail_box: -1
$box_min: -1500,-1500,-1500
$box_max: 1500,1500,1500

The subobjects would be positioned directly on top of each other, and so when you are inside of the specified box you will only set the detailed version, and when you are outside of the box you only see the lower detailed version.

This should allow for a much more intricate LODing of models rather than just dropping from LOD0 to LOD1 to LOD2.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: At on December 01, 2006, 11:34:16 pm
Quote from: taylor
I'm not the model guru, so I'm not totally sure all of the uses for this, but one application might be to have a very detailed subobject using this:

Maybe something like in FEAR, though more on a subobject level.  One of the Multiplayer models in FEAR has that gasmask cylinder thinger on the end of the helmet.  In LOD0 (The model drawn for the camera sitting inside it), though, the little cylinder is missing.  I'm not actually sure why you'd want to do that here, but who knows.

Still, detail boxes = yum.  I'll have to consider them in future meshes...
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Taristin on December 02, 2006, 02:35:07 am
Quote from: taylor
I'm not the model guru, so I'm not totally sure all of the uses for this, but one application might be to have a very detailed subobject using this:

Maybe something like in FEAR, though more on a subobject level.  One of the Multiplayer models in FEAR has that gasmask cylinder thinger on the end of the helmet.  In LOD0 (The model drawn for the camera sitting inside it), though, the little cylinder is missing.  I'm not actually sure why you'd want to do that here, but who knows.

Still, detail boxes = yum.  I'll have to consider them in future meshes...

In this case it'd be that 1 would be a highly detailed hangar bay, and -1 would be a lesser detailed version. That way when inside, you see everything, but when you leave it, it cuts the detail.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: RavenTS on December 03, 2006, 11:28:12 am
Woah, nice thing such a detail box. Thinking of manned ships, where you can see people in it walk by the windows or explosions/fire behind the glass...   :nod:
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Gregster2k on December 04, 2006, 04:48:36 pm
Detail boxes are really the only way to go IMO when it comes to TRULY detailing things.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Scooby_Doo on December 04, 2006, 05:37:32 pm
Do detail boxes count as subsystems?
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: DaBrain on December 04, 2006, 05:45:56 pm
No, but you probably could use them as subsystems.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: taylor on December 04, 2006, 05:46:37 pm
And in truth, if the model design works with this, you could have a LOD0, debris, and just use detail boxes to fill in all the rest of the detail.  I'd be pretty interested in seeing what someone can do with something like that.  Technically speaking it should be possible to make a highly detailed model that way, using only LOD0, and have it perform as well as, or better than, a normally LODed model, all while being far more detailed.


Do detail boxes count as subsystems?
Nope.  They are just part of subobjects and don't count against anything, other than the little bit of extra time needed to calculate your position relative to the box.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Flipside on December 04, 2006, 11:19:32 pm
Hmmmm... I might well sticky this, we are getting a lot of tutorials these days though, and there are quite a lot of Stickies. I'm hoping to do a texturing tutorial to supplement some of Scooby's work soon as well....

Might be an idea for something like a read only Forum for tutorials if we get enough of them?
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Scooby_Doo on December 04, 2006, 11:37:31 pm
A heads up Flipside, I'd like to another one one my newer texturing style.  The better looking gritier one.  I don't really care if no-one reads it, but it'll give me a reminder for myself when I forget something :lol:
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Bobboau on December 05, 2006, 01:46:25 pm
detail boxes allow recursive detail LODing
this means that a child object of a detail boxed subobject won't be evaluated unless it's parent has passed, so detail that 'belongs' to an object should be made a child of that object.

detail boxes have nothin to do with subsystems in any way, they do not talk to each other, they do not write to each other, they look the other way when they walk past each other in the store, giveing an object that is a subsystem a detail box will not effect it's subsystem status, and makeing a detail boxed subobject a subsystem will not effect it's detail box status.

the box nature of this system has advantages over the radius based LOD system in that you can specify a regon of visability, so if you have detail that is only visable from one side of a ship, you can set up a box that is only on that side of the ship.

if you can avoid drawing two models all the time it would be better to do so, for instance, give a relitively low poly version of the main hull that has a very low detail hanger bay modeled into it, set this model to render when outside it's box, make another version that has a hole were the hanger should be, given a detail box (exactly the same dimentions as the first one) that you should only draw when inside it. in a seperate model (as a child) have a higher poly version of the hanger set it to have a smaller detail box set to only draw while outside the box, as a sibling to this make a highest poly version of the hanger that draws only when inside the box. and as children to the highest poly hanger you can add fighter models and cranes and all sorts of delicious greeble.

keep in mind that detail boxes are in the subobject's frame of reference, so any rotateing submodels will have rotateing detail boxes (this can be worked around by makeing them children of polyless  subobjects with a detail box).
and you can give any sort of animated subobjects (this includes turrets and rotateing subobjects) or groups thereof a detail box.

a shperical equivilant of the detail box, may be available at some point in the near future.

as you can see you can go into rediculus levels of detail with your detail management. have fun :)
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: castor on December 06, 2006, 04:54:52 am
Wow! Sounds like a damn powerful feature this one :eek2:
I know s**t about modding, but can't skip this without throwing a few  :yes: :yes:
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: IPAndrews on December 06, 2006, 10:36:06 am
I would use this for Babylon 5 if it had LODs at all :D. I like the idea of these "Use the features!" threads though. I only discovered the "same turret cooldown" weapons flag yesterday and that's proven extremely useful.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Flipside on December 06, 2006, 05:21:24 pm
Agreed, there is a hell of a lot of features available to make Freespace look utterly incredible, in fact, they are coming so thick and fast that they either pass by un-noticed or people simply don't have the time to go back and include these features on their campaign models.

I'm wondering if some kind of central database of Tutorials as they are created would make the features easier to access for people who are just starting out with the modding thing, and make a useful reference point for the more experienced ones.

If I had the Webspace, I'd host them myself to be honest, but Pipex' main weakness is the lousy 50Meg I got given :(
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: karajorma on December 06, 2006, 05:33:36 pm
This sort of thing should be indexed (and also preferably copied) onto the wiki anyway :)
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Flipside on December 06, 2006, 06:00:15 pm
Agreed. I've certainly come across Tutorials for modding other games that provide a 404 error because the user long since gave up modding themselves, and therefore have removed the files from their server. I suppose that's my main concern, to keep stuff somewhere where it'll still be available even if the author decides to leave the community or loses access to their server or whatever :)
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Scooby_Doo on December 06, 2006, 06:28:20 pm
Agreed. I've certainly come across Tutorials for modding other games that provide a 404 error because the user long since gave up modding themselves, and therefore have removed the files from their server. I suppose that's my main concern, to keep stuff somewhere where it'll still be available even if the author decides to leave the community or loses access to their server or whatever :)

In total agreement
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Scooby_Doo on December 07, 2006, 05:34:32 am
Does anyone know how, if possible in Max to "sketch" details (possibly using an image)  such as cutting polygons to fit the detail,  instead of having to apply the texture, cut the polys, rejoin unnecessary vertices, then extrude?  Not sure if that made any sense.  Something like Displace function but actually works well.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Col. Fishguts on December 07, 2006, 09:40:59 am
If I had the Webspace, I'd host them myself to be honest, but Pipex' main weakness is the lousy 50Meg I got given :(

No more excuses (http://www.mydatabus.com/). :D
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Flipside on December 07, 2006, 11:27:04 am
That's handy 'arry, thanks :)
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: DaBrain on December 08, 2006, 02:49:17 am
Does anyone know how, if possible in Max to "sketch" details (possibly using an image)  such as cutting polygons to fit the detail,  instead of having to apply the texture, cut the polys, rejoin unnecessary vertices, then extrude?  Not sure if that made any sense.  Something like Displace function but actually works well.

I think there are some plugins for this, but I doubt they'll be useful.

I know a 'draw vegetation' pluging for lightwave. Impressive, but somewhat unuseable for tech stuff... It's not very precise.


If I had the Webspace, I'd host them myself to be honest, but Pipex' main weakness is the lousy 50Meg I got given :(

No more excuses (http://www.mydatabus.com/). :D

Finally! ... Now I can open my own community!

DaBrain-Warden-Productions-Sector-Watch !

Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Flipside on December 08, 2006, 05:29:32 pm
Hmmm... I registered but never recieved an Email, and since I don't have a spam folder, it's not there...

Wierd.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Scooby_Doo on December 08, 2006, 07:48:43 pm
How bad is Z-buffer problems occurring with this? I'm detailing the hell out of my waterloo and have created tons of panels.  Will zbuffering be a problem.   I kinda doubt it, since it usually occurs at a good distance and not close up.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: DaBrain on December 09, 2006, 09:22:31 am
Depends on the height of your panels. So far I didn't have z-buffer problems, but really flat stuff could cause problems. Plus that's no use anyway, cause you won't be able to see it.
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Scooby_Doo on December 10, 2006, 05:50:45 am
One more question, this ones more aimed at the coders, how is the detail boxes mesh's textures relate to the main hull? Are they treated like subsystems (aka turrets) or are they batched with the main hull?

Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Flipside on December 10, 2006, 07:39:28 am
Yup, as far as I'm aware you define each detail 'group' as a subsystem, say XDetail01, XDetail02.... and the in the Subsystem properties in PCS, add the detail box info :)
Title: Re: Use the features! (Detail Box mini tutorial)
Post by: Scooby_Doo on December 16, 2006, 01:16:05 am
Good then I can use a seperate texture map for them (especially reuseable details)