열차 목업의 내부 확인용 프로젝트
smchoi
2024-07-24 ec231f4110c782d44ea2820a1eaaa7a5711c6f16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//////////////////////////////////////////////////////
// MK Glow Composite                                //
//                                                    //
// Created by Michael Kremmel                       //
// www.michaelkremmel.de                            //
// Copyright © 2020 All rights reserved.           
 //
//////////////////////////////////////////////////////
#ifndef MK_GLOW_COMPOSITE
    #define MK_GLOW_COMPOSITE
    
    #include "../Inc/Common.hlsl"
 
    UNIFORM_SOURCE_SAMPLER_AND_TEXTURE(_SourceTex)
    uniform float2 _SourceTex_TexelSize;
 
    UNIFORM_SAMPLER_AND_TEXTURE_2D(_BloomTex)
    uniform float2 _BloomTex_TexelSize;
    uniform half _BloomSpread;
    uniform half _BloomIntensity;
 
    #ifdef MK_LENS_SURFACE
        UNIFORM_SAMPLER_AND_TEXTURE_2D_NO_SCALE(_LensSurfaceDirtTex)
        UNIFORM_SAMPLER_AND_TEXTURE_2D_NO_SCALE(_LensSurfaceDiffractionTex)
        uniform half _LensSurfaceDirtIntensity;
        uniform half _LensSurfaceDiffractionIntensity;
        uniform float4 _LensSurfaceDirtTex_ST;
    #endif
 
    #if defined(MK_LENS_SURFACE)
        #define VertGeoOutput VertGeoOutputPlus
        #define MK_LENS_SURFACE_DIFFRACTION_UV uv1.xy
        #define LENS_FLARE_SPREAD uv1.xy
    #else
        #define VertGeoOutput VertGeoOutputAdvanced
    #endif
 
    VertGeoOutput vert (VertexInputOnlyPosition i0)
    {
        VertGeoOutput o;
        UNITY_SETUP_INSTANCE_ID(i0);
        UNITY_INITIALIZE_OUTPUT(VertGeoOutput, o);
        UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
 
        o.pos = TransformMeshPos(i0.vertex);
 
        #ifdef MK_LEGACY_BLIT
            o.uv0.xy = i0.texcoord0;
            #if UNITY_UV_STARTS_AT_TOP
                if (_SourceTex_TexelSize.y < 0)
                    o.uv0.xy = 1-o.uv0.xy;
            #endif
        #else
            o.uv0.xy = SetMeshUV(o.pos.xy);
        #endif
        o.uv0.zw = BLOOM_TEXEL_SIZE * _BloomSpread;
 
        #ifdef MK_LENS_SURFACE
            o.MK_LENS_SURFACE_DIFFRACTION_UV = LensSurfaceDiffractionUV(o.uv0.xy);
        #endif
 
        return o;
    }
 
    #define HEADER half4 frag (VertGeoOutput o) : SV_Target
 
    HEADER
    {
        #include "CompositeSample.hlsl"
    }
#endif