EXPWorlds / Godot-Cel-Shader

A Cel Shader for the Godot Engine
MIT License
233 stars 17 forks source link

cel shader only receives one light source #3

Open randombenj opened 4 years ago

randombenj commented 4 years ago

First of all, thanks for this awesome shader! There is one thing I noticed dough while using it, the shader only receives one light source.

You may want to change: https://github.com/EXPWorlds/Godot-Cel-Shader/blob/master/Shaders/cel.shader#L83 to:

DIFFUSE_LIGHT += diffuse;

Source: https://godotengine.org/qa/48323/my-custom-light-shader-received-only-a-single-light

EXPWorlds commented 4 years ago

Yep, it's certainly an issue, however, the shader was designed to be used with only one light source. This is due to the current limitations of Godot, and also because using one light provides maximum control over the light/shade areas of the model. As covered in the ReadMe under "Additional Notes".

As for adding the diffuse to DIFFUSE_LIGHT: because of the way Godot shaders handle lights, this will create extra "bands" or levels of shade to an object. This might be an interesting effect in it's own right, but the goal here is to have areas of shade or no shade only.

Yet, I would like to have more control over lighting in the future, so I'll keep this issue open in case someone can find an effective solution, and/or to remind myself to check if Godot has updated the light shader fuction every once and awhile.

The input is much appreciated.

randombenj commented 4 years ago

Thanks for the explanation!