Jump to content
  • entries
    945
  • comments
    5,899
  • views
    930,210

Diving into Constructive Solid Modeling


Josh

2,524 views

 Share

It's pretty clear that constructive solid geometry modeling is a high priority for our community. I like being able to easily sketch out my ideas. In fact, when this feature went away in Leadwerks 2, that was when I just stopped making game levels. It's not that I don't know how to use 3ds Max and other programs, it's just that they're not fun. The upcoming release of Steam Workshop also fulfills my long-held dream of building a shared repository of textures and models scaled correctly to work with CSG mapping.

 

Today I began some preparatory work, starting with some texture templates:

blogentry-1-0-18617700-1401754480_thumb.jpg

 

These are important because they give us a standard template we can line solids up against:

blogentry-1-0-15134200-1401754452_thumb.jpg

 

Why does this matter? Well, when we have a standard template for common features, we can design textures that match the geometry, like this plaster wall below:

blogentry-1-0-43874100-1401754769_thumb.jpg

 

This is one of the tricks that makes maps look great, and it's easy to set up once you have a standard template.

 

However, I ran into one big problem. Leadwerks 2 started using a scale of 1 unit space = 1 meter. This makes a lot of sense, because it is easy to measure physics and large distances, as Leadwerks 2 was mostly an outdoors engine. When it comes to texture mapping, however, this scale is not ideal at all! A human being is roughly 1.8 meters tall. That means that 2 meters is just a little over their head, and is too short to place a wall texture on. We can scale the texture up on the surface, as I did in the example AI map, but this will cause problems. The grid in Leadwerks is based on powers of two, and if we scale the texture up to 2.5 meters in size, it's going to be hard to line brushes up precisely against the texture pixels! What to do?!

 

On the other hand, using a centimeter grid gives a perfect scale. 256 cm is roughly the height of a one-story building's wall, so mapping textures on that scale makes a lot of sense. I realized I could just display a grid in centimeters instead of meters, and it would totally solve this problem, without requiring any rescaling. So I added that setting in the Viewport options and it works perfectly. The door on the left was modeled with the centimeter grid while the one on the right was modeled with the grid measures in meters. Because the grid is power-of-two, the centimeter grid had major grid lines at 2.56 meters, while the meter grid had it at 2.0 meters:

blogentry-1-0-78212100-1401755319_thumb.jpg

 

This will not affect your existing maps, but I recommend you start using the centimeter grid for new maps. This preliminary work will allow me to unleash our artists to produce more texture packs for you to use in your maps, and will allow the community to work together more effectively.

  • Upvote 8
 Share

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...