PagedGeometry and Caelum

Netskate

24-09-2008 10:05:42

Hi all, another noob question :oops:

I have integrated Caelum into my project, that manages the ambient light of my game. when night fall trees become black (ok), but impostor trees remain green...

I think because they are 2D and don't have any type of material.
The result is that looking far, you can see green trees.

Have you any idea, how to solve this problem?

thanks

JohnJ

24-09-2008 16:02:13

Unfortunately this is one of PagedGeometry's main lacking features - it doesn't support dynamic lighting on impostors. You could modify the vertex shader used by impostors to darken them along with your day/night cycle, but it still wouldn't be proper dynamic lighting.

Eventually I'd like to add full dynamic lighting, so I will definitely plan future versions (like 2.0+) of PagedGeometry with this as a central feature, but right now PagedGeometry is limited to games without day/night cycles, at least without modification.

Netskate

24-09-2008 16:20:03

...

You could modify the vertex shader used by impostors to darken them along with your day/night cycle, but it still wouldn't be proper dynamic lighting.



It's not a bad idea, impostor are showed up at a long distance from camera, so if they are darken not at the same level of light (in night) it isn't a big problem.

How can I do it? some little and more detailed help would be very appreciated.

JohnJ

24-09-2008 18:30:10

I can't really tell you exactly how to do it without doing it myself unfortunately (and if I did it myself, the technique that works for you wouldn't work for others unless I spent a lot of time on "proper" dynamic lighting). Unfortunately it's literally impossible to do a "proper" solution in the current version of PagedGeometry without removing support for fixed-function cards completely.

Anyway, I'd recommend you study ImpostorPage.cpp/.h and StaticBillboardSet.cpp/.h. You should be able modify StaticBillboardSet so that it can be shaded the color you want. The easiest (but least elegant) way would be to simply add a static function that sets a color value that will be applied to all impostor billboards. The billboard shader will probably need to be modified to show the changes.

Netskate

24-09-2008 18:43:29

thanks, I'll work on this in this day, if I make progress I'll make you know it.

:)

NoodlesOnMyBack

25-09-2008 02:47:54

Im interested about this topic too, but i didnt researched properly how to do it.

A)Just to discard the posibility, can i just pass a parameter with the ambient light values of the scene to the material of the trees or grass? Is this possible without too many problems?

B)I want to add Depth Shadow mapping to the trees, did anyone did this already?