Giter VIP home page Giter VIP logo

godot-cel-shader's Introduction

Godot Cel Shader v1.0.0

By David Lipps aka Dave the Dev at EXPWorlds


Example Cel Shading Image

This is a demonstration project showcasing the included Cel Shader. All the assets were made by me, feel free to use them. Have fun!

Companion YouTube Tutorial: https://youtu.be/laastFVkTaA

Shader Parameter Discriptions:

  • Use Shade: Turns shading on or off. (not sure why, but you can)
  • Use Specular: Turns specular highlights on or off. Specular makes things look shiney or glossy.
  • Use Rim: Turns rim highlights on or off. Rim lighting highlights the edges of an object in direction of a light source.
  • Base Use Light Color: The color of the light source multiplies with the base color.
  • Specular Use Light Color: The color of the light source multiplies with the specular highlight tint.
  • Rim Use Light Color: The color of the light source multplies with the rim highlight tint.
  • Base Color: The normal color of the material when there is no shade or highlights.
  • Shade Color: The color of the material when angle between the light and the surface nomal exceeds the shade threshold (aka the color on the object where there is no light)
  • Specular Tint: The color that gets added to the base color where there is a specular highlight.
  • Rim Tint: The color that gets added to the base color where there is a rim highlight.
  • Shade Treshold: The value which represents the angle between the light and surface normal at which the transistion between base color and shade color occurs.
  • Shade Softness: A value which increases or decreases the gradiant amount at the transition between the base and shade colors.
  • Specular Softness: A value which increases or decreases the gradiant amount at the transition between the base and specular highlight colors.
  • Rim Threshold: A value which controls the threshold angle between the light source, camera angle, and the edge of an object. (aka the higher the value, the more the rim highlight will spread from the edge of the object)
  • Rim Spread: A value that deattenuates the spread of rim highlight around the edge of an object. (aka the higher the value, the more the rim highlight will spread around the edge of an object.)
  • Rim Softness: A value which increases or decreases the gradiant amount at the transition between the base and rim highlight colors.

Additional Notes:

  • The black outlines were made using the inverted hull method in Blender.
  • The 1.0.0 version of this shader does not support textures because in Godot v3.1 the UV variable isn't supported in the light shader function.
  • However, the current Godot master branch now does support using UVs in the light shader; therefore, I have written a Cel Shader which uses textures for the base and shade colors and will update this project when the next version of Godot releases.
  • It is probably best to use only one directional light, or things will start to look odd. If you need many lights in your scene, make sure cel shaded objects are only affected by one directional light by means of groups and visual layers.
  • A lot of the ideas behind the way this shader works was inspired by Junya C Motomura's 2015 GDC talk linked here.

I can be reached at: [email protected] I'd love to hear your thoughts. Especially about how I can improve. I'll do my best to get back to you.

godot-cel-shader's People

Contributors

wtkooa avatar davedadev avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.