Procedural RPG OT: every action has consequences

Viewing single post

Started by Legend, Apr 20, 2019, 09:02 PM

previous topic - next topic

Legend

More or less I've finalized my terrain LOD method. A whopping 10 levels of detail will be used.

The highest level of detail is a 128*128 map of the area immediately around the player. It extends ~30 meters in each direction. A single pixel of this map covers ~19 inches. For comparison, the heightmap in Fallout 4 had one pixel per 18 inches. That seems like a good enough resolution considering it was good enough for a AAA game and I'm not pursuing realistic graphics.

The second LOD is another 128*128 map that covers an area twice as wide. Third is a 128*128 map four times as wide, fourth is eight times as wide, etc. After ten of these the texel density matches that of the 2048*2048 prerendered world map.

All ten maps can be packed into a single 512*512 texture so it becomes very efficient. The ground shader transforms its UV based off distance and doesn't need to change anything else.


During normal conditions all maps will be centered around the player, but this is not hardcoded. Each map is updated separately and can be positioned separately. So for example while walking down a path, the smallest map is updated almost every frame while the rest are updated sporadically. If the player teleported to the opposite corner of the world, the LOD levels could pop in from highest detail to lowest detail, opposite of normal texture streaming.

Last but not least, this system is flexible. The texture containing all the maps can be rendered at a higher or lower resolution depending on graphics settings. 64*64 maps can be packed into a 256*256 texture or 256*256 maps can be packed into a 1024*1024 texture and the shader would be fine with that.

Initially these maps will be rendered on the CPU but the end goal will be rendering them on the GPU in between frames.