Shadows in terrain engine

Im planning to do the following: draw a ray from the sun to every vertex on teh terrain, if the ray collides with the terrain, give the vertex shading of 0, else 1, then average out the colors… would this produce a decent effect or do i have to go for full on lightmapping??

Couldn’t you just take the dot product between each vertex normal and the light vector? Or is that just another way of saying “casting a ray”? Heh heh.

Are you doing this in realtime or precalculating?

What’s your ICQ #? Mine is 4868195. I’ve seen other posts of yours which inclines me to believe you’re working on something similar.

Care,
Chris

Im working on a flight sim kinda like terminal velocity if youve ever seen it… Yeh, basically what im tying to achieve is simple radiosity but im not lightmapping the terrain, im simply giving the verteces of the terrian a shading depending on whether the sun is visible from the vertex or not. And yes, i am pre-calculating the values…
BTW, ICQ: 7067491

[This message has been edited by MrShoe (edited 12-25-2001).]

A dot product is enough if you want to shade the terrain with respect to the slope. But if you want hills to cast shadows, as I understand MrShoe wants, a dot product isn’t enough. A dot product is “local”, and does not care about the surrounding environment. Casting a ray towards the sun and see if it hits the terrain on it’s way will create very nice shadows.

Ive just done this very thing (casting a ray from sun to vertex of the land) and used it to calculate the ground colors, instead of lightmapping the ground.

You can see the result I have in this shot : http://rixed.free.fr/fcoa_ss0.jpg

I guess the result depend on the level of tesselation of your ground. For me, its quite good at hight altitude. Without textures on the ground, the result reveals the vertexes at low altitude.(but textures smooth the result so that one can’t see the vertex).

Note : I do this for a flight engine, also :slight_smile: