Page 1 of 1

redefinition of '_SpecColor'

PostPosted: Fri Dec 08, 2017 8:29 pm
by sannyasi
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

Re: redefinition of '_SpecColor'

PostPosted: Mon Dec 11, 2017 2:27 pm
by Amplify_Borba
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!

Re: redefinition of '_SpecColor'

PostPosted: Tue Dec 12, 2017 6:27 pm
by Amplify_Borba
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!

Re: redefinition of '_SpecColor'

PostPosted: Fri Dec 15, 2017 10:02 pm
by sannyasi
Thanks for the birthday present!

Shader is working as expected now.

Re: redefinition of '_SpecColor'

PostPosted: Mon Dec 18, 2017 11:29 am
by Amplify_Borba
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!