f3d icon indicating copy to clipboard operation
f3d copied to clipboard

--texture-base-color with opacity and depth peeling is not correct

Open mwestphal opened this issue 3 years ago • 5 comments
trafficstars

Describe the bug Using a texture base color with opacity and depth peeling, without setting --opacity, cause a wrong rendering

To Reproduce Steps to reproduce the behavior:

  1. Open the file using f3d --dry-run WaterBottle.glb --texture-base-color=/home/glow/f3d/src/testing/data/albedo_mod.png --depth-peeling --geometry-only : albedo_mod

  2. wrong rendering:

wrong

  1. Using the following provide a correct rendering: f3d --dry-run WaterBottle.glb --texture-base-color=/home/glow/f3d/src/testing/data/albedo_mod.png --depth-peeling --geometry-only --opacity=0

Expected behavior Correct translucent rendering, like this: right

  1. The --opacity parameter is not taken into account at all, apart from enabling translucentsy, it should multiply.

mwestphal avatar Jul 10 '22 18:07 mwestphal

Indeed. This texture is RGBA, with an alpha channel containing translucent pixels. But VTK isn't aware the object is translucent. My suggestion is to force the translucent flag on the actor if the color texture has 4 channels.

Meakk avatar Jul 21 '22 16:07 Meakk

Sounds like a good approach

mwestphal avatar Jul 21 '22 18:07 mwestphal

Looks like this should be set inside VTK, not in F3D, but maybe I'm mistaken.

mwestphal avatar Jul 23 '22 12:07 mwestphal

Added a note a about the fact this is not multiplied.

mwestphal avatar Aug 01 '22 11:08 mwestphal

See #333 for more info

mwestphal avatar Aug 01 '22 11:08 mwestphal