Description

Materials that make use of the analytical derivatives path to avoid hardware derivatives can still generate derivative operations on texture samples when the shading model has a custom data pin and that pin includes a texture sample.

This appears to be similar in construction to [Link Removed].

A chunk of parameter data is computed in CalcPixelMaterialInputsEx, which allows either a hardware or analytic derivative path. This means samplers on common material parameter pins, such as base colour or roughness, will not use hardware derivatives.

The GetCustomData0 function used by a subset of shading models copies code from CalcPixelMaterialInputs. This also leads to multiple VT feedback writes in the case of the VT sampler issue that already exists. In this case, as the generation takes from CalcPixelMaterialInputs without regard for the potential that CalcPixelMaterialInputsAnalyticDerivatives may be taken instead, the code ends up as a TextureSampleBias which relies on hardware derivatives. For reference, the analytic mode uses TextureSampleGrad with pre-computed derivatives.

It is possible to compute these derivatives analytically in the shader and manually sample with a grad sampler. This has the side effect of removing hardware derivatives from all code paths, however, even when they are acceptable.

The potential impact of this issue is that affected materials will not behave with Variable Rate Shading.

Steps to Reproduce

1. Connect a texture sample to the base colour of a clearcoat material.
2. Apply in level and visualize with the Nanite NoDerivativeOps viewmode. It will appear blue as there is no derivative used. This is because the sample will converted to TextureSampleGrad and will be using analytic derivatives.
3. Apply the same sampler to the clearcoat pin.
4. Apply, and the object will now be red. This is because the non-analytic TextureSampleBias version has been included in the GetCustomData0 function, despite analytic derivatives being computable for this sampler.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-268303 in the post.

0
Login to Vote

Unresolved
ComponentUE - Rendering Architecture - Materials
Affects Versions5.55.6
Target Fix5.7
CreatedApr 8, 2025
UpdatedApr 14, 2025
View Jira Issue