# Triangles vs Blocks

## Recommended Posts

TTT_Dutch    240
Well, for my indie team's game, we are going to need a level that you can dig down in and that is randomly generated. We have considered very small block particles that are almost impossible to notice and then a regular terrain that is just one layer but copied and repeated downwards.

Technique 1 (Blocks):
[color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color]
[color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color]
[color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"] ?[/size][/font][/color][color="#333333"][font="arial, helvetica, clean, sans-serif"] [/font][/color]
[color="#333333"][font="arial, helvetica, clean, sans-serif"] [/font][/color]
[color="#333333"][font="arial, helvetica, clean, sans-serif"][size="2"]Technique 2 (terrain vbo repeated)[/size][/font][/color]
[font="arial, helvetica, clean, sans-serif"][size="2"][color="#333333"]---------------------------------[/color][/size][/font]
[font="arial, helvetica, clean, sans-serif"][size="2"][color="#333333"]---------------------------------[/color][/size][/font]
[font="arial, helvetica, clean, sans-serif"][size="2"][color="#333333"]---------------------------------[/color][/size][/font]
[font="arial, helvetica, clean, sans-serif"][size="2"] [/size][/font]
[font="arial, helvetica, clean, sans-serif"][size="2"][color="#333333"]Both of those characters are supposed to be closer together but I think you get my point. I think that the blocks idea is going to require more verts and culling could be harder, but with the terrain idea, the terrain would have to be made of many small triangles (about the same size as the blocks).[/color][/size][/font]
[font="arial, helvetica, clean, sans-serif"][size="2"] [/size][/font]
[font="arial, helvetica, clean, sans-serif"][size="2"][color="#333333"]So I was wondering, what would be more efficient for digging and later building, triangles or blocks?[/color][/size][/font]
[font="arial, helvetica, clean, sans-serif"][size="2"] [/size][/font]
[font="arial, helvetica, clean, sans-serif"][size="2"][color="#333333"]PS: Display lists or VBOs for rendering this?[/color][/size][/font]

##### Share on other sites
Waterlimon    4398
If possible, you could make the terrain out of a single layer of triangles and when you dig, it removes triangles inside the dug area, and covers the surface of the digging shape with triangles if its on the "in ground" side.

That would propably be hard to make and you have to calculate the colors of the triangles based on some other data...

I think this would work the best if you want very precise digging, but if you make the ground out of billions of cells, it might be easier to do. (though it might lag more)

##### Share on other sites
TTT_Dutch    240
[quote name='Waterlimon' timestamp='1307008968' post='4818596']
If possible, you could make the terrain out of a single layer of triangles and when you dig, it removes triangles inside the dug area, and covers the surface of the digging shape with triangles if its on the "in ground" side.

That would propably be hard to make and you have to calculate the colors of the triangles based on some other data...

I think this would work the best if you want very precise digging, but if you make the ground out of billions of cells, it might be easier to do. (though it might lag more)
[/quote]

Ya I know that is the predicament I am in. I am thinking it will be easier to use blocks, but then only render them if they are the "top" layer. So in some areas the top layer goes down if you dig. Hmm, I am not sure about this though. Any other ideas other than these two or for these two?

##### Share on other sites
Waterlimon    4398
You would only render blocks wich are connected to a transparent (so they are not completely hidden by other blocks)

##### Share on other sites
SuperVGA    1132
Sounds like you want to be using [url="http://http://en.wikipedia.org/wiki/Marching_cubes"]Marching Cubes[/url], or maybe even marching tetrahedons?
If you like a more rough but higher-res terrain without caring if the player can precisely shape the terrain, i recommend it. If you need an Infiniminer sort of behaviour, it will cost you more polys, obviously, but it might look nicer at lower resolutions.