- Home /
Weird "ghost" texture issue with Transparent Texture/Shader
I have an issue with a transparent texture where when viewed at certain angles and distance some "ghost" texture appears on the caps of the cylinder. This happens in both the Game and Scene view.
The ghosting seems to be partially cured by increasing the Aniso Level
on the texture import settings but doesn't solve the problem at far distances. The problem gets worse as you zoom out (see second image) although it is much better with aniscropic filtering at 9 (full filtering). I have no idea if this is the root/actual problem because aniscropic solves blurriness at shallow angles it just seems to mitigate the ghosting a bit.
Note: Texture.anisoLevel levels pertain as so:
1: No filtering
9: Full filtering
I understand that this may be a LOD, MIP, or some other quality setting issue but I just have no clue. This problem is also weird because the caps (top, bottom) are not textured at all and those UV's are basically out of the picture. Notice that when the caps are selected that the UV's are not projected. If the texture touches those edges it does paint the surface but the texture used clearly doesn't reach the top or bottom.
I am using a custom shader based off of the "Transparent/Diffuse" shader which still has this same issue. You can download the Unity Shaders source which includes "Transparent/Diffuse" here
Also as a tangent... If anybody knows how to make a texture auto-tile across many objects of different size that would be great. I have asked before but wanted to mention it again.
To make different size cylinders without stretching I think I will have to procedurally generate a cylinder mesh with the appropriate amount of radial segments based on scale. Here is a start someone made (normals are kinda messed up and the caps are a bit weird). But then I would still need to create a new material for every tilingX variation of the material.
@nesis Disabling Generate $$anonymous$$ip $$anonymous$$aps
solved the issue at every angle and distance so I think you were spot on. I had a suspicion but I didn't know how to mess with it or knew it was affecting my texture. Other settings did lessen the effect but no combination made it go away besides just disabling it.
Just to make it clearer, The cap UV's are mapped but they are on the edge of the map meaning that the texture I am using shouldn't be touching it (maybe mip map textures were). I also just scaled down the UV's so that none are touching the edge but it had no effect on the ghost UV's.
$$anonymous$$ake an answer so you can get some more credit :)
$$anonymous$$y suggestion: get a cylinder mesh without circle bases; you will save unnecessary fills and also get you rid of the problem
@Panga$$anonymous$$i So you recommend the cylinder type on the right? http://i.imgur.com/cd5gfah.png - I will model one up and test. EDIT: Just tested both of those configurations and they both have ghost texturing: http://i.imgur.com/b0Jbwvf.png
EDIT2: Sorry Panga$$anonymous$$i, I misunderstood you. I have deleted the caps (top, bottom) and as expected the ghosting is gone even with mip-maping and Aniso level 1 or 0. Thank you for the suggestion as having the mips makes it more performant. http://i.imgur.com/$$anonymous$$bjo6Ak.png
Answer by nesis · Jan 22, 2014 at 05:34 AM
I suspect you're seeing the result of mipmapping. In case someone reading this doesn't know, mipmapping is an automated reduction in texture detail when you view it on a surface from a distance or at a shallow angle.
Disable mipmapping on your texture asset and you should be fine.
I suspect the tris on the caps have UVs (otherwise you'd be getting errors reported by your material in the console). I also suspect your cap UVs are outside the UV map you've screenshot, rather than being deleted? If that's the case, Unity will tesselate the texture across to where those UVs are and will map them anyway. The weird ghosting is probably just low-res mipmaps bleeding colour across to those UVs.
To disable mipmapping, select your texture in the Project tab, then in the Inspector tab, change its Texture Type to Advanced. Some new options will appear in the Inspector tab, amongst which will be Generate Mip Maps. Fiddle with those options - including turning them off - and see if that fixes it.
Answer by AlanMattano · Feb 13, 2019 at 09:10 PM
Mipmapping reduces texture detail size when you view it for distance or at a shallow angle.
Aniso Level value move back in distance when this low-res occurred. Adding Aniso Level the blur reduction in texture detail is done farther back, you get more quality and is more computationally expensive.
Your answer
Follow this Question
Related Questions
Assigning UV Map to model at runtime 0 Answers
UV Mapping for 2D Meshes with 3 Vertices Only 1 Answer
How to rotate a texture on plane 45 degrees 0 Answers
Can I have multiple/alternate UV textures for one mesh in a single file? 0 Answers
How can i choose the UV than i want to use with each Texture of a material ? 1 Answer