yum-archive/Tooner

A toon shader for Unity's BIRP.

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

yumAdd LTCGI6eed98f

master
2.0 KiB43 linesraw
1#ifndef LTCGI_STRUCTS_INCLUDED
2#define LTCGI_STRUCTS_INCLUDED
3
4#define LTCGI_COLORMODE_STATIC 0
5#define LTCGI_COLORMODE_TEXTURE 1
6#define LTCGI_COLORMODE_SINGLEUV 2
7#define LTCGI_COLORMODE_AUDIOLINK 3
8
9struct ltcgi_flags
10{
11    bool doublesided; // if the light is doublesided or only illuminates the front face
12    bool diffFromLm; // diffuse lighting intensity will not be calculated via LTC but taken directly from the lightmap
13    bool specular; // if the light has a specular component
14    bool diffuse; // if the light has a diffuse component
15    uint colormode; // colormode, see above
16    uint texindex; // index of the texture to shade with, if colormode == LTCGI_COLORMODE_TEXTURE
17    uint lmch, lmidx; // lightmap channel and index
18    bool cylinder; // is this light a cylinder
19    uint alBand; // audiolink band if colormode == LTCGI_COLORMODE_AUDIOLINK
20    bool lmdOnly; // if this light is lightmap-diffuse _only_, that is, no LTC will be run (Lw will be all 0 in that case) - this will never be true on avatars (with LTCGI_ALWAYS_LTC_DIFFUSE)
21};
22
23struct ltcgi_input
24{
25    uint i; // light number
26    float3 Lw[4]; // world space area light vertices, Lw[1] == Lw[3] for triangle lights, shifted by input worldPos (i.e. world space position as seen from (0, 0, 0))
27    bool isTri; // if this is a triangle light, quad if false
28    float4 uvStart; // defines the UV layout of the area (xy = top-left, zw=top-right)
29    float4 uvEnd; // defines the UV layout of the area (xy = bottom-left, zw=bottom-right), different use for cylinders
30    float3 rawColor; // the raw light color, unaffected by any colormode calculations (i.e. exactly what's given as "color" in editor)
31    float3 screenNormal; // world space normal direction of area light
32    ltcgi_flags flags; // flags, see above
33};
34
35struct ltcgi_output
36{
37    ltcgi_input input; // input data that resulted in this output
38
39    float intensity; // intensity output by LTC calculation
40    float3 color; // color output by LTCGI colormode calculation
41};
42
43#endif