Using Cookies on Lightmapped Terrain

… I guess my question is… is that possible? I have set up a test to see if I can animate a cookie over a terrain to simulate high clouds casting shadows on the terrain, but I can only get this effect if the terrain is set to pixel lighting and not lightmapped.

We have a custom lightmap on the terrain to give the feel of light and dark areas, and I would like to find a way to blend the cookie with that map. If that is not possible, any ideas for work arounds?

Thanks,
Matt

Yes, you can use a lightmapped-shader and a directional light with a
cookie. when you move the light, the “clouds” are moving.

Take a look at the components-reference…(see link below).

Jens

Jens… thanks… I have had success using the spot/direction light with a cookie on a mesh object that has a lightmapped diffused shader, but my question was regarding terrains specifically.

The photos here depict a cube mesh with a lightmapped diffuse shader which blends properly when the distance light with the cookie hits it… but when I change the base terrain lighting from “pixel” to “lightmap”, I don’t get the same blending effect. Since my terrain is built from the editor and not a mesh… I’m wondering if it is handled differently in terms of lighting.

Thanks,
Matt


I checked, and, ehm…, yes you are right! Pixel-Lights don’t seem to affect lightmapped terrains.

I didn’t know that, actually, as I am working on an indoor-game and
don’t use the terrain-engine. So I thought this was a simple.
Sorry for my silly advice.

What about a simple blob-shadow projector in orthographic mode? Or an array
of them?
Projectors do work on terrains.

Jens

Oh ya… projectors… doh :). That is getting me much closer to where I want to be! As long as I keep the Field of View wide enough to cover the entire terrain, it doesn’t present a problem (if not it starts breaking apart at the edge of the FOV.

Since these will be high level clouds that will move slowly for a subtle effect, I can probably just translate the projector to give the feeling I’m looking for, but my original thought was to animate the UVs of a tiled texture so I could keep the light/projector in one place. Here is where my knowledge ends (may be a FX/Projector Multiply shader thing)… but for some reason it won’t let me tile the Cookie Texture under the placement properties of the Shadow Material Component for the projector (either in ortho of perspective modes).

Either way, I think I can get what I need from this… thanks for the insight regarding projectors.

Matt

You’re very welcome! :smile:

…Mmh. Instead of one very big projector (which may be too small for your terrain when moved) you could use one projector for each “cloud” and move them in slightly different speed so you get a more natural effect… Then you could
use the same projectionangle as your sun…

Anyway…I Would like to see the final result some time! :lol:

Thanks Jens