Download

Decal Derivative node in material, where is it?

I’m currently trying to implement the 2x2 fix that is explained here:

***Decals may have 2x2 pixels block artifacts on edges as shown in the screenshot below. ***

*This is where the node “Decal Derivative” comes in. This node must be used carefully as it has a very big performance impact. It returns the derivatives on the X and Y axis of the decal’s default texture coordinates necessary for anisotropic texture filtering, but computed differently than using the hardware’s default and DDX/DDY nodes, to avoid this 2x2 pixel block artifact. *

dfbef631c703a2ad4782b768b154889383d38e98.jpeg

How do I add this decal derivative node? I don’t see it anywhere to add it.

I’m trying to fix this problem:

a94dd30fcf2f523f78799c6be6c6d02ccda8dcad.jpeg

The impactPoint and impactNormal are from the landscape. The lineTraceByObject only hits landscape, but for some reason it’s putting the decal on that static cylinder.

Code:

b72b77d014a2cec57d2152de5ef33f3af205df0a.jpeg

keyword - how to place decal landscape dynamic hit result impact point normal

I’ve had the same problem, not finding that ‘DecalDerivative’.

HOWTO:

  1. Press ‘Space’ in the material and search for the ‘DecalDerivative’
  2. Select the ‘TextureSample’ node
  3. In it’s properties under the ‘Material Expression Texure Sample’ (right next to the place where you can set the texture) set the ‘MipValueMode’ from ‘None’ to ‘Derivative’
  4. The DDX/DDY properties will appear, and connect your ‘DecalDerivative’ node outputs there

I hope that somebody will find this useful.