Decals, UV-maps, color bleeding

24 August 2017 18:30
Hi there,
I just wanted to know wether this was the right approach.

Blender 2.78c with b4w_ce 17.6.

The following situation had to be implemented:

  • Placing a decal (PNG with alpha).
  • Maintaining a distinct diffuse color for the same material.
  • The diffuse color has to be accessible by the JS API (which is no problem with an RGB node).
  • The UV map is bigger than the texture. Parts of the map reach out of the texture image.
  • Later on the image texture will be replaced by a canvas texture.

  • This is the UV map:

    Consider the "logo" text inside a small square image. The map part representing the upper face of the cube is bigger than the image itself.

    …and this was my first attempt to "cut out" the decal from a defined diffuse color:

    It looked OK at first glance:

    but look at those bleeds when the face is in a flat angle from the view direction:

    It even bleeds into adjacent faces.
    That kind of looks like a mipmapping problem…

    Now, this is the current approach:

    It looks OK, but the "less than" threshold is found by try and error, and it cuts aways too much from the decal itself. I'm afraid that for workflow reasons we can't have the UV map less or equal in size than the texture. The texture itself is POT; An external Tool will place customer decals inside a fixed 1024x1024 PNG.

    Is this the right approach anyway?
    25 August 2017 12:32
    Is this the right approach anyway?
    Yes, it's right. Also chech the settings of Anisotropic Filtering and set it to 16x, it will also help to avoid mipmaping problems.
    Blend4web and that kind of thing.
    25 August 2017 15:58
    Ah, it was the anisotropic filtering which I had switched off in the viewer!

    After turning it on again the decal stancing did not need the hard "less than" trigger anymore, resulting in smoother texture edges.

    Thanks a lot!
    Please register or log in to leave a reply.