welcome guest
login or register

27th of February 2024

27th of February 2024
Experimenting with a 3D optimization method to draw a lot of objects in the distance. Because of the distance they won't be seen in great detail, so instead of rendering them in true 3D let's just flatten them. I wrote a function to read 3D model data, converting it to a 2D pixel graphics image of the model seen from 100 meters of distance. I didn't have enough time to get the colors correctly, but I think I can get that fixed some other day.
up
18 users have voted.

Comments

This like what I've seen on some of the videogames I play: the trees at the foreground are real 3D, and the trees further back are flat 2D images. Since the player is not supposed to get close to the 2D trees, they won't notice they're 2D and low-detail. But I suppose you want to have a more free camera, and if I remember correctly, Ancient Savo uses algorithmically-generated maps, like UnReal World?

Ah, yes - Ancient Savo has a procedurally generated map, and the camera can be freely moved around. But that just means that whenever the camera is moved the game decides which way to draw each tree. That is done anyway for the sake of basic optimization, for not to draw trees outside the view we anyway need to check which trees are visible and which are not. So then it is just one little extra step to determine the level of detail based on distance between the camera and the tree. Currently my plan is to have three versions of each 3D model; full-detail 3D, low-detail 3D, and flattened to 2D.

This kind of optimization probably is not necessary for a modern graphics card - but I plan to have Ancient Savo on Android and iPhone, and it looks like my desktop 3D performance is about the same as a newish Android phone, so the optimization strategy should make it possible to have the same graphics both on mobile and desktop.

Add new comment

CAPTCHA
Please reply with a single word.
Fill in the blank.