Different camera-range for different objects?

Blitz3D Forums/Blitz3D Programming/Different camera-range for different objects?

Farflame(Posted 2003) [#1]
Is it possible to change the camera range for different objects? I have a game which features collosal objects such as planets/suns, aswell as relatively small objects such as spaceships. Obviously the sun can be seen from millions of miles away, but the ships only need to stay within range for a few miles. When I set the camera range to be very high, the ships continue to be visible even when they're a single pixel and I'm worried that Blitz is still trying to show them correctly and using up resources. Ideally I just want them to disappear after a certain distance. Is there some way to do this other than to manually check their distance and hide/show them when necessary?


morduun(Posted 2003) [#2]
Nope. Manual checking is the way to go.


Stevie G(Posted 2003) [#3]
Farflame, check out the EntityAutoFade command - you can set the ships to fade out once they're a certain distance from the camera - I'm sure this is what your looking for.


Floyd(Posted 2003) [#4]
This mixing of things 'millions of miles away' with others that are nearby is not feasible anyway.

You should handle this like the skybox in the Castle demo.
The sky is close to the camera. But EntityOrder forces it to be drawn behind everything else, as if very far away.


Farflame(Posted 2003) [#5]
Ahh, the entityautofade seems to be what I'm looking for, thanks.

I understand how the skybox works but I'm not sure if that could be adapted to a planet at varying distances. I'll have a fiddle around though, it might work.


_PJ_(Posted 2003) [#6]
Long-range wont eat resources much, unless your space is packed full of hundreds of space-stations, asteroids, loads of ships etc.

What can be a problem with extremely long-range camera range is the Z(W?) Buffer which deals with the rendering of objects in the correct place. Due to floating points (I think) this becomes increasingly inaccurate at vast distances.

Not the distance itself, but it is to do with small-scale differences out of a large-scale range.

For help with spacee and scaling, some good ideas were given here


jhocking(Posted 2003) [#7]
EntityAutoFade is a really useful but under-utilized command. That is definitely what you are looking for here.