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

Sun, 15 Mar 2020, 07:58
Afr0

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!
Sun, 15 Mar 2020, 08:39
Jayenkai
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!''
Sun, 15 Mar 2020, 10:54
Pakz
I think you might need a streaming terrain technique?
Sun, 15 Mar 2020, 17:08
shroom_monk
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!
Mon, 16 Mar 2020, 04:51
Afr0
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!
Fri, 03 Apr 2020, 15:56
Afr0
Well, I finally got the city renderer working, at least. I still need to make it bigger, but I sorted out some texturing issues I was having. The original heightmap was rotated by ~45 degrees to make it fit into a POW2 texture (512x512). So I had to rotate it to make everything work.



-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!