yum-archive/Tooner

A toon shader for Unity's BIRP.

git clone https://git.yummers.dev/yum-archive/Tooner

yumMake flat normals adjustable47d32c9

v0.0.0
2.8 KiB87 linesraw
1#ifndef LTCGI_CONFIG_INCLUDED
2#define LTCGI_CONFIG_INCLUDED
3
4// Feel free to enable or disable (//) the options here.
5// They will apply to all LTCGI materials in the project.
6// Most of these can be changed in the LTCGI_Controller editor as well.
7
8/// No specular at all.
9//#define LTCGI_SPECULAR_OFF
10/// No diffuse at all.
11//#define LTCGI_DIFFUSE_OFF
12/// Disable the ability to toggle specular/diffuse on or off per screen.
13//#define LTCGI_TOGGLEABLE_SPEC_DIFF_OFF
14
15/// Only use LTC diffuse mode, never lightmapped diffuse.
16/// This disables lightmaps entirely.
17//#define LTCGI_ALWAYS_LTC_DIFFUSE
18
19/// Double-sample screen texture for diffuse lighting to smooth resulting lighting
20/// a bit more with global screen color data. Slight performance cost.
21//#define LTCGI_BLENDED_DIFFUSE_SAMPLING
22
23/// Slightly simplified and thus faster sampling for reflections at the cost of quality.
24/// Consider using this if your scene looks about the same with this enabled.
25//#define LTCGI_FAST_SAMPLING
26
27/// Use bicubic filtering for LTCGI lightmap. Recommended on.
28#define LTCGI_BICUBIC_LIGHTMAP
29
30/// Lightmap values below this will be treated as black for specular/LTC diffuse.
31#define LTCGI_LIGHTMAP_CUTOFF 0.1
32/// Lightmap values above this (plus cutoff) will be treated as white.
33#define LTCGI_SPECULAR_LIGHTMAP_STEP 0.3
34
35/// Distance multiplier for calculating blur amount.
36/// Increase to make reflections blurrier faster as distance increases.
37#define LTCGI_UV_BLUR_DISTANCE 333
38
39/// Fall back to LTC diffuse (from LM diffuse) on objects that are not marked static.
40#define LTCGI_LTC_DIFFUSE_FALLBACK
41
42/// Approximation to ignore diffuse light for far away
43/// lights, increase MULT or disable if you notice artifacting
44#define LTCGI_DISTANCE_FADE_APPROX
45/// Distance at which diffuse from screens will be ignored.
46#define LTCGI_DISTANCE_FADE_APPROX_MULT 50
47
48
49// disabled editor from here on out
50///
51
52
53// Allow statically textured lights.
54// (deprecated: doesn't really cause any improvement when disabled...)
55#define LTCGI_STATIC_TEXTURES
56
57
58// keep in sync with LTCGI_Controller.cs
59#define MAX_SOURCES 16
60
61// set according to the LUT specified on CONTROLLER
62#define LUT_SIZE 256
63static float LUT_SCALE = (LUT_SIZE - 1.0)/LUT_SIZE;
64const float LUT_BIAS = 0.5/LUT_SIZE;
65
66// will be set automatically if audiolink is available
67//#define LTCGI_AUDIOLINK
68
69#ifdef LTCGI_AUDIOLINK
70#ifndef AUDIOLINK_WIDTH
71#ifndef AUDIOLINK_CGINC_INCLUDED
72#include "Packages/com.llealloo.audiolink/Runtime/Shaders/AudioLink.cginc"
73#define AUDIOLINK_CGINC_INCLUDED
74#endif
75#endif
76#endif
77
78// Bake screen data into texture for better performance. Disables moveable screens.
79#define LTCGI_STATIC_UNIFORMS
80
81// Enable support for cylindrical screens.
82#define LTCGI_CYLINDER
83
84// Activate avatar mode, which overrides certain configs from above.
85#define LTCGI_AVATAR_MODE
86
87#endif