Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/selimanac/defold-toon-shader
https://github.com/selimanac/defold-toon-shader
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/selimanac/defold-toon-shader
- Owner: selimanac
- Created: 2024-08-13T10:26:57.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-09-05T18:46:30.000Z (5 months ago)
- Last Synced: 2024-11-26T21:36:09.596Z (2 months ago)
- Language: Lua
- Size: 14 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
- awesome-defold - Toon Shader
README
![Toon](/.github/defold-toons.png?raw=true)
![Toon](/.github/defold-toons-smooth.png?raw=true)
# Defold Toon Shader
Use `toon_local_legacy.material` or `toon_world_legacy.material` for [legacy pipeline](https://defold.com/manuals/shader/#writing-modern-glsl-shaders).
Use `toon_world.material` or `toon_local.material` for new pipeline Defold >= 1.9.2
### Shader Constants
All constants must be `vmath.vector4()` but only some components are used:
`light`(x, y, z) - Light position
`camera_position`(x, y, z) - Camera position
`toon_color`(x, y, z) - Diffuse color
`toon_ambient_color`(x, y, z) - Shadow color
`toon_specular_color`(x, y, z) - Specular_color
`toon_glossiness`(x) - Glossiness amount
`toon_rim_color`(x, y, z) - Light rim color
`toon_rim_amount`(x) - Light rim amount
`toon_rim_threshold`(x) - Light rim threshold
`toon_light_smooth_interpolation`(x) - Light shadow smooth
`toon_rim_smooth`(x) - Light rim smooth
`toon_specular_smooth`(x) - Specular smooth---
### Credits
Roystan: https://roystan.net/articles/toon-shader/