コード例 #1
0
 static void ConfigureSRPBatcherFromAsset(GameheadsRenderPipelineAsset asset)
 {
     if (asset.isSRPBatcherEnabled)
     {
         GraphicsSettings.useScriptableRenderPipelineBatching = true;
     }
 }
コード例 #2
0
        static Texture2D GetFramebufferDitherTexFromAsset(GameheadsRenderPipelineAsset asset)
        {
            if (asset.renderPipelineResources.textures.framebufferDitherTex == null)
            {
                return(Texture2D.grayTexture);
            }

            return(asset.renderPipelineResources.textures.framebufferDitherTex);
        }
コード例 #3
0
        static void PushGlobalPostProcessingParameters(Camera camera, CommandBuffer cmd, GameheadsRenderPipelineAsset asset, RenderTexture rasterizationRT, int rasterizationWidth, int rasterizationHeight)
        {
            using (new ProfilingScope(cmd, GameheadsProfilingSamplers.s_PushGlobalPostProcessingParameters))
            {
                bool flipY = IsMainGameView(camera);
                cmd.SetGlobalInt(GameheadsShaderIDs._FlipY, flipY ? 1 : 0);
                cmd.SetGlobalVector(GameheadsShaderIDs._UVTransform, flipY ? new Vector4(1.0f, -1.0f, 0.0f, 1.0f) : new Vector4(1.0f, 1.0f, 0.0f, 0.0f));
                cmd.SetGlobalVector(GameheadsShaderIDs._ScreenSize, new Vector4(camera.pixelWidth, camera.pixelHeight, 1.0f / (float)camera.pixelWidth, 1.0f / (float)camera.pixelHeight));
                cmd.SetGlobalVector(GameheadsShaderIDs._FrameBufferScreenSize, new Vector4(rasterizationWidth, rasterizationHeight, 1.0f / (float)rasterizationWidth, 1.0f / (float)rasterizationHeight));
                cmd.SetGlobalTexture(GameheadsShaderIDs._FrameBufferTexture, rasterizationRT);

                cmd.SetGlobalVector(GameheadsShaderIDs._Time, new Vector4(Time.timeSinceLevelLoad / 20.0f, Time.timeSinceLevelLoad, Time.timeSinceLevelLoad * 2.0f, Time.timeSinceLevelLoad * 3.0f));
            }
        }
コード例 #4
0
 internal GameheadsRenderPipeline(GameheadsRenderPipelineAsset asset)
 {
     m_Asset = asset;
     Build();
     Allocate();
 }