#Rendering large and small objects in the same scene

15 messages · Page 1 of 1 (latest)

hexed hinge
#

Hi,
I am super new to gamedev and 3D graphics. I am trying to make a 3D simulation of a spacecraft in orbit using bevy. My question is about actually rendering the meshes for the spacecraft and the planet (say, Earth), to realistic scale. When I simply try creating a sphere of the correct size and then place the mesh for the spacecraft a few hundred kilometers above it, I get a lot of jittering and artifacts with the spacecraft. I am guessing that this is some sort of floating point issue? I don't necessarily want to constantly zoom into and out of a planet, but what I want is for the spacecraft and planet to be accurately visible at the same time.

Some Googling brought up "Logarithmic Depth Buffers" as a possible solution. Are there any implementations or examples of this type of rendering?

#

Rendering large and small objects in the same scene

wraith niche
#

Just rendering a detailed planet sized object is inefficient - when you're far enough away, most of the detail won't be visible. You want to replace the mesh with a simplified version. This is usually called level of detail (LOD). Bevy dosent have anything built in for this ATM, so you'll need to write a manual system to swap the mesh out for each entity depending on camera distance.

#

That's one thing you'll need to do

#

The other is that you don't actually want extremely large numbers for representing position, especially floating point ones

#

There's several different ways you can do things, so you'll have to figure out what works best for you

hexed hinge
#

Do you have any suggestions on how to deal with the coordinate scales? I think lack of quality for the planet is something I can live with as long as the spacecraft doesn't look glitchy

wraith niche
#

I have no practical experience in the area, so I'm just spitballing off the top of my head, but my first idea would be to split the world into larger sectors, and store position as sector + local position within sector

#

You'll want to ask people who have done this before though, idk

#

Also you want LODs for performance reasons - rendering a huge mesh that's far away is expensive, you can just render a simplified smaller sphere

hexed hinge
#

Do you know of any keywords that I can search for to learn more about this?

wraith niche
#

No, sorry :/

#

Try asking around other gamedev communities

hexed hinge