-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|82|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> On Topic -> Scaling terrain...

Posted : Sunday, 15 March 2020, 07:58

Scaling terrain...

I'm trying to make [technically: recreate] a terrain renderer. So far I have the heightmap renderer working, and the shader for shading the terrain. But I need to make the terrain like.... ten times bigger. That's what the original renderer did. Somehow I think I need to render the heightmap in tiles of 256x256 polygons (each texture for the terrain is 256 x 256 pixels). Does anyone have any idea how to do that? Here's my code: HLSL Shader

Afr0 Games

Project Dollhouse on Github - Please fork!
Posted : Sunday, 15 March 2020, 08:39
A tilemap is made up of lots of tiny blocks that are drawn or (more importantly) NOT drawn when on/offscreen.
I can imagine that 3D techniques might allow for the same sort of thing.
Instead of trying to create huge 256 blocks, what happens if you chop those into, say 64x64 blocks..

Then, instead of drawing, say a 256 and the next along 256, you're instead only drawing the 4x64's that are in view, and turning off those out of bounds..

Optimisation is the key, here. Trying to decide what is and isn't necessary.

Also, this is a thread about technique. It didn't need 37kb of code.

''Load, Next List!''
Posted : Sunday, 15 March 2020, 10:54
I think you might need a streaming terrain technique?
Posted : Sunday, 15 March 2020, 17:08
As well as culling to only draw what's on-screen (Jay's suggestion), you'll probably also want to consider generating multiple meshes at different level-of-detail levels from the same input heightmap, and using the lower LODs for the further away tiles. That should give a decent performance boost that allows you render further away and make your landscape bigger.

Another technique to try (though this may depend on the art style you're going for) could be to introduce a fog effect at long distances, to make it harder to see where your rendering stops (since whatever you do, you're not going to be able to draw forever). A simple approach to that might be to use the depth buffer in your shader to tint / fade the pixels that are far away.

A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Posted : Monday, 16 March 2020, 04:51
Thanks guys!
I’m going to try to do research on some actual techniques for tiling in 3D

Afr0 Games

Project Dollhouse on Github - Please fork!