Hermann
31.12.2010, 10:53
my theory is that a modern personal computer is fast enough to draw clouds that are made of puffy little bits that are each 1 meter across.
not a bad start to drawing clouds, eh? to make it of puffy little bits that are each 1 meter across? where each puffy bit is 1 polygon?
if a cloud is made of puffs, and each puff is a meter across, and each puff is 1 polygon on the video card, then that seems a decent way to build clouds in a flight sim, right?
right?
seems reasonable?
of course, the max visibility in x-plane 10 is 100 miles.
so, the scenery region is 100 miles north/south, 100 miles east/west, and goes from the surface to 45,000 ft.
there are 2000 meters in a mile.
there are 15,000 meters in 45,000 ft.
so, that is 100 x 2000 x 100 x 2000 x 15000, which is 600,000,000,000,000 cubic meters (do the math)
so, to render solid clouds in your flying area for x-plane 10, that is only 600,000,000,000,000 puffs of cloud for your video card to draw.
now, we want to draw these puffs at about 60 frames per second (so we leave some power to draw the stuff on the ground, too!), so that is only about 36,000,000,000,000,000 polygons per second of cloud puffs that your video card needs to handle to do a basic cloud rendering of 1-meter puffs across the sky.
as well, if there is one polygon every meter, and you can see for 100 miles up high, then you will clearly be looking thru 200,000 meters, and with one puff per meter, you will be looking thru 200,000 cloud puffs.
that does not sound so bad.
of course, when you are flying through these clouds, then that means that each pixel on your screen will be filled 200,000 times (once per puff of cloud, of course), and if you are running in the very low resolution of 1024x768, at 60 frames per second, then that means your video card will obviously be putting out 1024 x 768 x 60 = 50,000,000 pixels per second.
of course, each pixel is being filled 200,000 times. (once per puff by having one puff every meter for 100 miles)
so, any video card drawing this scenery would be filling 50,000,000 pixels per second 200,000 times, which is actually filling 50,000,000 x 200,000 = 10,000,000,000,000 pixels per second.
do the math on this yourself.
it is NOT that hard.
you just look at the number of cubic meters in the sky, assuming 1 puff per meter, and the number of pixels on your monitor, assuming a refresh 60 times per second.
so, to do the rather basic job of filling the sky with clouds whose puffs, each of which are a polygon, are one meter across (a reasonable size to see up close), your video card for x-plane 10 will simply need the following specs:
36,000,000,000,000,000 polygons per second
10,000,000,000,000 pixels per second
umm. ok.
but we have seen advertisements with words like 'awesome' and 'red hot' to describe the performance of video cards, so they must be able to handle this, right?
well, let's see.
the current bad-ass wicked-awesumm video card, the nvidia gts-450 (gts-450! with a name like that, it sounds like a MUSCLE CAR! it MUST be FAST!) can deal with:
700,000,000 polygons per second
11,200,000,000 pixels per second
do the research on this yourself.
it is NOT that hard.
so, with the video card with a name that makes it sound as powerful as a car, you would only need
36,000,000,000,000,000 / 700,000,000 = 51 million of them to do the polygons, and
10,000,000,000,000 / 11,200,000,000 = 892 of them to do the pixels.
so, the current video cards are one 51 million times too slow to do the job.
this is why, when someone emails me telling me that they WAAAAY exceed the minimum system requirements, so why can't they run x-plane at MAXIMUM settings, since their computer is a full 10% faster than the minimum system requirements, i have a good laugh.
if their computer was not 10% faster, but was instead 51 million times faster, then it might be fast enough to do a decent job of rendering the clouds we want in x-plane 10.
do you see now why i don't go krazee with excitement each time a video card manufacturer announces that they have a card that is 10% faster than the competition?
make it 51 million times faster and we'll talk.
so, how will we render these clouds in x-plane 10, since i do not want each person to have to buy and install 51 million video cards, since that is a slightly problematic system requirement?
the answer is a display of resolutions of buckets.
imagine this:
we have a HIGH resolution of cloud geometry. each puff is 1 meter across. BUT, those puffs only go out, say, 10 meters.
in other words, sure: you can see cloud puffs that are 1 meter across. but you can only see them up to 10 meters away.
you see the small, detailed puffs up close only.
that ain't many puffs. just 10x10x10, or 1,000 puffs. we can handle that.
then, for puffs that are 10 meters away to 100 meters away, we draw puffs that are 10 meters across!
how many puffs to fill that space?
well, we have 1 puff every 10 meters, we go out 100 meters in visibility for a moment, so that is 10 puffs north/south x 10 east/west x 10 up/down, for 1,000 puffs.
hhmmm...
we just covered 10x the space, but without using the exact SAME number of puffs as we did for the smaller area, by making each puff bigger.
sure, the bigger puffs are less detailed, but since they are farther away, you could not see the 1-meter-diameter puffs anyway... they are too far away to see when they are that small.
then, from 100 meters to 1,000 meters, we draw puffs that are 100 meters across.
we have 1 puff every 100 meters for 1,000-meter range.
that is that is 10 puffs north/south x 10 east/west x 10 up/down, for 1,000 puffs.
again, only 1,000 puffs.
BUT, we are covering a full kilometer! the better part of a mile!
how about we go out 100 kilometers???
each puff is, say, 10 kilometers across if drawn so far away.
that is 1 puff every 10 kilometers for 100 kilometers.
so that is 10 puffs north/south x 10 east/west x 10 up/down, for 1,000 puffs.
AGAIN!
NO MATTER HOW BIG THE SKY, EACH LEVEL OF DETAIL ONLY COSTS US 1,000 PUFFS!
7 levels of detail is plenty of detail.
we call each level of detail a 'resolution'.
so 7 resolutions gives 1-meter wide puffs of close, and huge puffs very far away, as seen from orbit!!!
and we wind up with: 7,000 puffs.
diddly-squat for a modern video card.
so THIS is the trick to the cloud-rendering in x-plane 10: we draw a LOT of SMALL puffs up close, and a FEW HUGE puffs out far away. this gives the detail you want up close, with the general cloud layout visible from 100 mile away. there is no need to draw tiny 1-meter-wide puffs 100 miles away: you could never even SEE them from that far away!
so, our DISPLAY of the weather uses about 7 RESOLUTIONS of cloud-puffs, with maybe a handful of thousands puffs at each resolution... a total result of maybe a small handful of tens of thousands of puffs.
why, you don't need 51 million video cards to draw that at all!
in fact, you could even use just ONE video card!
the perfect amount to fit inside your computer!
BUT, we are not done yet.
each resolution contains all the cloud puffs around you... including the ones BEHIND you!
we certainly don't want to tell the video card to draw the puffs of cloud that are BEHIND you. that would slow you down for nothing.
SO, we break each RESOLUTION down into 27 BUCKETS (a grid, in 3-d, measuring 3x3x3... EXACTLY like a rubics cube).
BUT, this is a rubics cube that you fly around INSIDE of, with each cube being a BUCKET.
of course, we only draw the buckets that are FRONT of you where can SEE them!
this doubles the frame-rate again, since maybe half of the buckets are in front of you, and half behind... we simply draw only the ones that are in front of you.
so, the weather display in x-plane 10 contains about 7 resolutions, with each resolution distributing it's several thousand puffs into 27 buckets.
this way, we only draw the cloud puffs that are in front of you, at a level of detail that you can see at that distance.
THIS is what makes it possible to run at 100 fps in my mac with 1 video card with clouds visible.
THIS gives is the detail we want, with the long-range visibility we want, at the frame-rate we need.
BUT, if you ever want to file a bug report on the weather in x-plane 10, just be sure to indicate in your email to me if the problem is with the display, resolution, bucket, or puff. ;-)
austin
not a bad start to drawing clouds, eh? to make it of puffy little bits that are each 1 meter across? where each puffy bit is 1 polygon?
if a cloud is made of puffs, and each puff is a meter across, and each puff is 1 polygon on the video card, then that seems a decent way to build clouds in a flight sim, right?
right?
seems reasonable?
of course, the max visibility in x-plane 10 is 100 miles.
so, the scenery region is 100 miles north/south, 100 miles east/west, and goes from the surface to 45,000 ft.
there are 2000 meters in a mile.
there are 15,000 meters in 45,000 ft.
so, that is 100 x 2000 x 100 x 2000 x 15000, which is 600,000,000,000,000 cubic meters (do the math)
so, to render solid clouds in your flying area for x-plane 10, that is only 600,000,000,000,000 puffs of cloud for your video card to draw.
now, we want to draw these puffs at about 60 frames per second (so we leave some power to draw the stuff on the ground, too!), so that is only about 36,000,000,000,000,000 polygons per second of cloud puffs that your video card needs to handle to do a basic cloud rendering of 1-meter puffs across the sky.
as well, if there is one polygon every meter, and you can see for 100 miles up high, then you will clearly be looking thru 200,000 meters, and with one puff per meter, you will be looking thru 200,000 cloud puffs.
that does not sound so bad.
of course, when you are flying through these clouds, then that means that each pixel on your screen will be filled 200,000 times (once per puff of cloud, of course), and if you are running in the very low resolution of 1024x768, at 60 frames per second, then that means your video card will obviously be putting out 1024 x 768 x 60 = 50,000,000 pixels per second.
of course, each pixel is being filled 200,000 times. (once per puff by having one puff every meter for 100 miles)
so, any video card drawing this scenery would be filling 50,000,000 pixels per second 200,000 times, which is actually filling 50,000,000 x 200,000 = 10,000,000,000,000 pixels per second.
do the math on this yourself.
it is NOT that hard.
you just look at the number of cubic meters in the sky, assuming 1 puff per meter, and the number of pixels on your monitor, assuming a refresh 60 times per second.
so, to do the rather basic job of filling the sky with clouds whose puffs, each of which are a polygon, are one meter across (a reasonable size to see up close), your video card for x-plane 10 will simply need the following specs:
36,000,000,000,000,000 polygons per second
10,000,000,000,000 pixels per second
umm. ok.
but we have seen advertisements with words like 'awesome' and 'red hot' to describe the performance of video cards, so they must be able to handle this, right?
well, let's see.
the current bad-ass wicked-awesumm video card, the nvidia gts-450 (gts-450! with a name like that, it sounds like a MUSCLE CAR! it MUST be FAST!) can deal with:
700,000,000 polygons per second
11,200,000,000 pixels per second
do the research on this yourself.
it is NOT that hard.
so, with the video card with a name that makes it sound as powerful as a car, you would only need
36,000,000,000,000,000 / 700,000,000 = 51 million of them to do the polygons, and
10,000,000,000,000 / 11,200,000,000 = 892 of them to do the pixels.
so, the current video cards are one 51 million times too slow to do the job.
this is why, when someone emails me telling me that they WAAAAY exceed the minimum system requirements, so why can't they run x-plane at MAXIMUM settings, since their computer is a full 10% faster than the minimum system requirements, i have a good laugh.
if their computer was not 10% faster, but was instead 51 million times faster, then it might be fast enough to do a decent job of rendering the clouds we want in x-plane 10.
do you see now why i don't go krazee with excitement each time a video card manufacturer announces that they have a card that is 10% faster than the competition?
make it 51 million times faster and we'll talk.
so, how will we render these clouds in x-plane 10, since i do not want each person to have to buy and install 51 million video cards, since that is a slightly problematic system requirement?
the answer is a display of resolutions of buckets.
imagine this:
we have a HIGH resolution of cloud geometry. each puff is 1 meter across. BUT, those puffs only go out, say, 10 meters.
in other words, sure: you can see cloud puffs that are 1 meter across. but you can only see them up to 10 meters away.
you see the small, detailed puffs up close only.
that ain't many puffs. just 10x10x10, or 1,000 puffs. we can handle that.
then, for puffs that are 10 meters away to 100 meters away, we draw puffs that are 10 meters across!
how many puffs to fill that space?
well, we have 1 puff every 10 meters, we go out 100 meters in visibility for a moment, so that is 10 puffs north/south x 10 east/west x 10 up/down, for 1,000 puffs.
hhmmm...
we just covered 10x the space, but without using the exact SAME number of puffs as we did for the smaller area, by making each puff bigger.
sure, the bigger puffs are less detailed, but since they are farther away, you could not see the 1-meter-diameter puffs anyway... they are too far away to see when they are that small.
then, from 100 meters to 1,000 meters, we draw puffs that are 100 meters across.
we have 1 puff every 100 meters for 1,000-meter range.
that is that is 10 puffs north/south x 10 east/west x 10 up/down, for 1,000 puffs.
again, only 1,000 puffs.
BUT, we are covering a full kilometer! the better part of a mile!
how about we go out 100 kilometers???
each puff is, say, 10 kilometers across if drawn so far away.
that is 1 puff every 10 kilometers for 100 kilometers.
so that is 10 puffs north/south x 10 east/west x 10 up/down, for 1,000 puffs.
AGAIN!
NO MATTER HOW BIG THE SKY, EACH LEVEL OF DETAIL ONLY COSTS US 1,000 PUFFS!
7 levels of detail is plenty of detail.
we call each level of detail a 'resolution'.
so 7 resolutions gives 1-meter wide puffs of close, and huge puffs very far away, as seen from orbit!!!
and we wind up with: 7,000 puffs.
diddly-squat for a modern video card.
so THIS is the trick to the cloud-rendering in x-plane 10: we draw a LOT of SMALL puffs up close, and a FEW HUGE puffs out far away. this gives the detail you want up close, with the general cloud layout visible from 100 mile away. there is no need to draw tiny 1-meter-wide puffs 100 miles away: you could never even SEE them from that far away!
so, our DISPLAY of the weather uses about 7 RESOLUTIONS of cloud-puffs, with maybe a handful of thousands puffs at each resolution... a total result of maybe a small handful of tens of thousands of puffs.
why, you don't need 51 million video cards to draw that at all!
in fact, you could even use just ONE video card!
the perfect amount to fit inside your computer!
BUT, we are not done yet.
each resolution contains all the cloud puffs around you... including the ones BEHIND you!
we certainly don't want to tell the video card to draw the puffs of cloud that are BEHIND you. that would slow you down for nothing.
SO, we break each RESOLUTION down into 27 BUCKETS (a grid, in 3-d, measuring 3x3x3... EXACTLY like a rubics cube).
BUT, this is a rubics cube that you fly around INSIDE of, with each cube being a BUCKET.
of course, we only draw the buckets that are FRONT of you where can SEE them!
this doubles the frame-rate again, since maybe half of the buckets are in front of you, and half behind... we simply draw only the ones that are in front of you.
so, the weather display in x-plane 10 contains about 7 resolutions, with each resolution distributing it's several thousand puffs into 27 buckets.
this way, we only draw the cloud puffs that are in front of you, at a level of detail that you can see at that distance.
THIS is what makes it possible to run at 100 fps in my mac with 1 video card with clouds visible.
THIS gives is the detail we want, with the long-range visibility we want, at the frame-rate we need.
BUT, if you ever want to file a bug report on the weather in x-plane 10, just be sure to indicate in your email to me if the problem is with the display, resolution, bucket, or puff. ;-)
austin