示例#1
0
        public VRenderResources(VRPAsset asset, int id = 0)
        {
            this.id = id;
            if (asset.resources == null)
            {
                Debug.LogWarning("Try to load default VRPResources");
                m_VRPResources = Resources.Load <VRPResources>("VRPResources");
            }
            else
            {
                m_VRPResources = asset.resources;
            }
            if (m_VRPResources == null)
            {
                Debug.LogError("Can't find VRP resources!");
            }

            depth_Velocity     = new VRenderTexture2D(id + "_velocity", RenderTextureFormat.ARGBFloat, true, asset.MSAA);
            sceneColor         = new VRenderTexture2D(id + "_sceneColor", RenderTextureFormat.ARGBFloat, true, asset.MSAA);
            sceneColorPrev     = new VRenderTexture2D(id + "_sceneColor", RenderTextureFormat.ARGBFloat, true);
            depth              = new VRenderTexture2D(id + "_depth", RenderTextureFormat.Depth, true, asset.MSAA);
            baseColor_Metallic = new VRenderTexture2D(id + "_baseColor_Metallic", RenderTextureFormat.ARGB32, true, asset.MSAA);
            normal_Roughness   = new VRenderTexture2D(id + "_normal_Roughness", RenderTextureFormat.ARGBHalf, true, asset.MSAA);

            lightResources  = new LightResources();
            shadowResources = new ShadowResources(asset);
            giResources     = new GIResources(asset);

            materials = new VMaterials();

            setup_per_camera_properties = CommandBufferPool.Get(id + "_setproperties_beforeOpaque");
        }
示例#2
0
        public VRP(VRPAsset asset)
        {
            m_asset = asset;

            m_preZRenderer   = new PreZRenderer();
            m_lightRenderer  = new LightRenderer();
            m_commonRenderer = new CommonRenderer();
            m_bakeRenderer   = new BakeRenderer();
            m_giRenderer     = new GIRenderer();
            m_postRenderer   = new PostRenderer();
        }
示例#3
0
        public static VRenderResources Get(VRPAsset asset, int id)
        {
            VRenderResources res;

            instance.m_CameraTable[id] = 10;
            if (!instance.m_LookupTable.TryGetValue(id, out res))
            {
                res = new VRenderResources(asset, id);
                instance.m_LookupTable.Add(id, res);
            }
            return(res);
        }
 public ShadowResources(VRPAsset asset)
 {
     helper_ = new GameObject("");
     helper_.SetActive(false);
     helper_.hideFlags         = HideFlags.DontSave | HideFlags.HideInHierarchy;
     helper                    = helper_.AddComponent <Camera>();
     helper.orthographic       = true;
     helper.nearClipPlane      = 0f;
     helper.enabled            = false;
     m_asset                   = asset;
     m_DirShadowArray          = new VRenderTextureArray("dir_shadow_array", RenderTextureFormat.ARGB64, true, false, true);
     m_PointShadowArray        = new VRenderTextureArray("point_shadow_array", RenderTextureFormat.RG32, true, false, true);
     m_shadowcascade_matrix_vp = new VComputeBuffer(Marshal.SizeOf(typeof(ShadowCascadeMatrix)));
     m_pointLightMatrix        = new VComputeBuffer(Marshal.SizeOf(typeof(ShadowCascadeMatrix)));
 }