Game Development Community

Mesh vs brush, "custom" uv-texturing

by Gg · in Game Design and Creative Issues · 01/09/2005 (9:53 am) · 11 replies

1) Can I import a .3ds hollow cube mesh, complete with uvmapping, and treat it like a wall/floor in Torque?

2) Can I use a .3ds uvmapped mesh for a door (aren't Torque's doors .3ds meshes, or are they brushes?)? If yes, how to add effective hinges, to turn the door around them when the camera hits it?

3) I see that in LW the uv-mapping isn't a issue; I mean, I can wrap an object also in "tricky" way (such as, putting a unique picture as uv-map, let's put, 1580x400, and unwrapping the mesh around it with several unfoldings); but, could Torque have problems on managing objects having this "custom" texturing?

#1
01/09/2005 (11:00 am)
1) Yes you could, but the collision isn't optimized for being treated as an entire interior. You could use DTS objects to link DIFs together, but I wouldn't recommend using them as a replacement for DIFs

2) Yep. You could even make that door animated and have it open/close. I think someone posted a resource about doing just such a thing.

3) Not sure what you mean there...

- Brett
#2
01/09/2005 (2:32 pm)
Hi Brett,

1) ok, I guess I have to build the interior with Quark's brushes... :(
This means also that uv-mapping will go hell; I'll have to use normal textures. Unless... What if I cover the brushes with the meshes? I think that if the collision detection between actors do not give any problems, the same would be also if I set a wall-mesh as an actor. This way, we could use even complex meshes instead of brushes, to create much more detailed interiors.

2) Ok, Robert Barrett's, I guess.

3) I mean, I do not use "standard maps (128x128, 256x256 etc), but irregular maps, although Lightwave frames them anyway as squared backdrops. It will work anyway when I'll import these meshes in Torque?
#3
01/10/2005 (8:03 am)
Marcel,

For (1), you can use DIF collision with a DTS "shell". Create a texture called null.jpg (it can be 16x16 or whatever... it's just a placeholder). Any brush you paint with this texture will not render, but it will still have collision. So you get the advantages of DIF collision with the ease of creation of DTS. There are disadvantages to large DTS meshes, though. Mostly there are lighting problems. I'm not sure, but I think the Synapse lighting pack helps with this.

3) Torque requires textures in dimensions of powers of 2. So you can have 16x16, 512x512, 128x256, 16x512, as long as each side is a power of 2.
#4
01/10/2005 (8:10 am)
I should point out, in case you haven't seen it, there there is work being done to fix problems with map2dif.

- Brett
#5
01/10/2005 (9:57 am)
John, I catch what you are meaning, in its general lines, but, being not a game industrial, most terms aren't so quick for me (they wasn't ever, since I knew of Torque time ago; then I passed to interior design, and I loose my viewport to understand gaming specifics. That's why I asked, elsewhere, if weren't better to build a specific editor for architecturals, which would work without nags; but maybe I'll have to commit it myself to some coders).

Maybe the different range of specifics wherein I'm currently involved, makes my mind unable to fit into a different range, albeit it is still the same world (3d) and related to the same engine. When it comes to modeling, at least, I can catch; but not so quick when it comes to engine specifics, specific terminologies and the like. I tried to supply to my lacks with tutes, and to post detailed questions about, but... Maybe I'm yet too old, or too busy with divergent tasks, in order to learn another kind of system. Probably this could be also the cause for I get few answers, thereafter, from people who assume that all this is "too banal" to step into further.

From the other side, I cannot buy Torque (with developer's licence), the shader's engine or more else, until I'll be not aware of what would be like a walkthru built with it; I'll own just a bunch of applications, without knowing how to use 'em myself! Or should I pay someone here, to build a architectural "level" for me every time I need a new walkthru for Torque? (anyone outta here wishes to get some nice bucks? I've got kind of 500 interiors to commit...) :)

