Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Problems with small grass textures: flickering and too-near draw distance

Discussion in 'General Graphics' started by gecko, Jun 27, 2016.

  1. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    I've added some small grass textures to a terrain -- max/min width and height set to .1, since they are actually small spring flowers -- but I'm having two problem:

    1) They have a much shorter draw distance than other grasses. Very noticeable when moving around.

    2) Once I increased the terrain's wind speed from zero to one, each grass instance has a weird flicker -- even on the more distant which are not otherwise rendering.

    Here's a short video showing both problems: http://www.eduweb-labs.net/flowers.mp4

    This is on Unity 4.7.2 (project is stuck there due to lack of a few necessary features in Unity 5).

    On the flower texture, I selected and deleted that top-right area of each layer in Photoshop, and in the alpha channel, so there are definitely no pixels there.

    Anyone got any ideas/solutions?

    thanks
    Dave
     
  2. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    Do you have multiple foliage setup for this test? It's not on the flower texture that it's showing that white piece, its the other foliage texture in the atlas. You have to pad the top/bottom of each foliage texture so when it's atlased, it's not having UV issues.
     
  3. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Okay....but if I pad the bottom of other grass textures, then won't they be floating a bit off the terrain?
     
  4. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    Yeah, but you just do it a bit so that it's not bleeding over. You wont be able to tell it's floating either, I wouldn't think.
     
  5. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    That fixed problem #2 -- thanks! Any ideas about problem #1?
     
  6. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    Is it because of mip-maps? When it's so small, that the alpha takes over or something?

    What if you look around in wireframe, can you see the quad even though it doesn't seem visible?
     
  7. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    I thought of that and tried disabling mipmaps on the texture, no better. But here's a comparison of textured and wireframes -- yes, the flowers are there in wireframe view, but not rendering. Hmm, so what does that mean?
     

    Attached Files:

  8. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    Changing the mipmaps of each individual foliage texture doesn't do anything.

    Unity takes your four foliage textures lets say for example, and makes an atlas from them. Then creates the mip-maps from that atlas.

    What if you make a solid red foliage with no alpha for this little flower as a test, and see if you can now see red as far as the wireframe is shown?
     
  9. hertz-rat

    hertz-rat

    Joined:
    Nov 3, 2019
    Posts:
    71
    In case it helps anybody, I had this issue and enabling TAA fixed it. I would prefer for it to be fixed without TAA, but it is nice to have an option.

    How do you modify the texture atlas mipmaps btw? @mbowen89
     
    BrandyStarbrite likes this.