Page 1 of 1

Equivalent to ShaderForge "Diffuse Ambient Light"

PostPosted: Mon Oct 01, 2018 12:23 pm
by Monobanda
Hello ASE masters,

I am struggling to create a shader in ASE where I can add a layer of ambient, overall color/light on top of the shader.
In ShaderForge, this was simply called "Diffuse Ambient Light", but it seems there is no straight-away equivalent in ASE.

Is there any way I can achieve this?

Image
(PS for some reason I cannot add images properly, so right-click and open in new tab)

Re: Equivalent to ShaderForge "Diffuse Ambient Light"

PostPosted: Mon Oct 01, 2018 12:47 pm
by Ricardo Teixeira
Monobanda wrote:Hello ASE masters,
I am struggling to create a shader in ASE where I can add a layer of ambient, overall color/light on top of the shader.
In ShaderForge, this was simply called "Diffuse Ambient Light", but it seems there is no straight-away equivalent in ASE.
Is there any way I can achieve this?
Image
(PS for some reason I cannot add images properly, so right-click and open in new tab)


Greetings,

In ASE you'll have to create your own Custom Lighting layout, the "Diffuse Ambient Light" is a specific Shader Forge implementation.

* Use the Custom Light Shader Model to access Lighting specific nodes.
* Examine the included samples.
* You'll need to use the Indirect Diffuse Light Node to access Unity's ambient value; how you manipulate it is entirely up to you - a simple multiplication should do it.

Let me know if you have any additional questions.

Re: Equivalent to ShaderForge "Diffuse Ambient Light"

PostPosted: Mon Oct 01, 2018 1:34 pm
by Monobanda
Hi,

Thank you for your reply.
It seems that I am missing something very obvious here, because it's not working yet.

1. I changed the light model to "Custom Lighting".
2. I added the "Indirect Diffuse Light" node and plugged it into "Custom Lighting".
3. In the "Normal" input of the node, I plugged in a colour.
4. I made the colour light grey.

As far as I'm concerned, it should work without any external lighting, correct? The point is that the colour shows up without any lights in the scene.

What am I missing here?

Re: Equivalent to ShaderForge "Diffuse Ambient Light"

PostPosted: Mon Oct 01, 2018 4:55 pm
by Ricardo Teixeira
Monobanda wrote:Hi,

Thank you for your reply.
It seems that I am missing something very obvious here, because it's not working yet.

1. I changed the light model to "Custom Lighting".
2. I added the "Indirect Diffuse Light" node and plugged it into "Custom Lighting".
3. In the "Normal" input of the node, I plugged in a colour.
4. I made the colour light grey.

As far as I'm concerned, it should work without any external lighting, correct? The point is that the colour shows up without any lights in the scene.

What am I missing here?


Hey there,

Don't plug a color node into the normal input, that's only if you want to add your normal texture to the calculation(or related effects). As I mentioned, I'm afraid our Custom Lighting mode works a bit differently in the sense that you can create other types of lighting, you're not limited to a specific set as presented by shader forge.

You have two options:
1- Use the Standard Surface Light node for added ease of use. (tint it by multiplying your output by a color node)
2. Create your own Lighting setup, the sample "CustomLightingToon" is a great place to start. Notice the Attenuation and Ambient Box, you can manipulate the ambient contribution directly.

In this example, I added a Multiply node along with a Color node for tint and a Float to control its intensity.

Image

A warning, note that simply plugging colors into the custom lighting input will also not give you similar results, you have to handle light information using the provided nodes under the Light category.