0
À l'étude

float3 target lerp inputs need cast

Matt Smith il y a 8 ans mis à jour par Freya Holmér (Developer) il y a 8 ans 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.

Solution

Solution
À l'étude

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.

Solution
À l'étude

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.