0
W trakcie analizy

float3 target lerp inputs need cast

Matt Smith 8 lat temu Ostatnio zmodyfikowane przez Freya Holmér (Developer) 8 lat temu 1

I'm looking at some SF-generated code on PS4, where the resolution of ambiguity is pedantic:


float3 node_5569 = (lerp( (float3)node_5259, _FresnelGradientTex_var.rgb, _UseFresnelGradientTex )*_FresnelTint.rgb*_FresnelStrength);

...

outEmission = half4( lerp( 0.0, node_5569, _FresnelisEmissive ), 1 );

On PS4 this causes a warning since there's no lerp with the prototype (float, float3, float3).


I'm fixing these manually by explicitly casting:


outEmission = half4( lerp( (float3)0.0, node_5569, _FresnelisEmissive ), 1 );

but it's a bit of a pain since any new shaders need the treatment.

Odpowiedź

Odpowiedź
W trakcie analizy

A halfway solution that skips the manual editing is to use the append node to append the float to itself three times, before going into the lerp node.

Odpowiedź
W trakcie analizy

A halfway solution that skips the manual editing is to use the append node to append the float to itself three times, before going into the lerp node.