Menu

#492 Layered Texture Blending mode issues

None
open
nobody
None
5
2015-11-04
2015-10-21
Luke S
No

There are a couple of issues with how a Layered Texture blends info together, esp. with regard to bump mapping. There is some unexpected behavior regarding blend modes. Each example screengrab includes the texture settings that produced the render.

  • The upper texture (red) has a glossy surface, no bump map.
  • The lower texture (green) has a bump map.

The pictures, one at a time. Please go by the file names:

  1. Upper texture Overlay Bumps Add, fraction 1.0 I this case, the under layer's bumps are never calculated because the loop in GetTextureSpec opts out early when the texture layer is fuly opaque.
  2. Same textures, but with the upper texture fraction at 0.99. This result is what I would expect with (1) above.
  3. Both of those results come with the lower texture also set to Overlay (BA) What If I needed to blend that texture with another one below it? This! The blend mode of the lowest texture should not affect rendering at all, but here it is.
  4. What about changing the upper blend mode to overlay? I would not expect the bumps to show through this strongly. Artofillusion manual suggests that bump height in the areas covered by red should be ~ 0.001 of what it is when summing bumps.

(1) should be easily fixable by having LayeredTexture line 462 add a clause to not opt out early if layer mode is Overlay (BA)

(3) & (4) are not as easy. My prefered solution would be to re-write the entire method so that it builds the spec up from the lowest layer, otherwise we have to reference the blending mode of the layer above the one we are working on. I get the feeling that the method was written as it is as an optimization, but how much time is actually spent in this code? IE, is it worth the obfuscation?

4 Attachments

Discussion

  • Luke S

    Luke S - 2015-10-21
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -2,6 +2,8 @@
    
    
      - The upper texture (red) has a glossy surface, no bump map.
      - The lower texture (green) has a bump map.
    +
    +The pictures, one at a time. Please go by the file names:
    
    
      1. Upper texture Overlay Bumps Add, fraction 1.0 I this case, the under layer's bumps are never calculated because the loop in `GetTextureSpec` opts out early when the texture layer is fuly opaque.
      2. Same textures, but with the upper texture fraction at 0.99. This result is what I would expect with (1) above.
    
    • Group: -->
     
  • Luke S

    Luke S - 2015-11-01

    Been working on this a bit and would like clarification on how the over overlay mode is supposed to work. My understanding is that an overlay texture at 100% opacity will set all of the texture spec to match itself, except where there is transparency. Then, the color of the underlying layer shows through. Does this only affect the diffuse channel, or, for example, does the specular part also pass through a bit? Does this change if the overlay fraction of less than 100%?

     
  • Peter Eastman

    Peter Eastman - 2015-11-04

    The intended behavior is that, where the top layer is transparent, all aspects of the lower layer show through. A 100% transparent texture layered over another texture in overlay mode should look exactly the same as if that upper layer weren't there at all.

     

Log in to post a comment.