Flashing objects textures

Hi everybody,

I’d like to know why objects textures are flashing on my Unity project.
To show you an example, i have made this video :

I have a day/night cycle system in my game (Time of day)
I think its about shadows but i don’t really know how to totally fix this :confused:
Thanks for your help!

Up.
When I disable shadows, the problem is fixed. But how i can do with shadows ?
Hope u can help me

A couple of questions.

How far from the world origin are you?
If you’re very far from the world 0,0,0. try re-positioning everything so you’re much closer.

How big is the “world”?
I assume there’s a water plane mesh that’s set to receive shadows that’s quite large. Try disabling shadows on the water mesh.

Is anything in your scene moving apart from the player? Or is there some mesh attached to the player that’s offset very far from the player’s position for some reason?
Does the problem go away if those objects are disabled / removed?

What’s your shadow distance set to? Are you using close fit or stable fit cascades?
The two are set in the Quality settings. If you’re using close fit, try stable fit. If the shadow distance is very far (multiple hundreds) bring it closer to less than 100.

You appear to be using two directional lights w/ shadows, do they both need to exist, and do they both need to cast shadows?
Generally speaking only one directional light should have shadows enabled at a time as the second light’s shadows will be of significantly lower quality.

What are the bias settings on your directional light(s)?
Try playing with the bias and normal bias, though that won’t cause the weird shifting you’re seeing unless those bias values are themselves being animated for some reason.

1 Like

Hi! Thanks for your answer,

I’m very close to the 0,0,0 point. My map size is 2048x2048. I only have a terrain with generated objects like vehicles, houses, trees… But i have only 10-15 generated gameobjects at least.
My shadow distance is set to 20.
I have removed one of the directionnal light.
Bias is set to 0.05 and normal bias to 0.4

I don’t really have any other suggestions. Really, honestly, some errant mesh sitting way, way far away (or perhaps more likely, an errant vertex or tri causing a mesh’s bounds to be way, way too big) is the only thing I can think of that might cause something like this.

You could try setting your project view to show all meshes “In Assets” and arrow keying through them one at a time. The inspector window preview automatically zooms to position the mesh’s bounds such that it fills the view. Most objects will appear nicely centered because of this regardless of their scale. See if you find a mesh that appears to show nothing at all, not even a mesh wireframe, you probably have a mesh with an errant triangle and thus a messed up bounding box.