Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Terrain paint problem

Discussion in 'General Discussion' started by muhametaga07, Nov 13, 2019.

  1. muhametaga07

    muhametaga07

    Joined:
    Jun 6, 2018
    Posts:
    10
    Hi Guys,I want paint terrain with leaf but leaf texture have problem(I use PNG format) and I take this problem if anyone know this pls help me thx
    Photo example: Adsız.png
     
  2. muhametaga07

    muhametaga07

    Joined:
    Jun 6, 2018
    Posts:
    10
    and I used mip maps , It is worse :))
     
  3. powersupersport

    powersupersport

    Joined:
    Aug 31, 2015
    Posts:
    13
    What you're trying to do doesn't seem to be supported. At least not using the default shader provided for the terrain layer. You seem to have enabled the Alpha Is Transparency option, but the shader seems to ignore the alpha values of the texture (I assume for performance reasons).
     
    muhametaga07 and angrypenguin like this.
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    I assume you're trying to paint fallen leaves on top of dirt? Unfortunately that's not how terrain painting works. It just blends the colour values of each of the textures together.

    As @powersupersport says, the terrain shader doesn't support transparency. So it's just reading out the colour values, and ignoring the fact that some pixels aren't supposed to be visible.
     
    powersupersport and muhametaga07 like this.
  5. muhametaga07

    muhametaga07

    Joined:
    Jun 6, 2018
    Posts:
    10
    I see some game there are on terrain leaf ,stone, garbage ,I think that of only 3d model I will try with 3d model thx for help guys good game good works
     
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,519
    It can be models, decals, quads with textures on them... a custom shader with a leaf layer built in...

    Think about it this way. Making a terrain is just a specialised way of making a 3D model. You're applying a texture directly to that model, where it seems (from the texture) that you want a separate texture shown on top of that 3D model.

    As a first pass approach, try this:
    1. GameObject -> 3D Object -> Quad
    2. Drag your leaf texture onto that quad in the scene
    3. Change the Quad's material's Rendering Mode from "Opaque" to "Transparent"
    4. Copy, past and move as desired.

    This is a very simplistic approach, and may not perform well at scale depending on your use case, but hopefully that'll get you started.