Esempio n. 1
0
        public ScriptableRenderer(LookingGlassRenderPipelineAsset pipelineAsset)
        {
            if (pipelineAsset == null)
            {
                throw new ArgumentNullException("pipelineAsset");
            }

            m_Materials = new[]
            {
                CoreUtils.CreateEngineMaterial("Hidden/InternalErrorShader"),
                CoreUtils.CreateEngineMaterial(pipelineAsset.copyDepthShader),
                CoreUtils.CreateEngineMaterial(pipelineAsset.samplingShader),
                CoreUtils.CreateEngineMaterial(pipelineAsset.blitShader),
                CoreUtils.CreateEngineMaterial(pipelineAsset.screenSpaceShadowShader),
            };
        }
Esempio n. 2
0
            public static PipelineSettings Create(LookingGlassRenderPipelineAsset asset)
            {
                var cache = new PipelineSettings();

                // General settings
                cache.supportsCameraDepthTexture  = asset.supportsCameraDepthTexture;
                cache.supportsCameraOpaqueTexture = asset.supportsCameraOpaqueTexture;
                cache.opaqueDownsampling          = asset.opaqueDownsampling;

                // Quality settings
                cache.msaaSampleCount = asset.msaaSampleCount;
                cache.supportsHDR     = asset.supportsHDR;
                cache.renderScale     = asset.renderScale;

                // Main directional light settings
                cache.mainLightRenderingMode       = asset.mainLightRenderingMode;
                cache.supportsMainLightShadows     = asset.supportsMainLightShadows;
                cache.mainLightShadowmapResolution = asset.mainLightShadowmapResolution;

                // Additional light settings
                cache.additionalLightsRenderingMode       = asset.additionalLightsRenderingMode;
                cache.maxAdditionalLights                 = asset.maxAdditionalLightsCount;
                cache.supportsAdditionalLightShadows      = asset.supportsAdditionalLightShadows;
                cache.additionalLightsShadowmapResolution = asset.additionalLightsShadowmapResolution;

                // Shadow settings
                cache.shadowDistance      = asset.shadowDistance;
                cache.cascadeCount        = asset.cascadeCount;
                cache.shadowDepthBias     = asset.shadowDepthBias;
                cache.shadowNormalBias    = asset.shadowNormalBias;
                cache.supportsSoftShadows = asset.supportsSoftShadows;

                // Advanced settings
                cache.supportsDynamicBatching = asset.supportsDynamicBatching;
                cache.mixedLightingSupported  = asset.supportsMixedLighting;

                // looking glass info
                cache.lookingGlassInfo = asset.lookingGlassInfo;

//                drawInfo;


                return(cache);
            }
Esempio n. 3
0
        public LookingGlassRenderPipeline(LookingGlassRenderPipelineAsset asset)
        {
            settings = PipelineSettings.Create(asset);
            renderer = new ScriptableRenderer(asset);

            SetSupportedRenderingFeatures();

            PerFrameBuffer._GlossyEnvironmentColor = Shader.PropertyToID("_GlossyEnvironmentColor");
            PerFrameBuffer._SubtractiveShadowColor = Shader.PropertyToID("_SubtractiveShadowColor");

            PerCameraBuffer._InvCameraViewProj  = Shader.PropertyToID("_InvCameraViewProj");
            PerCameraBuffer._ScaledScreenParams = Shader.PropertyToID("_ScaledScreenParams");

            // Let engine know we have MSAA on for cases where we support MSAA backbuffer
            if (QualitySettings.antiAliasing != settings.msaaSampleCount)
            {
                QualitySettings.antiAliasing = settings.msaaSampleCount;
            }

            Shader.globalRenderPipeline = "LightweightPipeline";

            Lightmapping.SetDelegate(lightsDelegate);
        }