Page 1 of 1

Blinn-Phong Light ShaderFunction doesn't work with Deferred

PostPosted: Tue Mar 06, 2018 2:23 pm
by Lizzard
Hello!

I just noticed that using the "Blinn-Phong Light" Shader Function doesn't work in Deferred render path.
What is the reason for that? All the other default Light Models work fine.

Re: Blinn-Phong Light ShaderFunction doesn't work with Defer

PostPosted: Tue Mar 06, 2018 3:58 pm
by Amplify_Borba
Hello, Blinn-Phong Light only works in Forward as Unity's Custom Lighting is limited to Forward but, if you're comfortable with shader programming, I recommend looking into implementing your own Deferred Custom Lighting type using our flexible Template System.

Please let me know if you have any further questions, thanks!

Re: Blinn-Phong Light ShaderFunction doesn't work with Defer

PostPosted: Tue Mar 06, 2018 6:10 pm
by Lizzard
Thanks for your answer!

I'm not very comfortable with shader programming, that's why i use a visual shader editor : P.
But i'll see what i can do!

Another question:
Why does the default Light Model "Blinn Phong" act so weird?
If you input a color into its "Specular" slot, i'm expecting to control the Specular intensity and color.
But it's ignoring the color completely. It acts like setting the gloss.

Re: Blinn-Phong Light ShaderFunction doesn't work with Defer

PostPosted: Tue Mar 06, 2018 7:12 pm
by Amplify_Borba
This is actually a property that we can expose, I've registered your request and will get back to you as soon as our developer can look into it, thanks for the feedback!

For now, you may expose it manually by editing the shader code and in the following line:
[HideInInspector]_SpecColor("SpecularColor",Color)=(1,1,1,1)

Removing the "[HideInInspector], so it will look like:
_SpecColor("SpecularColor",Color)=(1,1,1,1)

Please let me know if you have any further questions!

Re: Blinn-Phong Light ShaderFunction doesn't work with Defer

PostPosted: Tue Mar 06, 2018 9:33 pm
by Lizzard
Ah i see, that works.
But i don't like having to edit the shader everytime i make some changes.

So "Gloss" seems to not control the glossiness at all. Instead it changes the specular intensity.
The "Specular" changes the glossiness.
That's just super weird, why does it behave like that?

[EDIT]
Oh i see... It also alters the skybox. (i had that turned off/black cubemap) But then again why would a "Blinn-Phong" shader do that, i think the skybox should be optional?

Whatever... if the "_SpecColor" property gets exposed i would be very happy! : )

Re: Blinn-Phong Light ShaderFunction doesn't work with Defer

PostPosted: Wed Mar 07, 2018 6:19 pm
by Amplify_Borba
Hey there, we've just uploaded a new build to our website in which you can find the Specular Color property exposed, also showing up in the material property list.

This property is fixed, and to use it inside the graph you need to create a new property node in "fetch" mode, please refer to the following screenshot for reference.

Specular.jpg
Specular.jpg (211.41 KiB) Viewed 3488 times


Please let me know if this helps, thanks!

Re: Blinn-Phong Light ShaderFunction doesn't work with Defer

PostPosted: Wed Mar 07, 2018 10:52 pm
by Lizzard
Thank you, that works!

But i bumped into a new issue. It seems like the "Blinn Phong" Light model specular ignores the normal map.
Anything i can do about that?

I've attached an image. Left is my shader and right is unitys Standard shader.

[EDIT]
The issues is completely gone if i switch to Deferred. Since i will probably stick to Deferred the issues is solved for me.

Re: Blinn-Phong Light ShaderFunction doesn't work with Defer

PostPosted: Thu Mar 08, 2018 10:33 am
by Amplify_Borba
Lizzard wrote:Thank you, that works!

But i bumped into a new issue. It seems like the "Blinn Phong" Light model specular ignores the normal map.
Anything i can do about that?

I've attached an image. Left is my shader and right is unitys Standard shader.

[EDIT]
The issues is completely gone if i switch to Deferred. Since i will probably stick to Deferred the issues is solved for me.


Upon running some tests I can't seem to find any issue between the Render Path and the Blinn Phong Light Model, what is your camera's Rendering Path set to? Is your ASE shader's Render Path set to "All", so that it matches either Forward or Deferred rendering paths set on the Main Camera?

Re: Blinn-Phong Light ShaderFunction doesn't work with Defer

PostPosted: Thu Mar 08, 2018 4:29 pm
by Lizzard
The weird thing is, that this also happens to Unitys legacy Bumped Specular shader.
So i guess the problem is unrelated to the Amplify Editor.
Hmmm..

Re: Blinn-Phong Light ShaderFunction doesn't work with Defer

PostPosted: Thu Mar 08, 2018 6:15 pm
by Amplify_Borba
Unfortunately, I'm not entirely sure on what to recommend in this situation, it might be related to the project settings and not to the shaders.

If you believe there's an actual problem with an ASE shader I would suggest that you send us a simple sample project with the issue present so that we can debug it on our side.

Please let me know if you have are any further questions, thanks!