Onday our artists complained that vertical projected decal pixel shows stretching artifact like below photo.
At first, I thought that multiplying dot(worldnormal, float(0, 0, 1)) to opacity could resolve this issue so that vertical face does not receive decal. But it turned out I was too naive.
Deferred decal material cannot read world normal gbuffer data while it writes normal to gbuffer. So I could use world normal to determine if it is vertical face.
I almost frustrated but soon found the solution. We actually can reconstruct world normal from depth buffer using ddx/ddy instruction.
world normal = cross(ddx(worldposition), ddy(world position) |
Vertical face does not receive decal. |
what is the first node ?
답글삭제Absolute World Position
삭제