Hi, I’m having a problem… :?
I have this 3D environment, with collision on the floor, ceiling and walls. Whenever I run this on machines with ATI cards, the collision mesh will become a flickering, visible item. Especially whenever I come too close.
I do not have the problem on other cards.
In my office I have two machines with ATI-cards;
ATI Radeon 9800 Pro
ATI Radeon Xpress 1250
Does anyone know about this, and wether or not a solution exists? Is it a bug? Have I forgotten something?
Please help me out, because it really looks bad…
First thing, why the collision mesh is visible at all? (assuming it’s a separate object from the “mesh for rendering”, and not just “my level mesh”)
Now, to the actual problem. Some Radeon cards (specifically, Radeon shader model 2.0 cards, i.e. Radeon 9500 to Radeon X600) have some weird inconsistencies in how they render&clip the geometry in fixed function pipeline vs. vertex shaders.
This only affects polygons that are clipped by the near plane, and larger polygons are affected more. And this only affects polygons that are rendered with both the fixed function pipe and a vertex shader. In Unity, most often this happens with pixel lighting: ambient or vertex-lit passes use fixed function, and pixel lights use vertex shaders.
Unfortunately, right now I don’t know of good solutions, save for “make the polygons smaller and hope it goes away”. Or if you never have vertex lights (all lights are pixel-lit), write a shader for the mesh where ambient pass also uses vertex shader.
I’m not sure I understood the first part, was it a question for me? Well, my collision is a seperate mesh, to save me from having to collide with all the visible objects. It´s simply just a big mesh, with very few polygons. I have removed the mesh-rendere component from this object, so it should be invisble.
But it´s not on ATI cards. Well, mostly it is, but becomes visible sometimes. Maybe at the near clip plane, you might be right on that.
I will try to make the coli-mesh more dense, maybe it´ll help. As for writing a specifik shader, this most be a job for one of my collegues
An update: After walking around in my environment very slowly, I realised that it wasn’t my collision which became visible sometimes, but simply just all my objects. It just happen more often when I come near the walls, so I assumed it was it.
So now my problem is much bigger. Faces becomes dark grey whenever they come too close to my camera. And only on Radeon cards…I’m not sure how to solve this, because I can’t make my objects more dense (they are already too high-rez), and I can’t write a new shader-version of all shaders used in this scene…what to do, what to do…
Don’t use pixel lights (change all shaders to VertexLit, or all lights to render in vertex-lit mode).
or:
Bite the bullet and write custom shaders with ambient passes implemented as vertex shaders. How many different shaders (not materials) are you using?
or:
Wait until we implement transparent ambient/vertex lighting emulation in vertex shaders. This would solve “some radeon cards clip in weird ways” issue and several others. The trouble is, full vertex lighting in vertex shaders is quite hard to do.