Using PagedGeometry for Clouds

Chaster

29-12-2008 01:47:59

This message is primarily for JohnJ, but I figure it could lead to good discussion too, so I'm posting it here.

First, my request: I was wondering if JohnJ could add an option to PagedGeometry to generate (& use) views of objects from below (in addition to the current views from side and above). The reason I request this is because I would like to use PagedGeometry for Cloud rendering for my project (which involves flying above/below/through clouds).

My plan is to create a macro-cloud out of many mini-clouds. Similar to how one can create a forest out of many trees. By using PagedGeometry, I am hoping that the clouds will yield decent performance yet still have a volumetric nature when viewed from close (as the camera flies through them).

Anybody else try this or think of this?

Chaster

jacmoe

29-12-2008 15:49:03

Cool idea! :)

JohnJ

30-12-2008 01:41:55

That's an interesting idea, and technically, it wouldn't be too hard to modify PagedGeometry to do under-side renders of objects for impostors, but I really doubt this would work very well. ImpostorPage (and BatchPage, for that matter) really weren't designed to render clouds or anything like that:

- ImpostorPage is not meant to handle an infinite variety of objects, like clouds, and would be extremely slow if you tried because it generates the impostor, saves it to a file, then loads it (generating mip maps) before use. This can take several seconds, and it not a real-time process. Every time the impostor system recognizes an object it hasn't used, it generates impostors for it, and this would be impossible to avoid (without huge issues) in a cloud system.

- BatchPage could work pretty well for clouds, but it depends on your implementation. If clouds are a bunch of puffy polygonal shapes in the sky, it could work. But if you're not trying to do cartoon-like clouds, you're probably going to be using some sort of particle system, which will require heavy use of custom shaders, etc. and possibly even dynamic vertex buffers. BatchPage is designed to render polygonal geometry, not volumetric or particle systems, and therefore would be less than ideal for this, to say the least.

Basically, my point is that PagedGeometry could be useful as a base for a cloud system, but I wouldn't even think about using ImpostorPage or even BatchPage for cloud rendering. These were designed specifically for rendering static trees, rocks, etc. and are probably the worst choice for cloud rendering. If instead you created some custom GeometryPage implementations specifically for cloud rendering, you could get a really nice cloud system working I think.

Chaster

05-01-2009 06:08:11

Hmm, perhaps I am not making myself clear.

I think the system would work quite well for what I have in mind. I think you are assuming that I would make large clouds which were single objects. Obviously, this would be a bad idea.

Instead, what I want to do is "build up" clouds from lots of "small clouds". Each "small" cloud would be a little puff of a cloud that is only perhaps a few hundred polys. These "puffs" would be designed so that if they were arranged together in a kind of loose "group" of puffs, they would look like one big cloud. Each puff is identical, but would be oriented differently in order to provide "variety" to the "group cloud".

I don't really see how this is different from putting a bunch of trees together to form a forest....

"cloud puff" = single tree
"one large cloud" = "group of cloud puffs" = a forest of trees..

Think of it like this: the "cloud puff" is like a dozen or so cotton balls stuck together in a semi-random shape. Now, take a bunch of these, rotate them randomly, and then place them so they overlay each other. That would be one "cloud". Repeat for other clouds...

I do not need my clouds to move. They would be static.

Would this not work?

Chaster

JohnJ

10-01-2009 07:00:17

You're right, I was thinking you meant a different type of cloud system. What you describe sounds like it'll work fine to me, although I don't know how effective the results will be (would be interesting to find out though).

Chaster

10-01-2009 07:26:47

You're right, I was thinking you meant a different type of cloud system. What you describe sounds like it'll work fine to me, although I don't know how effective the results will be (would be interesting to find out though).

I'd like to find out... So how about that optional feature for having paged geometry create impostors for views from below? :twisted:

Chaster

JohnJ

12-01-2009 04:31:15

I just implemented this feature but I haven't tested it yet (re-recompiling Ogre after changing DirectX SDK versions, fixing some DLL mixups). Hopefully I'll commit a working version soon.

Chaster

12-01-2009 04:53:38

I just implemented this feature but I haven't tested it yet (re-recompiling Ogre after changing DirectX SDK versions, fixing some DLL mixups). Hopefully I'll commit a working version soon.

Awesome... Dont'cha love recompiling Ogre after updating a dependency? (I've been doing that repeatedly for the past week... The latest SVN caused all kinds of problems for me... doh!)

Thanks for adding that functionality JohnJ! I'll let everyone know how my cloud experiment goes...

Chaster

JohnJ

20-01-2009 05:05:17

Ok, I've finished up this feature and committed the changes. Right now it's implemented with a define, so just remove or comment out the "#define IMPOSTOR_RENDER_ABOVE_ONLY" line in ImpostorPage.h, and it'll automatically start rendering impostors from above. Keep in mind that you'll probably want to double the IMPOSTOR_PITCH_ANGLES value from 4 to 8 as well since it's now rendering from above and below.

Chaster

20-01-2009 05:32:51

VERY COOL. Thank you JohnJ.

However, at the risk of sounding ungrateful, may I ask, will it be possible to use both the "normal" mode (i.e. for trees and other objects which are only seen from the side and above) simultaneously with the new "360" mode (for clouds)?

Chaster