I have a game that I have been developing for a long time, I made an endless road and as I progress, the colors in the taillights of the vehicles in traffic are distorted. I tried all kinds of attempts and failed, what do you think is the problem?
Distorted in what way? Do you mean the player car or the other cars? I can see them in the video, but I have no way of knowing what color they’re supposed to be.
I mean other cars, if you look at the taillights, there are distortions. Nothing happens when you start the game but after 5 minutes of play it starts
When I make the graphics api vulkan, the problem disappears, but this time the fps drops, so I use opengls3, this time this problem is happening.
I still don’t understand. They just look orange to me. Are they supposed to be red?
no, sorry for my english. The problem is not the color, the model is tingling, it is not visible as a whole, can you take a closer look?
it looks like there is a mesh problem
I think I see what you are talking about. There are dark spots that flicker.
I’ve seen similar things with writing my own shaders when I make an error. Usually it something like a floating-point overflow/underflow, divide-by-zero, or negative number when there shouldn’t be. What type of shader are you using?
Possibly? Maybe the mesh is casting a shadow on itself or something weird like that. Check and make sure your mesh has no overlapping-faces.
i am using standard shader, I guess there are overlapping faces. i will check it.
I can’t say for certain. I’m only guessing at various possibilities.
Are you using emission for the lights? If so, maybe try using an unlit material instead. Also, disable HDR if you’re not using it. Also, try disabling post-processing if you have any. See if you can isolate the source.
You said this was an infinite game, and the problem starts occurring after 5 minutes? Could it be precision issues? For the camera and objects go very far from the origin? If your car’s position is like 100,000 units away from the origin, there could definitely be glitches.
yes, everything you say is correct the camera is going pretty far from the origin. Then i have to move the maps continuously at the center of the origin, i will try and post the result.
Yes, this is also possible. Once the position goes past 10,000, or so, try resetting it to 0.
HDRP has built-in support for camera relative rendering, but with URP and BiRP you are probably on your own.
https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@8.0/manual/Camera-Relative-Rendering.html
Also, try disabling post processing. See if that has anything to do with it.
Edit: oops I already suggested that two posts ago. I’m too young to be senile!
Seems like precision issues stemming from vertices very far away from the world’s origin. This makes the vertices “jitter”, and could cause clipping if there’s any other surface nearby.
Typically, you’d want to re-center the scene periodically, or even make it so that the player’s car is static and everything else moves around him.
Thanks everyone for the help here, I fixed the problem by moving everything to origin point, when the camera is 200 units away from origin I reset everything back to origin. Problem has been solved.