[SOLVED] Is there a minimum size setting for a sphere?

In my virtual solar system. my planets disappear when they are far away. I’d like to see a speck of Pluto from the Sun or Earth.
Is there a way to set a minimum radius? I’d like to check the minimum output radius size (after scaling/transforming) and say that, if it’s less than 1f, set it to 1f. I think that is in native code and that’s c/c++, right?
Can I make a shader that outputs at least one pixel?

Sounds like it’s being clipped by the far plane… part of camera setup.

Setting these really big has down sides, though, as it affects the depth of the Z-buffer.

Rendering realistically scaled space scenes is difficult because of floating point resolution, etc… usually requires quite some tricks to render different layers for far, mid, near, etc… depending on what you want to do.

Else, just scale everything down to AUs and hope for the best.

2 Likes

Thanks for the reply, pspeed.
I think the perspective transform makes it so small that it doesn’t get drawn. I’ve gone back to openGL and have a simple game loop. I’m working on hacking into the rendering after the perspective transform and before the drawing to check for a minimum size. There is nothing around Pluto to conflict with.
I also was thinking of putting each planet in its own state (one for the whole solar system and one for each planet). That would give me better resolution up close. You come out of warp drive and transfer to another state.
I was also thinking about an inverse scaling. the farther away it is, the bigger I scale it. But, that’s way imprecise.

If you haven’t changed your camera setup, anything farther than 1000 units away from the camera won’t be drawn… period.

If a sphere is drawn at all then it will be at least one pixel on screen. Nothing culls based on size.

Ok. It must have been clipped. Thanks again.

1 Like