열차 목업의 내부 확인용 프로젝트
smchoi
2024-07-31 9fe33c1ae076b0f6501619388e6b4cc872b76f80
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
//////////////////////////////////////////////////////
// MK Glow Pre Sample                                //
//                                                    //
// Created by Michael Kremmel                       //
// www.michaelkremmel.de                            //
// Copyright © 2020 All rights reserved.           
 //
//////////////////////////////////////////////////////
 
#ifndef MK_GLOW_PRE_SAMPLE
    #define MK_GLOW_PRE_SAMPLE
 
    #include "../Inc/Common.hlsl"
    
    UNIFORM_SOURCE_SAMPLER_AND_TEXTURE(_SourceTex)
    uniform float2 _SourceTex_TexelSize;
    uniform half _LumaScale;
    #ifdef MK_BLOOM
        uniform half2 _BloomThreshold;
    #endif
 
    #ifdef MK_COPY
    #endif
        
    #define HEADER FragmentOutputAuto frag (VertGeoOutputSimple o)
 
    HEADER
    {
        UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(o);
        FragmentOutputAuto fO;
        UNITY_INITIALIZE_OUTPUT(FragmentOutputAuto, fO);
        
        #ifdef MK_BLOOM
            half4 bloom = 0;
 
            bloom = SampleSourceTex(PASS_SOURCE_TEXTURE_2D(_SourceTex, sampler_SourceTex), BLOOM_UV);
            bloom = half4(LuminanceThreshold(bloom.rgb, BLOOM_THRESHOLD), 1);
 
            #ifdef COLORSPACE_GAMMA
                bloom = GammaToLinearSpace4(bloom);
            #endif
            BLOOM_RENDER_TARGET = bloom;
        #endif
 
        #ifdef MK_COPY
            COPY_RENDER_TARGET =  SampleSourceTex(PASS_SOURCE_TEXTURE_2D(_SourceTex, sampler_SourceTex), UV_COPY);
        #endif
 
        return fO;
    }
#endif