SRP HD, precompute data on vertex and use it in surface.

Node-based Shader Editor

SRP HD, precompute data on vertex and use it in surface.

Postby eXiin » Tue Sep 04, 2018 12:36 pm

I'm trying to do some calculation in the vertex, and then send it to the surface

the shader code is the following:

Code: Select all
struct Input
{
   float data;
};

void vertexDataFunc( inout appdata_full v, out Input o )
{
   UNITY_INITIALIZE_OUTPUT( Input, o );
        o.data = value
}

void surf( Input i , inout SurfaceOutputStandard o )
{
      i.data
}


Ofc, when I do a node with a surface shader, I do as follow :
Code: Select all

public override string BuildResults(int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar)
{
            dataCollector.AddToInput(UniqueId, "float data", true);
            dataCollector.AddVertexInstruction("o.data = value;", UniqueId, false);
            dataCollector.AddInstructions("i.data", true, false);

       [...]
}



But when I try to do it for HD SRP, it doesn't work, because I don't know how to access to "o.data"

Can someone help me with it?
eXiin
 
Posts: 20
Joined: Sun Sep 02, 2018 4:34 pm

Re: SRP HD, precompute data on vertex and use it in surface.

Postby Ricardo Teixeira » Tue Sep 04, 2018 2:58 pm

eXiin wrote:I'm trying to do some calculation in the vertex, and then send it to the surface

the shader code is the following:

Code: Select all
struct Input
{
   float data;
};

void vertexDataFunc( inout appdata_full v, out Input o )
{
   UNITY_INITIALIZE_OUTPUT( Input, o );
        o.data = value
}

void surf( Input i , inout SurfaceOutputStandard o )
{
      i.data
}


Ofc, when I do a node with a surface shader, I do as follow :
Code: Select all

public override string BuildResults(int outputId, ref MasterNodeDataCollector dataCollector, bool ignoreLocalvar)
{
            dataCollector.AddToInput(UniqueId, "float data", true);
            dataCollector.AddVertexInstruction("o.data = value;", UniqueId, false);
            dataCollector.AddInstructions("i.data", true, false);

       [...]
}



But when I try to do it for HD SRP, it doesn't work, because I don't know how to access to "o.data"

Can someone help me with it?


Hello,

We would be happy to help but unfortunately the developer responsible for the HD implementation is currently away. We'll register your request and contact you as soon as he returns.

Are you trying to build a node or a template as well?

Any additional information you can share would be most welcome.

Thanks!
Sales & 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
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: SRP HD, precompute data on vertex and use it in surface.

Postby eXiin » Wed Sep 05, 2018 4:34 pm

Thanks.

I'm doing heavy calculations that are used per pixels, but I precompute then per vertex.
eXiin
 
Posts: 20
Joined: Sun Sep 02, 2018 4:34 pm

Re: SRP HD, precompute data on vertex and use it in surface.

Postby Ricardo Teixeira » Wed Sep 05, 2018 5:07 pm

eXiin wrote:Thanks.

I'm doing heavy calculations that are used per pixels, but I precompute then per vertex.


But do you intend to build a node or a template?

Regarding the "global function"questions, how do you want to apply it to your shader?
Sales & 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
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: SRP HD, precompute data on vertex and use it in surface.

Postby eXiin » Sun Oct 14, 2018 1:56 pm

I've tried to build a template, but my original shaders are done with surface shader, but I can't find how to make a Surface shader template.

Maybe i'm missing something?!
eXiin
 
Posts: 20
Joined: Sun Sep 02, 2018 4:34 pm

Re: SRP HD, precompute data on vertex and use it in surface.

Postby Amplify_Borba » Mon Oct 15, 2018 1:52 pm

Hello!

Unfortunately, our templates do not support Surface Shaders at this time, only Vertex/Frag Shaders, so you won't be able to perform those operations just yet.

Do rest assured that it's in our plans to add this in the near future, we apologize for any inconvenience caused.
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: SRP HD, precompute data on vertex and use it in surface.

Postby eXiin » Tue Oct 16, 2018 2:49 pm

Can you give me a vague estimate?
One week, One month. One year.
eXiin
 
Posts: 20
Joined: Sun Sep 02, 2018 4:34 pm

Re: SRP HD, precompute data on vertex and use it in surface.

Postby Amplify_Borba » Wed Oct 17, 2018 8:38 am

We apologize for the inconvenience but we can't provide any official ETA as the Template system was developed specifically for Vertex/Frag shaders, so it will likely take a considerable effort to provide support for Surface Shaders.
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 0 guests