unity shader 关于clip 溶解

小于0才会被clip掉
if(value < 0)
discard

clip(smoothstepResult31 - 0.5);

float noise = SAMPLE_TEXTURE2D(_Noise, sampler_Noise, i.noiseUV).r + 1;

float temp_output_18_0 = ( _Dissolve * ( 1.0 + _Edge ) );
float temp_output_22_0 = ( 1.0 - _hardness );
float vertexToFrag27 = ( ( temp_output_18_0 - _Edge ) * ( 1.0 + temp_output_22_0 ) );

float vertexToFrag26 = ( temp_output_18_0 * ( 1.0 + temp_output_22_0 ) );

float smoothstepResult30 = smoothstep( _hardness , 1.0 , ( noise - vertexToFrag26 ));

float smoothstepResult31 = smoothstep( _hardness , 1.0 , ( noise - vertexToFrag27));

float4 lerpResult13 = lerp( _Edge_Color , diff , smoothstepResult30);
clip(smoothstepResult31 - 0.5);

猜你喜欢

转载自blog.csdn.net/A13155283231/article/details/118544611