Amplifying your potential.

Light Color Node

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

Light Color Node

Postby thefallenone » Fri Apr 13, 2018 8:19 pm

Hey,

I'm having some issues using the Light Color node in Amplify Shader. On one machine, it works fine, and on another, it returns a value of 0 (in exactly the same build) for all outputs.

The machine that it works on is using a GTX 1070, and the one it's not working on is a GTX 970.

Is this a hardware support issue for that particular node? The shader isn't failing to compile, it still runs fine, but returns 0 for the values. If so, is there a way to check for node compatibility beyond a fallback shader (as it's not failing to compile, and so not falling back) at runtime? If not, what else could be causing this?

The code is using the \ASESampleShaders\CustomLightingToon shader, but everything beyond that node works. It is also a VR project, though it works fine in VR on the first machine.

Thanks for any help you guys can provide. :)
thefallenone
 
Posts: 4
Joined: Fri Apr 13, 2018 8:12 pm

Re: Light Color Node

Postby Ricardo Teixeira » Mon Apr 16, 2018 3:54 pm

thefallenone wrote:Hey,

I'm having some issues using the Light Color node in Amplify Shader. On one machine, it works fine, and on another, it returns a value of 0 (in exactly the same build) for all outputs.

The machine that it works on is using a GTX 1070, and the one it's not working on is a GTX 970.

Is this a hardware support issue for that particular node? The shader isn't failing to compile, it still runs fine, but returns 0 for the values. If so, is there a way to check for node compatibility beyond a fallback shader (as it's not failing to compile, and so not falling back) at runtime? If not, what else could be causing this?

The code is using the \ASESampleShaders\CustomLightingToon shader, but everything beyond that node works. It is also a VR project, though it works fine in VR on the first machine.

Thanks for any help you guys can provide. :)


Hello,

That's an interesting issue, not sure we came across it before.

Can you share the shader for further examination and testing on our side?

Thanks!
Sales & 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
Ricardo Teixeira
 
Posts: 924
Joined: Fri Aug 09, 2013 2:26 pm

Re: Light Color Node

Postby thefallenone » Mon Apr 16, 2018 5:09 pm

Certainly, I've attached the .shader file here (in zip format) - if you need it in a different format, or need more information, feel free to ask.

I'm using Unity 2018.1.0b13 at the moment, and haven't yet tested it in other versions of Unity, but can do so if it may be relevant.
Attachments
ToonShader.zip
(4.18 KiB) Downloaded 22 times
thefallenone
 
Posts: 4
Joined: Fri Apr 13, 2018 8:12 pm

Re: Light Color Node

Postby Amplify_Borba » Tue Apr 17, 2018 9:54 am

Thank you for sharing the sample!

We're going to investigate this issue and will get back to you as soon as we have any developments.
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: 900
Joined: Mon Jul 24, 2017 9:50 am

Re: Light Color Node

Postby Amplify_Borba » Tue Apr 17, 2018 1:23 pm

Unfortunately, we haven't been able to replicate the issue on any of our test machines.

Are you able to replicate the issue in a new project with a simple scene?
If so, could you please provide us with that same sample scene with the issue present so that we can further debug it on our side?
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: 900
Joined: Mon Jul 24, 2017 9:50 am

Re: Light Color Node

Postby thefallenone » Tue Apr 17, 2018 5:08 pm

I've made as simple a project as possible - you'll need to open the TestScene scene (in the \Scenes folder) once the project comes up.

Interestingly, now the node is returning 0 on both computers, not just one, and I'm not certain what caused it to change. Hopefully that makes it easier to debug and not more difficult. It works perfectly in the editor, but once you do a "Build" and run it outside of the editor, it stops working.

I removed the Unity Amplify Shader plugin before compressing (didn't want to share the plugin publiclly), so if you want to edit the shader you may need to re-add it manually. It looks like I was on 1.5.2 dev 01.

I couldn't upload the zip here, as it was too large, but I've shared it on DropBox:

https://www.dropbox.com/s/gbffqoj3n1cd2 ... t.zip?dl=0
thefallenone
 
Posts: 4
Joined: Fri Apr 13, 2018 8:12 pm

Re: Light Color Node

Postby Amplify_Borba » Wed Apr 18, 2018 1:45 pm

Thank you for taking the time to set up a simple project!

Upon investigating the issue it seems that it is caused by a low dynamic light amount set for the used quality setting, which was Fastest by default. By enabling the Display Resolution Dialogue in order to select a higher quality level you can see how Quality Levels other than Fast and Fastest, which had the Pixel Light Count values set to 0, work as intended.

In short, this issue can be solved by increasing the Pixel Light Count in the desired quality levels, by going to Project Settings > Quality, then setting the value to something other than 0.

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: 900
Joined: Mon Jul 24, 2017 9:50 am

Re: Light Color Node

Postby thefallenone » Wed Apr 18, 2018 2:01 pm

Thanks, that does help - though I wonder then if there's a way to modify/branch/switch shaders based on selected graphic quality settings?

At the moment, aside from doing an "if" to check if the output from the light color node is 0 (which feels really hacky), I can't see any easy way to use a different shader path or shader altogether, as the fallback isn't being triggered by this case (it still compiles fine, just doesn't have a light to sample, by the looks of it).

It's always possible I'm missing something obvious, as I'm still very new to Amplify Shader Editor, so hopefully I'm not wasting your time any further. :)
thefallenone
 
Posts: 4
Joined: Fri Apr 13, 2018 8:12 pm

Re: Light Color Node

Postby Amplify_Borba » Wed Apr 18, 2018 2:31 pm

No problem, happy to help!

You may use Shader LODs and Fallback Shaders that will be used when a certain pass is either missing or unsupported by the main shader, both of which may be set in the Output Node's parameters, or Multi-Compile via Static Switch, however, if you intend to use real time lights you need to set the Pixel Light Count to any value other than 0 in the lowest graphics presets through your project's Quality Settings.

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: 900
Joined: Mon Jul 24, 2017 9:50 am


9 posts • Page 1 of 1

Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 4 guests