Jump to content


Photo

Brush triangle splitting


22 replies to this topic

#1 R Soul

R Soul

    Member

  • Member
  • PipPip
  • 157 posts

Posted 19 April 2018 - 06:09 PM

Could someone explain the cause of this problem, and suggest the best solution?

 

Here I have a path with a slight bend:

Brush_Split1.jpg

The curved part of the wall is a mesh, with a simple set of Caulked brushes behind it.

You can see that the triangles looks unpleasant. Long thin triangles don't seem like a good thing.

 

Here's a DarkRadiant screenshot with the func_statics turned off, and the brushes selected:

DR_Brushes.jpg

All the vertices are snapped to the grid (I think I had to go down to 1 to get the path texture lined up nicely at the corner).

 

If I turn the pathway brushes into func_statics (with Caulk underneath to seal), the in game result is much nicer:

Brush_Split2.jpg

 

It works, and the AI have no trouble walking over it, but is there a better solution? I can live with this for one part of the map, but if it occurs elsewhere I'd prefer a more elegant solution.



#2 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1637 posts

Posted 20 April 2018 - 12:42 AM

AFAIK, brush will always split whenever they encounter a vertex, edge, or face of another brush. The only way to avoid this, is to replace brushes with static meshes, and use brushes only as an outer seal for your rooms (with caulk).

 

That's one of the reasons why modern games moved to static meshes exclusively. Brushes are used only in prototype phase and then replaced by models.


Edited by Judith, 20 April 2018 - 12:42 AM.


#3 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5700 posts

Posted 20 April 2018 - 02:23 AM

This.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#4 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37406 posts

Posted 20 April 2018 - 07:39 AM

You can see that the triangles looks unpleasant. Long thin triangles don't seem like a good thing.

 

 

 

Is it actually causing any noticeable problems?


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#5 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9030 posts

Posted 20 April 2018 - 07:54 AM

Graphic cards don't like long thin triangles according to an old investigation by Humus ( former ATI employee and engine architect for Ubisoft). We could change how DMAP triangulates to force it to split more triangles if the slope gets too steep. It would cost more memory though and if we still use stencil shadows with CPU derived silhouettes it would also cost a lot more CPU performance ( the latter might be irrelevant since Shadow Maps are working in SVN ).
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#6 Epifire

Epifire

    Advanced Member

  • Active Developer
  • PipPipPip
  • 540 posts

Posted 20 April 2018 - 08:55 AM

If you make a junction brush out of that corner (connecting that inner vertex on the left to the three outer verts) you should be able to remove any shear angles for how far those triangles are stretching.


You need a model? Epi does you a model.

 

Toss me a PM I promise I don't bite.

 

 


#7 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1595 posts

Posted 20 April 2018 - 10:57 AM

You could easily turn that wall into a patch surface - it will be a clean, smoothed surface. They will act as models and wont interfere with your brushes, as far as I remember. 



#8 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37406 posts

Posted 20 April 2018 - 03:23 PM

Seeing as how the engine has worked this way for the past twelve years, I would have thought we'd have seen something specific if this was an actual problem.  Is there something I've missed?


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#9 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5700 posts

Posted 20 April 2018 - 05:28 PM

Long thin triangles are more sensitive to rounding errors. This is a well investigated numerical issue. In case of graphics this would cause the pixels to have "wrong" colors. If the strength of the errors are relatively small, it is hardly noticeable, though. From my point of view the issue is less that such triangles are created, but more the unneccessary amount of tris generated. This can easely be bypassed by seperating geometry into different func_statics (brushes and patches belonging to the same func_static will still split up each other) or even better making use of modules.

 

We could change how DMAP triangulates to force it to split more triangles if the slope gets too steep.

Actually one would do this https://en.wikipedia...y_triangulation


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#10 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 21 April 2018 - 04:27 AM

Is there something I've missed?

I would say imho, that we are seeing larger and more complex maps. Far larger than the original engine ever had to deal with.



#11 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37406 posts

Posted 21 April 2018 - 08:31 AM

I would say imho, that we are seeing larger and more complex maps. Far larger than the original engine ever had to deal with.

 

What does that have to do with whether thin triangles cause any visible problems?


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#12 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 21 April 2018 - 09:22 AM

What does that have to do with whether thin triangles cause any visible problems?

The context or my post was that its only rescently that we are seeing bigger maps, so the engine has been fine for the last 12y wars because maps never got above a certain size or complexity.



#13 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37406 posts

Posted 21 April 2018 - 10:14 AM

The context or my post was that its only rescently that we are seeing bigger maps, so the engine has been fine for the last 12y wars because maps never got above a certain size or complexity.

 

That's only relevant if we are actually seeing any visible problems, as opposed to hypothetical ones.  That's why I asked if I had missed any.


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#14 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 21 April 2018 - 03:11 PM

That's only relevant if we are actually seeing any visible problems, as opposed to hypothetical ones.  That's why I asked if I had missed any.

