Jump to content

Brushes vs. Model Geometry?


Monkey Frog Studio
 Share

Recommended Posts

Hello. I am curious if there is a difference, as far as performance is concerned, between using brushes (CSG) and models? For example, if I were to build a level with a room (walls, floor, and ceiling) built from brushes and another level with a room (walls, floor, and ceiling) built from geometry, would the level with brushes perform better than the level using only models? Or would they perform about the same. This is assuming the models use the simplest geometry (i.e 12 tri faces for a cube and not 10,000, for example). 

I realize the advantages of CSG for quickly laying out walls, floors, etc., and how well they work with textures/materials (especially when tiling), but are they, overall, more efficient in Leadwerks? If a level had 100 CSG cubes vs another level with 100 model cubes, both with the same material, would they perform the same or would one be more efficient?

Thanks.

Creating professional 2D and 3D content is my passion!
Monkey Frog Studio

Link to comment
Share on other sites

Brushes get collapsed to form a single object (except if they have a mass or a script attached). This means, if you have 100 CSG cubes, there is still only one transformation matrix for them and basically everything that runs per object only runs once. For that reason, they should perform better than using multiple objects of box models... If you, however, compose all the boxes in your 3d modeller and export them as a single object, they should perform the same.

I suppose, collapsing could have a negative impact as well: since they are only one object, the individual boxes can not be culled. I.e. if one of them is within the viewing frustrum, all of them need to go through the rendering stages until the individual fragments are finally culled when rasterizing, while if everyone is an individual object, they can be culled early.

This means that both, a negative and a positive impact on performance might be possible.

Link to comment
Share on other sites

Thanks for responding, Ma-Shell. But what I am really wanting to find out is if there is an advantage to using brushes to build level geometry vs. models, as far as performance in the game engine. There is an advantage when creating the geometry in the editor because you don't have to UV map brushes, textures instantly tile, and any CSG brush can be manipulated at any time (made longer, taller, etc.). 

So, let's say I build a simple room out of CSG brushes. This room consists of four walls, a floor, and a ceiling. In another level, I build the same sized room out of three models - one for the floor, one for the ceiling, and one for the wall (duplicated to make the four walls). Both the CSG room and the model use the same materials. So, would both have about the same performance?

If, for example, CSG brushes had a significant speed advantage over models, then I would create most of the simple, flat stuff (floors, walls, etc.) out of them so I could take advantage of that and then create the more complex stuff (pipes, chairs, etc.) out of models. If, on the other hand, it's a toss up (i.e. similar brushes and models affect performance about the same), then I can do whatever I please  ... models for walls or brushes ... whatever is best at the time. If models are easier on the engine, then I can build my entire interior level out of only models if I want. 

So, I am just looking at this from the perspective of performance, if that makes sense.

Creating professional 2D and 3D content is my passion!
Monkey Frog Studio

Link to comment
Share on other sites

5 hours ago, Monkey Frog Studio said:

Thanks for responding, Ma-Shell. But what I am really wanting to find out is if there is an advantage to using brushes to build level geometry vs. models, as far as performance in the game engine. There is an advantage when creating the geometry in the editor because you don't have to UV map brushes, textures instantly tile, and any CSG brush can be manipulated at any time (made longer, taller, etc.). 

No difference at all. The CSG tools are just there because they are convenient to use.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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.

 Share

×
×
  • Create New...