CustomExpression: Fragment Input

Node-based Shader Editor

CustomExpression: Fragment Input

Postby sunrice » Fri Nov 24, 2017 10:40 am

Hi :D
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);
sunrice
 
Posts: 14
Joined: Fri Nov 24, 2017 10:27 am

Re: CustomExpression: Fragment Input

Postby Amplify_Borba » Fri Nov 24, 2017 4:50 pm

Hello, thank you for getting in touch!

Are you using one of our available shader templates or building one of your own?

Looking forward to your reply!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: CustomExpression: Fragment Input

Postby sunrice » Sun Nov 26, 2017 8:29 am

I make full custom shader template for my project.
It use world position, tangent space transform for normal mapping in template.
It's no more TEXCOORD for interpolater.

template:
struct v2f
{
float4 pos : SV_POSITION;
float4 tex : TEXCOORD0;
float3 posWorld : TEXCOORD1;
half3 normalDir : TEXCOORD2;
half3 tangentDir : TEXCOORD3;
half3 bitangentDir : TEXCOORD4;
half3 eyeVec : TEXCOORD5;
UNITY_FOG_COORDS(6)
UNITY_SHADOW_COORDS(7) //LIGHTING_COORDS(7, 8)
half3 ambient : COLOR0;
/*ase_interp(8,9):sp=sp.xyzw;uv0=tc0.xy;uv1=tc0.zw*/
};
sunrice
 
Posts: 14
Joined: Fri Nov 24, 2017 10:27 am

Re: CustomExpression: Fragment Input

Postby Amplify_Borba » Mon Nov 27, 2017 4:07 pm

Hello sunrice,

Apologies for the situation, but we're going to need you to send us both the shader and the template you've created so we can test them both on our side, would you mind sharing them with us?

You may upload them as a .zip file attachment to your forum post, or use https://wetransfer.com/ to share the files with us, thank you for your comprehension!

Looking forward to your reply.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 40 guests