General lighting question

Hi guys!



I have a general lighting question. See below and see attached image. If you want more detail on why I’m asking this question, you can read the context. :slight_smile:



Context:

Since I’ve read about the BioMonkey being dropped, I started implementing a version of the Forester I had into my own project. It’s a slow process since there’s a lot of stuff I’m completely unfamiliar with but I’m going somewhere. I am using the TerrainGrid system on my project, so it’s an extra challenge (for me at least). The steps I still have to do are using the DensityMap and using the planting algorythm, I haven’t tried those things yet. But I can now generate quads for plants and here comes my problem.



Image:

Sun rise



Problem:

I have quads to create some plants (grass in this case). The quads are all vertically aligned (they stand up right) and their orientation can differ. As you can see in the image, one of the grass quad is perpendicular to the sunlight (coming from the sun position) and the other is parallel to the sunlight. One of them receives a lot of light but not the other. At noon, the sun is high up in the sky, straight over the grass quads. The quads become parallel to the light direction and they are very dark. Which is not how grass is lit in the real world. The grass should receive about as much light as the ground.



Question:

How should I solve this problem? (Dark grass quads on light ground) Currently, there is no “ambient” light in my world, there is only the directional sunlight. Would the ambient light be enough to solve this issue? I have a feeling it might help, but since it should light up the ground as much as the grass, there will still be a huge difference between the grass and ground color. Of course I want the grass color to change along with the amount of light in the world, so unshaded MatDef is off the table. I’m not sure what is the best approach. I tried using the MaterialDefinitions found in the forester project, but lighting isn’t changing at all as the sunlight changes… So I guess I’m better off with the Common/MatDefs/Light/Lighting.j3md mat def. What do you guys think?



Thanks a lot for your time!

A common solution is to make the grass normals the same as the ground normals so that they are always lit the same as the ground point they are sitting on.

2 Likes

Hi pspeed!



Thanks a lot for the clue. I will try this. :slight_smile:

Thanks again pspeed! It works like a charm.



Screenshot taken around noon (sun is straight up so no shadows and grass is lit like terrain).

http://i.imgur.com/uhPns.png