#T#PoiMirrorProperties

// Mirror Rendering
[HideInInspector] m_start_mirrorOptions ("Mirror--{reference_property:_EnableMirrorOptions}", Float) = 0
[HideInInspector][ThryToggle(POI_MIRROR)]_EnableMirrorOptions ("Enable Mirror Options", Float) = 0
[ThryWideEnum(Show In Both, 0, Show Only In Mirror, 1, Dont Show In Mirror, 2)] _Mirror ("Show in mirror", Int) = 0
_MirrorTexture ("Mirror Texture--{reference_properties:[_MirrorTexturePan, _MirrorTextureUV]},", 2D) = "white" { }
[HideInInspector][Vector2]_MirrorTexturePan ("Panning", Vector) = (0, 0, 0, 0)
[HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MirrorTextureUV("UV", Int) = 0
[HideInInspector] m_end_mirrorOptions ("Mirror", Float) = 0

#T#PoiMirrorKeywords
#pragma shader_feature_local POI_MIRROR

#T#PoiMirrorVariables
#ifdef POI_MIRROR
    float _Mirror;
	#if defined(PROP_MIRRORTEXTURE) || !defined(OPTIMIZER_ENABLED)
    	Texture2D _MirrorTexture;
	#endif
	float4 _MirrorTexture_ST;
	float2 _MirrorTexturePan;
	float _MirrorTextureUV;
#endif

#T#PoiMirrorFunctions
#ifdef POI_MIRROR
    void applyMirror(inout PoiFragData poiFragData, in PoiMesh poiMesh)
    {
		bool inMirror = IsInMirror();
		if (_Mirror != 0)
		{
			if (_Mirror == 1 && inMirror)	return;
			if (_Mirror == 1 && !inMirror)	discard;
			if (_Mirror == 2 && inMirror)	discard;
			if (_Mirror == 2 && !inMirror)	return;
		}

		#if(defined(FORWARD_BASE_PASS) || defined(FORWARD_ADD_PASS))
            #if defined(PROP_MIRRORTEXTURE) || !defined(OPTIMIZER_ENABLED)
                if(inMirror)
                {
					poiFragData.baseColor = POI2D_SAMPLER_PAN(_MirrorTexture, _MainTex, poiMesh.uv[_MirrorTextureUV], _MirrorTexturePan);
                }
            #endif
		#endif
    }
#endif

#T#PoiMirrorFunctionCalls
#ifdef POI_MIRROR
    applyMirror(poiFragData, poiMesh);
#endif

