Amplify_Borba wrote:Hey there, thank you for getting in touch!
You may use Macros with the Custom Expression node in Call Mode, which is set in the node parameters.
I'm afraid that I don't fully understand your next question, as you've posted code for a vertex frag shader, which goes into
Shader Templates territory. Could you provide further details in order for us to best help you?
Thank you for your reply.
The code is obtained from here:
https://docs.unity3d.com/Manual/SL-Vert ... mples.htmlShader name is "Lit/Shadow Casting".
In Frag Shader,What I Need is:
fixed4 frag (v2f i) : SV_Target
{
SHADOW_CASTER_FRAGMENT(i)
}
So I modified the template like this:
fixed4 frag (v2f i /*ase_frag_input*/) : SV_Target
{
/*ase_frag_code:i=v2f*/
/*ase_frag_out:TestFragOutput;Float4*//*end*/
}
and I used Custom Expression with call mode.
finally,I got this:
fixed4 frag (v2f i ) : SV_Target
{
float localMyCustomExpression2 = ( 0 );
SHADOW_CASTER_FRAGMENT(i)
float4 temp_cast_0 = (localMyCustomExpression2).xxxx;
temp_cast_0
}
How do I output the exact expression directly, is there any other way or technique?