Esempio n. 1
0
//----------------------------------------------------------------------------------------------------------------------

        private static BaseTextureBlitter CreateBlitter(Texture texToBlit)
        {
            GameObject blitterGO = new GameObject("Blitter");

#if AT_USE_HDRP
            HDRPTextureEndFrameBlitter blitter = blitterGO.AddComponent <HDRPTextureEndFrameBlitter>();
            blitter.SetTargetCameraType(CameraType.Game);
#elif AT_USE_URP
            URPTextureBlitter blitter = blitterGO.AddComponent <URPTextureBlitter>();
#else
            LegacyTextureBlitter blitter = blitterGO.AddComponent <LegacyTextureBlitter>();
#endif
            blitter.SetSrcTexture(texToBlit);
            blitter.SetCameraDepth(int.MaxValue);

            return(blitter);
        }
Esempio n. 2
0
//----------------------------------------------------------------------------------------------------------------------

        private static GameObject CreateBlitter(Texture texToBlit, Color bgColor)
        {
            GameObject blitterGO = new GameObject("Blitter");

#if AT_USE_HDRP
            HDRPTextureEndFrameBlitter blitter = blitterGO.AddComponent <HDRPTextureEndFrameBlitter>();
            blitter.SetTargetCameraType(CameraType.Game);
#elif AT_USE_URP
            URPTextureBlitter blitter = blitterGO.AddComponent <URPTextureBlitter>();
#else
            LegacyTextureBlitter blitter = blitterGO.AddComponent <LegacyTextureBlitter>();
#endif
            blitter.SetSrcTexture(texToBlit);
            blitter.SetCameraDepth(int.MaxValue);

            //Setup blitMaterial
            Shader   blitShader   = AssetDatabase.LoadAssetAtPath <Shader>(SISEditorConstants.TRANSPARENT_BG_COLOR_SHADER_PATH);
            Material blitMaterial = new Material(blitShader);
            blitMaterial.hideFlags = HideFlags.DontSaveInBuild | HideFlags.DontSaveInEditor;
            blitMaterial.SetColor(m_bgColorProperty, bgColor);
            blitter.SetBlitMaterial(blitMaterial);

            return(blitterGO);
        }