RE: [Algorithms] Massive spaces
Brought to you by:
vexxed72
From: Tom F. <to...@mu...> - 2000-08-21 01:56:19
|
(1) Partition your Z buffer. In D3D this is done using the dvMinZ and dvMaxZ values in the viewport. There is a pretty direct equivalent in OpenGL - I forget what it's called. Then you can even out your precision quite happily. (2) They're planets. Big spherical things. And they don't (usually - depends what sort of game you are doing I guess :-) actually intersect in space. Possibly nothing in the universe is easier to sort from back to front and draw that way. So you can nail them to the far clip plane, set your Z test to LESSTHAN, and there you go. (3) Move your near clip plane according to the nearest object. So if you are on a planet's surface, the near clip plane is quite close. If you are zooming about in space, it's millions of miles away. By using all these three, you can get huge spaces done pretty easily. If the archives are working, this has been discussed a fair number of times. Tom Forsyth - Muckyfoot bloke. Whizzing and pasting and pooting through the day. -----Original Message----- From: Sam Kuhn [mailto:sa...@ip...] Sent: 21 August 2000 02:33 To: gda...@li... Subject: [Algorithms] Massive spaces Hey, I've got a little mind game for you lot. Say you needed to render an entire solar system, in which you can zoom down to a planet surface and see detail of about 1/100000 meter, or shoot over to the sun and see the same sort of detail. There are a couple of immediate problems: You would need need an enormous view volume (what say 20 lightyears big) which gives an appauling zbuffer resolution. So whats are you to do? Render the distant objects closer than they actually are (i.e. at the far end of a planet-sized view volume) and scale them down accordingly?. This surely would give incorrect parralax between the distant objects Also you need the planets to be of enormous size so that the front clipping plane doesn't cut through the planets fine detail when you are in very close (lets say an ant view for example). Which again buggers the zbuffer, since you're using a planet sized view volume. Any ideas? Regards, Sam. |