Page 1 of 1

Expose RenderType on templates?

PostPosted: Fri Jan 26, 2018 7:42 pm
by teofilobd
Hi,

Is there a way of exposing the RenderType tag (or any other tag) in user-defined templates (just like when you use a 'surface shader')?

Cheers

Re: Expose RenderType on templates?

PostPosted: Sat Jan 27, 2018 10:05 pm
by Ricardo Teixeira
Hello,

We have actually just updated ASE in order to allow that type of manipulation, Shader tags can now be modified on template based shaders.

Image

Let us know if you have any followup questions, we would be happy to help.

Thanks!

Re: Expose RenderType on templates?

PostPosted: Mon Jan 29, 2018 6:01 pm
by teofilobd
That's what I needed! Thanks! :D

Re: Expose RenderType on templates?

PostPosted: Mon Jan 29, 2018 6:07 pm
by Ricardo Teixeira
No problem, happy to help!

Re: Expose RenderType on templates?

PostPosted: Tue Jan 30, 2018 1:41 am
by teofilobd
Hi Ricardo,

I updated amplify, but the tag option is still not showing up. Do I need to put something else besides the /*ase_tags*/ in the template?

Cheers,

Re: Expose RenderType on templates?

PostPosted: Tue Jan 30, 2018 9:55 am
by Amplify_Borba
teofilobd wrote:Hi Ricardo,

I updated amplify, but the tag option is still not showing up. Do I need to put something else besides the /*ase_tags*/ in the template?

Cheers,


Hello teofilobd,

/*ase_tags*/ has been removed in this last update as we're updating ASE to support a couple of new features, now you only need to make use of Tags{ } at the beginning of the SubShader, in the near future we'll allow for the use of tags within each pass but for now you must place it in this specified line.

Please refer to the following screenshot:

tag.jpg
tag.jpg (6.14 KiB) Viewed 3029 times


Let me know if you have any further questions, we'll be glad to help!

Re: Expose RenderType on templates?

PostPosted: Tue Jan 30, 2018 6:58 pm
by teofilobd
Hi,

It's still not working :(
I'm using Amplify v1.4.3 dev 01 (did a fresh install) on Unity 2017.2.0p4

Screen Shot 2018-01-30 at 11.00.11 AM.png
Screen Shot 2018-01-30 at 11.00.11 AM.png (33.14 KiB) Viewed 3019 times


And this is my template:

Code: Select all
Shader /*ase_name*/ "ASETemplateShaders/Test" /*end*/
{
   Properties
   {
      /*ase_props*/
   }
   
   SubShader
   {
      Tags { }
      LOD 100
      Cull Back
      /*ase_pass*/

      Pass
      {
         CGPROGRAM
         #pragma target 3.0
         #pragma vertex vert
         #pragma fragment frag
         #include "UnityCG.cginc"
         /*ase_pragma*/

         struct appdata
         {
            float4 vertex : POSITION;
            UNITY_VERTEX_INPUT_INSTANCE_ID
            /*ase_vdata:p=p*/
         };
         
         struct v2f
         {
            float4 vertex : SV_POSITION;
            UNITY_VERTEX_OUTPUT_STEREO
            /*ase_interp(1,7):sp=sp.xyzw*/
         };

         /*ase_globals*/
         
         v2f vert ( appdata v /*ase_vert_input*/)
         {
            v2f o;
            UNITY_SETUP_INSTANCE_ID(v);
            UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
            
            // ase common template code
            /*ase_vert_code:v=appdata;o=v2f*/
            
            v.vertex.xyz += /*ase_vert_out:Local Vertex;Float3*/ float3(0,0,0) /*end*/;
            o.vertex = UnityObjectToClipPos(v.vertex);
            return o;
         }
         
         fixed4 frag (v2f i /*ase_frag_input*/) : SV_Target
         {
            fixed4 myColorVar;
            // ase common template code
            /*ase_frag_code:i=v2f*/
            
            myColorVar = /*ase_frag_out:Frag Color;Float4*/fixed4(1,0,0,1)/*end*/;
            return myColorVar;
         }
         ENDCG
      }
   }
   CustomEditor "ASEMaterialInspector"
}

Re: Expose RenderType on templates?

PostPosted: Wed Jan 31, 2018 9:50 am
by Amplify_Borba
Apologies for not confirming your ASE version earlier, your current version does not include the intended feature, you should download the latest one available through our download page, v1.4.3.002 – 26th January 2018, where added Shader tag modification on template based shaders.

We always upload the latest version to our website, as it may take a couple of days for it to be approved and show up on the Asset store, please let us know if everything is fine on your end after updating, thanks!

Re: Expose RenderType on templates?

PostPosted: Wed Jan 31, 2018 6:37 pm
by teofilobd
It worked! Thanks! :D

Re: Expose RenderType on templates?

PostPosted: Thu Feb 01, 2018 9:36 am
by Amplify_Borba
No problem, glad to be of assistance!

Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback.

Your feedback is extremely valuable to us, feel free to get back in touch if you have further issues or questions, thanks!