Brett; alas, this is almost turkish for me! :( What it is intended for?
#6
01/10/2005 (11:40 am)
DIF refers to a 3d model made with a program like Quark. Most people don't like the restrictions and difficulty associated with such programs compared to traditional 3d modelling programs. These have highly optimized collision detection (for bumping into walls, walking on the floor). Animation is not used with DIF.

DTS refers to a 3d model made with a program like 3ds max or Maya. These allow a lot of creativity with modelling. Collision information is very limited with DTS. Animation is allowed with DTS.

DTS and DIF are very specific to torque.
#7
01/10/2005 (12:34 pm)
Ok, difs are made of "brushes", and have collisions; dts are models like a gun, a soldier, etc.
But... how Torque knows it is a dif or a dts, if they are still made of common polygons? It is there any different information of the polygon between the former and the latter?
#8
01/10/2005 (2:23 pm)
Yes, they are different file formats. DIFs are created from .map files (can be created in Quark), and are actually created by a program called map2dif (with torque). You are right... they are made of brushes.
DTSs are created in a standard 3d modelling program like 3ds max, blender, maya, etc. The program you use must have an exporter for DTS.
See this link for information on DIF and DTS creation tools.
#9
01/10/2005 (2:37 pm)
You create dts models in one of the standard modelling packages (Max, Maya, Lightwave, Truespace, Blender, Milkshape) and export them into a dts file (which is a custom/proprietary file format that Torque uses).

Dts models are your standard polygonal, uv-mapped models (like the .3ds you referred to). They can be any size/shape you like. They can include animations. However, they are limited on collision and lighting.

Dif models (or interiors as they are commonly referred to in Torque) are created in specialized brush-based editors (Hammer, Quark, Radiant, WED, Cartography Shop). The geometry is pieced together out of of convex primitives (convex meaning no "dents" or "indentations" like a pyramid, cube, sphere) instead of by manipulating triangles, edges, or vertices. A good example of this is how you would piece together an arch (a concave shape) out of smaller convex blocks:

www.rustycode.com/matt/convex_arch.jpg
This simplified modelling technique allows for very fast and natural collision as well as quick shadow generation and self shadowing. It may seem to be an odd way of doing things but with some patience, practice, and understanding you can build very complex objects in this way:

www.garagegames.com/images/ul/1561.snow1.jpg
These "interiors" are also not uv-mapped. They use a texturing technique similar to planar texture mapping where whole textures are projected onto a face and then shifted, scaled, and rotated to fit.

Once you have created an interior in the brush-based editor of your choice you export it to a .map file which is a text file that contains a list of all of the brushes making up your structure along with any entities that might exist in the scene (like lights). You then use the map2dif tool to convert this .map file into a dif file (another custom format) for Torque to load.

There are ways of getting geometry from a standard modelling package into the .map format but they are tricky and hard to use (as you've noted, uv-maps aren't always going to translate all that well). You will often have to treat your modelling package as a brush-based editor and only use convex primitives and planar texture mapping. Even then you are likely to run into some serious poblems.

People have used various work-arounds to help with this problem. One common one is where you have your visible geometry be a dts so that you aren't limited to convex primitives while overlaying it with an invisible interior that acts as your collision hulls. You will still miss out on the nicer lighting of the interiors but that can be somewhat helped with the Lighting Pack.

Once you have created your dts and dif models and copied them into the appropriate directories in Torque you can then use the Mission Editor (F11) to position any combination of them in a mission/world. For example, you might place a beach house interior and then position three of the same lawn chair dts model on the front porch.
#10
01/11/2005 (7:14 am)
John - "DIFs are created from .map files (can be created in Quark), and are actually created by a program called map2dif (with torque)."

That is, Quark creates brush-based ambients, Milkshape (or LW, then export 'em as .3ds; which would be the sole format accepted by the engines, if I'm not wrong) creates mesh models, the Torque imports all of them into the stage and builds the "map"?
That is what I said, it would be better if we'll have some editor which merges both difs and dts at once (just to have the whole under control before to submit it to Torque), then will export the whole into Torque... If I'm not wrong, 3d Game Studio does something like that (although it cannot compete with Torque as for many other details).

Mattew - "These "interiors" are also not uv-mapped. They use a texturing technique similar to planar texture mapping where whole textures are projected onto a face and then shifted, scaled, and rotated to fit."

This means also that I need to break a brush (eg., a single wall's face) in several sub-brushes if I wish to texture it with two or more textures (eg., one for the frame of a ceramic tile, another for the single tile, etc.)?
#11
01/11/2005 (10:20 am)
No no, the .map is simply the geometry used to create the DIF. There is another program that comes with Torque called map2dif which converts the .map geometry into a DIF file.

DIF and DTS files can be loaded in the Torque mission editor. This is an in-engine editor. That means you run the compiled program for Torque, start the mission editor, and then you can load DIF and DTS files. It's rather simple. You ought to download the demo and read some of the available documentation for editing missions. You will understand the process a lot better if you actually try it out.

As far as your texturing question goes, you could do it that way, or you could just create another texture which is a ceramic tile with frame. The second method would be much easier and efficient. But your thinking is on the right track... in order to use two separate textures, they need to be on separate faces of a brush. So you can have a cube brush with at most 6 textures... one for each face.