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. How can we improve our URP documentation to cover your needs? Give us your feedback. Take our survey and let us know.
    Dismiss Notice

Vertex Alpha for Texture Blending

Discussion in 'Shaders' started by Rook3D, Oct 9, 2011.

  1. Rook3D

    Rook3D

    Joined:
    Sep 27, 2011
    Posts:
    19
    I'm trying to 'soften' the edges of an object with two textures ( rock grass ).

    I've come across a few posts about using Vertex Alpha with the proper shader to blend the textures, here is one of the posts :

    http://forum.unity3d.com/threads/44749-Vertex-Paint

    I've tried both of the shaders posted by Jessy - RGB RGBA, and both produce the same result :



    The Alpha seems to be being picked up, but the textures themselves don't seem to be being fully applied - possibly only the first color pixel? ( The dark color is actually a very dark green ).


    So I'm wondering what the problem is - is it the shader, or perhaps something to do with the texture import setting...

    Also, I've noticed that those shaders don't seem to be affected by lighting ( I am a shader novice! ).

    Does anyone have any advice / other shaders for this? - is there an easier way of softening / blending the borders of two textures ( without UV mapping ) ?
     
  2. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    You need to UV map the model to see a texture. Otherwise you'll only see the lower-left pixel of the texture, everywhere.

    Surface Shaders are probably what you need to learn. Lighting is complicated to put in without them.
     
    Last edited: Oct 9, 2011
  3. Rook3D

    Rook3D

    Joined:
    Sep 27, 2011
    Posts:
    19
    Thanks for your reply - I was thinking the textures would just be tiled.


    I see - I'm hoping that means what I'm interested in, is actually possible! ( It surprises me that it seems so uncommon... )
     
  4. Rook3D

    Rook3D

    Joined:
    Sep 27, 2011
    Posts:
    19
    Just for anyone else who happens across this thread in need of blending texture edges - here is another thread I found with the a good implementation of the shader I'm looking for :

    Blending 2 materials by vertex alpha

    Thanks again to Jessy!

    FYI: Jessy does mention some problems and drawbacks with it, so I guess it's not a perfect solution ( if anyone ever has any better solutions, please post them! ).

    For reference, here is a comparison of what I'm trying to achieve ( Blended vs Hard Seams ):



    ( The textures are tiled, so that the objects can be any size. )
     
unityunity