The potential is that we might be, due to the larger maps pushing the engine. For example the large map I am working on, due to the amount of brush work may well be causing the engine to create a larger amount of these triangles than has previously been seen over the last 12yrs. And what context would you have been expected to be looking for problems like these? as I understand it its an engine/code issue?


Edited by Bikerdude, 21 April 2018 - 03:12 PM.


#15 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37406 posts

Posted 21 April 2018 - 03:51 PM

The potential is that we might be, due to the larger maps pushing the engine. For example the large map I am working on, due to the amount of brush work may well be causing the engine to create a larger amount of these triangles than has previously been seen over the last 12yrs. And what context would you have been expected to be looking for problems like these? as I understand it its an engine/code issue?

 

Internet communication is hard.

 

I asked whether or not the thin triangles were creating any visible problems, given that there haven't been any reports about any issues related to them.

 

You answered by saying "maps are bigger now".

 

That's not actually an answer to the question. 

 

I was looking for answers like, "I haven't noticed anything either", or "I have noticed them cause a problem; here's the circumstance where it happens", or even possibly, "even though they aren't causing visible problems, they could cause problems we wouldn't be able to easily detect, such as x, y and z.".

 

All of those are potential data points that can be used to assess whether or not the issue requires a solution, or whether it can be ignored.


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#16 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20223 posts

Posted 21 April 2018 - 04:00 PM

Even though they aren't causing visible problems, they could cause problems we wouldn't be able to easily detect,

That's were I was leaning towards when I suggested that bigger maps might be highlighting the issue, as in more more brushes causing more splitting and more acute triangle.

 

Anyway this going off topic a bit as R-soul was I think, looking more towards best mapping practices than anything else.



#17 Abusimplea

Abusimplea

    Member

  • Member
  • PipPip
  • 484 posts

Posted 21 April 2018 - 04:34 PM

 

Is it actually causing any noticeable problems?

Last time i tried modding on 2.05, i had problems with sliver tris in brushwork that got removed by the engine because they where long/thin enough for the engine to treat them as degenerate. The only "fix" guaranteed to work was to export brushwork as model and reimport it.


Edited by Abusimplea, 21 April 2018 - 04:35 PM.


#18 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5700 posts

Posted 21 April 2018 - 04:45 PM

There is no (direct) relationship between the size of a mission and the generation of thin triangles. Whether those are generated depends on the geometry. And normally they will not cause any issues. The combination of a thin triangle far away from the origin (which is more likely in a large mission) may cause the issue mentioned by abusimplea. If something like this happens it is easy to fix, though.

 

But it is definetely not an "issue". There are several approaches on how to triangulate surfaces, of which some are more straight forward and some are more advanced and are designed to avoid thin triangles. They are, however, normally only used in numerical simulations, where thin triangles can cause serious troubles. For us the effect is neglectable imho.


  • Bikerdude and stgatilov like this
FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#19 R Soul

R Soul

    Member

  • Member
  • PipPip
  • 157 posts

Posted 21 April 2018 - 05:58 PM

Thanks for the responses. My situation has nothing to do with limits; the map is quite small. I followed a hunch and deleted the pillar models and the triangles on the ground became much simpler. The model has a custom shadow mesh (with a noshadows material for the visible model).

 

Here are three images showing different setups.

1: The initial setup (custom shadow mesh, path made from brushes):

1_ShadowMeshBrush.jpg

 

2: Real shadow, path still made from brushes:

2_RealShadowBrush.jpg

 

3: Shadow mesh, path converted to func_statics:

3_ShadowMeshFuncStatic.jpg

 

It bothers me that the shdw number goes down when I use real shadows. I'd expect it to go up.



#20 Abusimplea

Abusimplea

    Member

  • Member
  • PipPip
  • 484 posts

Posted 21 April 2018 - 08:12 PM

The combination of a thin triangle far away from the origin (which is more likely in a large mission) may cause the issue mentioned by abusimplea.

I experienced it in the initial experimentation phase right after starting to use DR. The map was tiny and only had one room.
 

But it is definetely not an "issue".

For me it was - never dared to start a real map because of it (might try after getting used to Blender).

#21 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5700 posts

Posted 22 April 2018 - 07:02 AM

Then the problem occoured more stronger on your end than usual. At least I have experienced it very rarely. And I have experienced missing tris on func_static in the past even if the tris were not thin, so I am not a houndred percent sure whether those things are related to each other anyways.

 

@R Soul: If you turn those pillars into func_statics, they will not split up the ground.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#22 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1637 posts

Posted 22 April 2018 - 07:20 AM

I think pillars are func_statics, but they do have some unnecessary triangles here and there. Nothing super serious though, mostly the base and head could use some cleaning.



#23 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1637 posts

Posted 22 April 2018 - 07:52 AM

R_Soul, I'm not sure if you wanted a chamfer going both ways, but this would be a bit cleaner way to go:

obraz.png





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users