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

Generating UV bleed at edges?

Discussion in 'General Graphics' started by FuzzyQuills, Mar 15, 2017.

  1. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Hey all. :) Currently I have a raytracer for lightmapping procedural scenes working. Except...

    I have no clue how one is supposed to add a texel border around sections of the UV islands to eliminate bleeding, of which is destroying edges of my lightmap shadows. How would one do this to a Texture2D?

    Other than texel bleed in that department, (with mipmaps off) my system's basically complete.
     
  2. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Bumping, as I really need this solved, and I can't really find anything anywhere that can explain the basis of what I should write to do this.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Dilation is the term you want to search for. This page (the first one that shows up in my Google search for dilation shader) is for UE4, but the concept can be applied to Unity.
    http://shaderbits.com/blog/uv-dilation/
     
  4. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    THANK YOU. I couldn't for the life of me figure out the official term. :D
    And yes, it's UE4, but that code is specifically what I'm looking for!

    EDIT: I can now say that UV dilation on the CPU in my script is working. (Because it's a shadow map, it's a little hard to tell at the moment) :) Thank you so much!
     
    Last edited: Mar 27, 2017