[SOLVED] Shining light

Hey guys,

can please someone explain me why is this happening?

As I’m doing a game about cars, I need a funcional headlights for the cars which will be used at the night time. Somehow I have added a SpotLight which is “following” the car position and it shines in front of the car. BUT there are mystical places on my map. As I’m traveling with car, there are places where the SpotLight is loosing its lightness. I don’t know if is it, but it looks like. Or the ground may need more light to shine? And there is another place, where the ground is shining nice and you can see the road. Ground is made of Box with MatDefs/Light/Lighting material and textured by (only) diffuse map.

Here I add images how lightning looks on different places.


This is how I want it to look.


Here the spot light lose its light. (I only move forward between making these images.)

I know it’s a usual thing from the jMonkey Mystic book. I would like know why is it happening.

Does this happen at certain rotations by any chance? E.g. it’s fine one way but not worsens as you turn 90 - 180 degrees?

Or is it lighter at the edges and darker in the middle of that quad?

As I had said, it depends on the location on the ground. Rotation of the car doesn’t have effect on the shining. You can go straight through map and the light will bright and dark again.

I will check the edges and middle part. I’m not sure now. But probably that’s the thing.

Is your geometry big giant triangles/quads?

Maybe it needs to be subdivided.

2 Likes

Or what could also be is that you have different ambient colors set on the map so some part of it gets ambient lit and some other part doesn’t?

Since you say you use the box mesh you could use lemurs MBox as a direct replacement and specify slices.

1 Like

@pspeed Yes the map is made from big 100x100 boxes.

@Darkchaos All ambient lights have been detached during the tests.

@jayfella Thank you, MBox do it the best way. When I set up 50 slices it became as I would like it. Below is attached picture how the spot light is lightning.
When previous using the Box, light shines at maximum when car was at the one of corners of the square. And in the middle it was lighting bad.


The whole map is now lighted as in the picture.

2 Likes