no shadows in terrain...

I´m testing out the new terrain editor, everything seems to be working just fine but my trees are not casting shadows at all, I checked the terrain demo on the gallery and I don´t get shadows on that either, I do get shadows on the light and shadow room demo.

I´m using a quad core mac pro with a geforce 7300gt and 3GB of ram.

ohh and I got unity 2 pro.

AFAIK (and I hope I’m wrong) trees in the terrain don’t cast shadows. The only type of light that effects a terrain (including all the trees in a terrain) is a directional light and a directional light can’t be used to cast a real-time shadow. Point lights and spot lights can be used to cast real-time shadows, but unfortunately they don’t effect the terrain. I’m guessing these capabilities will come in future updates.

What I wish 2.0 could do is to allow us to export a lightmap and splat map, touch it up in a paint program, then re-import it into Unity.

I really hope the real-time shadows problem ( not casting on terrains ) will be fixed in the future…

IIRC, I believe UT said this would be something they will add in a future update… not sure when though.

I imagine it would be fairly easy to fake up a lightmapping engine for terrain that handled directional lights (raycast, yadda yadda).

ummm… directional lights can be used to cast realtime shadows… i’m using them as a sun and fills in our games. they work fine… and have less off a performance hit then spot and point lights.

cheers.

a method I read on the beta list for creating lightmaps of your terrain was to take a screen grab from top down with orthographic turned on. Then use this as a reference in photoshop to create your fake lightmap. then apply this to you terrain.

cheers.

^ What he said. Directional lights are actually perferable for real-time shadows. Point and Spot lights cause a bigger processing hit for shadows.

Lightmapping a Terrain with Directional lights and shadows is already possible… anything with a collider on it casts shadows (mesh colliders are obviously preferable for it to look good when calculating the lightmap). Trees however do not yet cast shadows into the Lightmap.

As thylaxene said there are ways to hack shadows from trees into the lightmap… I used the “top down screen grab” method for the Island Demo and I think it looks pretty good in combination with the shadows from other collision objects in the scene. A proof of concept raster based lightmapper was also cooked up for getting trees to cast shadows for a UT in house project, but it’s far from ready for prime time use :wink:

Ethan

Another (obvious) approach is to use a different texture under vegetation. Not only can it be darker to simulate shadows, but it looks much more realistic. This assumes you don’t need/want hard shadows.