CustomExpression: Fragment Input
Posted: Fri Nov 24, 2017 10:40 am
Hi
I use amplify shader editor with Template.
If ShaderType is Template, It can't access to Surface Data(WorldNormal, WorldPosition, etc.) Nodes.
I need to access "ase_frag_input" in CustomExpressionNode.
I write an example because I am not good English.
template:
struct v2f
{
float4 pos : SV_POSITION;
float4 tex : TEXCOORD0;
float3 posWorld : TEXCOORD1;
}
half4 frag (v2f i /*ase_frag_input*/) : SV_Target
{
// ase common template code
/*ase_frag_code:i=v2f*/
node:
float3 MyCustomExpression(v2f i)
{
return i.posWorld;
}
generated:
half4 frag (_v2f i ) : SV_Target
{
float3 lcoalMyCustomExpression = MyCustomExpression(i);
I use amplify shader editor with Template.
If ShaderType is Template, It can't access to Surface Data(WorldNormal, WorldPosition, etc.) Nodes.
I need to access "ase_frag_input" in CustomExpressionNode.
I write an example because I am not good English.
template:
struct v2f
{
float4 pos : SV_POSITION;
float4 tex : TEXCOORD0;
float3 posWorld : TEXCOORD1;
}
half4 frag (v2f i /*ase_frag_input*/) : SV_Target
{
// ase common template code
/*ase_frag_code:i=v2f*/
node:
float3 MyCustomExpression(v2f i)
{
return i.posWorld;
}
generated:
half4 frag (_v2f i ) : SV_Target
{
float3 lcoalMyCustomExpression = MyCustomExpression(i);