Blinn-Phong Light ShaderFunction doesn't work with Deferred

Node-based Shader Editor

Blinn-Phong Light ShaderFunction doesn't work with Deferred

Postby Lizzard » Tue Mar 06, 2018 2:23 pm

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.
Attachments
Deferred.jpg
Deferred.jpg (167.45 KiB) Viewed 2710 times
Lizzard
 
Posts: 8
Joined: Mon Feb 26, 2018 2:25 pm

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

Postby Amplify_Borba » Tue Mar 06, 2018 3:58 pm

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!
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: Blinn-Phong Light ShaderFunction doesn't work with Defer

Postby Lizzard » Tue Mar 06, 2018 6:10 pm

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.
Attachments
BlinnPhongB.jpg
BlinnPhongB.jpg (69.98 KiB) Viewed 2705 times
BlinnPhongA.jpg
BlinnPhongA.jpg (89.32 KiB) Viewed 2705 times
Lizzard
 
Posts: 8
Joined: Mon Feb 26, 2018 2:25 pm

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

Postby Amplify_Borba » Tue Mar 06, 2018 7:12 pm

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!
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: Blinn-Phong Light ShaderFunction doesn't work with Defer

Postby Lizzard » Tue Mar 06, 2018 9:33 pm

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! : )
Lizzard
 
Posts: 8
Joined: Mon Feb 26, 2018 2:25 pm

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

Postby Amplify_Borba » Wed Mar 07, 2018 6:19 pm

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 2681 times


Please let me know if this helps, 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: 1239
Joined: Mon Jul 24, 2017 9:50 am

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

Postby Lizzard » Wed Mar 07, 2018 10:52 pm

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.
Attachments
SpecularBug.jpg
SpecularBug.jpg (99.3 KiB) Viewed 2669 times
Lizzard
 
Posts: 8
Joined: Mon Feb 26, 2018 2:25 pm

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

Postby Amplify_Borba » Thu Mar 08, 2018 10:33 am

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?
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: Blinn-Phong Light ShaderFunction doesn't work with Defer

Postby Lizzard » Thu Mar 08, 2018 4:29 pm

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..
Lizzard
 
Posts: 8
Joined: Mon Feb 26, 2018 2:25 pm

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

Postby Amplify_Borba » Thu Mar 08, 2018 6:15 pm

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!
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 145 guests