Amplifying your potential.

redefinition of '_SpecColor'

Node-based Shader Editor
5 posts • Page 1 of 1

redefinition of '_SpecColor'

Postby sannyasi » Fri Dec 08, 2017 8:29 pm

In using Amplify Shader Editor, I'd like to essentially recreate the standard shader, but with some additional options.
The issue comes when adding Colors and Textures which match the names from the standard shader
(ie... _ColorMap, _Color, _SpecColor, _SpecMap, etc)

The goal here is so that when you change a material between the standard shader and my custom shader that the values held in these variables stay linked.
This works fine for the _Color, and _ColorMap.
(ie... Make standard material, set a image or color into the albedo, then change material's shader to my shader, and the same color and texture is mapped into the correct input)

This however does not work with _SpecColor (float3 variable). Instead I get a few errors.

Code: Select all
Shader error in 'MyShader': declaration of "_SpecColor" conflicts with previous declaration at /UnityLightingCommon.cginc(5) at line 46 (on d3d9)

Code: Select all
Shader error in 'MyShader': redefinition of _'SpecColor' at line 46 (on d3d11)


Why are specular variables giving me this issue when albedo don't?
I can't find other posts of people expressing this issue, which is odd.

Any help would be appreciated.
Thanks
sannyasi
 
Posts: 4
Joined: Fri Dec 08, 2017 8:14 pm

Re: redefinition of '_SpecColor'

Postby Amplify_Borba » Mon Dec 11, 2017 2:27 pm

Hello sannyasi, thank you for getting in touch and for you support!

Regarding the issue, the problem is that you're trying to declare a property whose variable already exists in the UnityLightingCommon.cginc library, resulting in the error you've provided.

What we can do on our side is to allow ASE to create properties without the declaration of the respective variable, so you can expect us to include this feature in a future build.

We'll be sure to notify you when we implement this, thank you for taking the time to report it.

Don't hesitate to get back in touch if you have any further questions or issues!
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: 907
Joined: Mon Jul 24, 2017 9:50 am

Re: redefinition of '_SpecColor'

Postby Amplify_Borba » Tue Dec 12, 2017 6:27 pm

Hello sannyasi!

We've just release a new ASE Build on our website, v1.4.0.004 – 12th December 2017, which adds a new Variable Mode property into property nodes when their types are not Constant, where you may pick the Fetch Mode that will assume that variable are already declared elsewhere ( for example, an external lib ) and doesn't declare it.

Thank you once more for taking the time to report the issue and don't hesitate to get back in touch, we're always happy to help!
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: 907
Joined: Mon Jul 24, 2017 9:50 am

Re: redefinition of '_SpecColor'

Postby sannyasi » Fri Dec 15, 2017 10:02 pm

Thanks for the birthday present!

Shader is working as expected now.
sannyasi
 
Posts: 4
Joined: Fri Dec 08, 2017 8:14 pm

Re: redefinition of '_SpecColor'

Postby Amplify_Borba » Mon Dec 18, 2017 11:29 am

Thank you for reporting back, we're glad that the problem is solved and hope you've had a great birthday, happy we contributed to it!

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.

Every bit helps, your feedback is extremely valuable to us!

Don't hesitate to get back in touch if you have further issues or questions, thanks!
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: 907
Joined: Mon Jul 24, 2017 9:50 am


5 posts • Page 1 of 1

Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 3 guests