当前位置: 首页>>代码示例>>C#>>正文


C# Engine.CreateRenderTarget方法代码示例

本文整理汇总了C#中Engine.CreateRenderTarget方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.CreateRenderTarget方法的具体用法?C# Engine.CreateRenderTarget怎么用?C# Engine.CreateRenderTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Engine的用法示例。


在下文中一共展示了Engine.CreateRenderTarget方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

        public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
            target2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);            
            effect = factory.GetEffect("glowPost",false,true);

            gbp = new GaussianBlurPostEffect();
            gbp.Init(ginfo, factory); 


        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:11,代码来源:GlowPostEffect.cs

示例2: Init

 public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {
     this.toon = factory.GetEffect("toon1",false,true);
     this.line = factory.GetEffect("LineDetection",false,true);
     this.cell = factory.GetTexture2D("Toon",true);            
     target = factory.CreateRenderTarget(ginfo.BackBufferWidth,ginfo.BackBufferHeight,SurfaceFormat.Color,ginfo.UseMipMap,DepthFormat.None,ginfo.MultiSample);
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:ToonPostEffect.cs

示例3: Init

 public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
 {           
     depht = factory.GetEffect("depth",false,true);
     target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight,SurfaceFormat.Color,
         ginfo.UseMipMap,DepthFormat.None,ginfo.MultiSample);
     be= new GaussianBlurPostEffect();
     be.Init(ginfo, factory); 
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:8,代码来源:DephtOfFieldPostEffect.cs

示例4: LoadContent

        public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, bool cullPointLight, bool useFloatingBufferForLightning)
        {
            _lightAddBlendState = new BlendState()
            {
                AlphaSourceBlend = Blend.One,
                ColorSourceBlend = Blend.One,
                AlphaDestinationBlend = Blend.One,
                ColorDestinationBlend = Blend.One,
            };
            this.ginfo = ginfo;
            shadow = new DirectionalShadowRenderer();
            shadow.ShadowFilteringType = filteringType;
            shadow.ShadowMapSize = shadowMapSize;
            shadow.SplitConstant = splitConstant;
            
            shadownBufferSize = ginfo.BackBufferWidth;
            shadowRT = factory.CreateRenderTarget(shadownBufferSize, shadownBufferSize, SurfaceFormat.Single, ginfo.UseMipMap,DepthFormat.Depth24Stencil8,ginfo.MultiSample);

            if (useFloatingBufferForLightning)
                lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.PreserveContents);
            else
                lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.PreserveContents);

            pointLightEffect = factory.GetEffect("PointLight",false,true);
            directionalLightEffect = factory.GetEffect("ShadowDirectionalCascade",false,true);
            spotLightEffect = factory.GetEffect("ShadowSpot",false,true);
            sphereModel = new SimpleModel(factory, "Dsphere", true);
            blank = factory.CreateTexture2DColor(1, 1, Color.White);

            rt = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight,SurfaceFormat.Color,ginfo.UseMipMap,DepthFormat.Depth24Stencil8,ginfo.MultiSample);
            deferredRT = factory.CreateRenderTarget(shadownBufferSize, shadownBufferSize, SurfaceFormat.Single,ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample);
            shadow.Load(factory,ginfo);

            switch (shadowFilterSpot)
            {
                case ShadowFilter.NONE:
                    spotLightEffect.CurrentTechnique = spotLightEffect.Techniques["Technique1"];
                    break;                
                case ShadowFilter.PCF3x3:
                    spotLightEffect.CurrentTechnique = spotLightEffect.Techniques["Technique2"];
                    break;             
                case ShadowFilter.PCF7x7SOFT:
                    spotLightEffect.CurrentTechnique = spotLightEffect.Techniques["Technique3"];
                    break;
                default:
                    break;
            }

        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:49,代码来源:ShadowLightMap.cs

示例5: LoadContent

        //EffectParameter PcolorMap;
        //EffectParameter PlightMap;

        #endregion

#region IDeferredFinalCombination Members


        public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, bool useFloatBuffer, bool saveToTexture )
        {
            this.useFloatBuffer = useFloatBuffer;
            this.ginfo = ginfo;
            this.saveToTexture = saveToTexture;
            finalCombineEffect = manager.GetAsset<Effect>("CombineFinal",true);
            PhalfPixel = finalCombineEffect.Parameters["halfPixel"];            
            PambientColor = finalCombineEffect.Parameters["ambientColor"];
            //PEXTRA1 = finalCombineEffect.Parameters["EXTRA1"];
            //PcolorMap = finalCombineEffect.Parameters["colorMap"];
            //PlightMap = finalCombineEffect.Parameters["lightMap"];
            

            PhalfPixel.SetValue(ginfo.HalfPixel);
            if (saveToTexture)
            {
                if (useFloatBuffer)
                    target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
                else
                    target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
            }                        
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:30,代码来源:FinalCombination.cs

示例6: Init

        public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);

            target2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);

            target3 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);

            effect = factory.GetEffect("SSAOPOST", false, true);
            ssaofinal = factory.GetEffect("ssaofinal", false, true);

            RandomTexture = factory.GetTexture2D("random", true);
            gbp = new GaussianBlurPostEffect();
            gbp.Init(ginfo, factory);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:15,代码来源:SSSAOPostEffect.cs

示例7: Init

        public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            
            Saturate = factory.GetEffect("Saturate",false,true);
            Saturate.Parameters["BloomThreshold"].SetValue(bloomThreshold);
            Combine = factory.GetEffect("Combine",false,true);

            renderTarget0 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight,SurfaceFormat.Color,ginfo.UseMipMap,DepthFormat.None,ginfo.MultiSample);
            renderTarget1 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
            
            gaussian = new GaussianBlurPostEffect();            
            gaussian.Init(ginfo,factory); 
            
        }  
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:14,代码来源:BloomPostEffect.cs

示例8: LoadContent

 public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, Color BackGroundColor,bool useFloatBuffer)
 {
     this.useFloatBuffer = useFloatBuffer;                                    
     normalRT = factory.CreateRenderTarget(ginfo.BackBufferWidth , ginfo.BackBufferHeight, SurfaceFormat.Color, false, DepthFormat.Depth24, 0, RenderTargetUsage.DiscardContents);
     depthRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, false, DepthFormat.Depth24, 0, RenderTargetUsage.DiscardContents);
     //lightOclusionRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);            
     clearBufferEffect = manager.GetAsset<Effect>("PrePass2/ClearGBuffer");
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:8,代码来源:PreGBuffer.cs

示例9: LoadContent

 public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, Color BackGroundColor, bool useFloatBuffer)
 {
     this.backGroundColor = BackGroundColor;
     colorRT2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, 8, RenderTargetUsage.DiscardContents);
     colorRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.DiscardContents);
     normalRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);
     depthRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, ginfo.UseMipMap, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);
     lightOclusionRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);            
     clearBufferEffect = manager.GetAsset<Effect>("ClearGBuffer",true);
     effect = factory.GetEffect("Effects//hibe");
     
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:12,代码来源:LightPrePassGBuffer.cs

示例10: Init

        public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            gblur = factory.GetEffect("gblur",true,true);
            if (useHalfSingleRenderTarget)
            {
                target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
            }
            else
            {
                target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
            }

            Vector2 texelSize = new Vector2(1f / ginfo.BackBufferWidth, 1f / ginfo.BackBufferHeight);
            SetBlurParameters(texelSize.X, 0, ref sampleOffsetsH, ref sampleWeightsH);
            SetBlurParameters(0, texelSize.Y, ref sampleOffsetsV, ref sampleWeightsV);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:16,代码来源:GaussianBlurPostEffect.cs

示例11: LoadContent

        public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, Color BackGroundColor,bool useFloatBuffer)
        {
            this.useFloatBuffer = useFloatBuffer;
            this.backGroundColor = BackGroundColor;
                        
            const int multisample = 0;
            colorRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, multisample, RenderTargetUsage.DiscardContents);
            normalRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);
            depthRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);
            lightOclusionRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);            
            clearBufferEffect = manager.GetAsset<Effect>("ClearGBuffer",true);

            clearBufferEffect.Parameters["BackColor"].SetValue(backGroundColor.ToVector3());
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:14,代码来源:GBuffer.cs

示例12: AfterLoadContent

        protected override void  AfterLoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
        {
            this.ginfo = ginfo;

            {
                if (ginfo.CheckIfRenderTargetFormatIsSupported(SurfaceFormat.HdrBlendable, DepthFormat.Depth24Stencil8, ginfo.UseMipMap, ginfo.MultiSample) == false)
                {
                    throw new NotSupportedException("The plataform does not support the specified Render target Combination for Deferred Rendering, check the logs for more info");
                }               
            }

            if (ginfo.CheckIfRenderTargetFormatIsSupported(SurfaceFormat.Color, DepthFormat.Depth24Stencil8, ginfo.UseMipMap, ginfo.MultiSample) == false)
            {
                throw new NotSupportedException("The plataform does not support the specified Render target Combination for Deferred Rendering, check the logs for more info");
            }

            if (ginfo.CheckIfRenderTargetFormatIsSupported(SurfaceFormat.Single, DepthFormat.Depth24Stencil8, false, 0) == false)
            {
                throw new NotSupportedException("The plataform does not support the specified Render target Combination for Deferred Rendering, check the logs for more info");
            }

            if (ginfo.CheckIfRenderTargetFormatIsSupported(SurfaceFormat.Single, DepthFormat.Depth24Stencil8, ginfo.UseMipMap, ginfo.MultiSample) == false)
            {
                ActiveLogger.LogMessage("Shadow can behave strange, you dont have the minimum requirements", LogLevel.Warning);
            }


            deferredGBuffer.LoadContent(manager, ginfo, factory, desc.BackGroundColor, true);
            deferredLightMap.LoadContent(manager, ginfo, factory, desc.CullPointLight,true);
            
            target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample);
            target2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample);
            scenerender = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample);

            PostEffectTarget = target;
            halfWidth = ginfo.Viewport.Width / 2;
            halfHeight = ginfo.Viewport.Height / 2;        
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:38,代码来源:PreRenderTechnic.cs

示例13: LoadContent

        public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, bool cullPointLight, bool useFloatingBufferForLightning)
        {
            this.ginfo = ginfo;
            this.cullPointLight = cullPointLight;
            if (useFloatingBufferForLightning)
            {
                lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
                samplerState = SamplerState.PointClamp;
            }
            else
            {
                lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
                samplerState = ginfo.SamplerState;
            }

            directionalLightEffect = manager.GetAsset<Effect>("PrePass2/DirectionalLight");
            pointLightEffect = manager.GetAsset<Effect>("PrePass2/PointLight");
            sphereModel = new SimpleModel(factory, "Models/Dsphere");
            spotLightEffect = manager.GetAsset<Effect>("PrePass2/SpotLight");
            
            spotLightEffect.Parameters["halfPixel"].SetValue(ginfo.HalfPixel);
            pointLightEffect.Parameters["halfPixel"].SetValue(ginfo.HalfPixel);

            DirectionalhalfPixel = directionalLightEffect.Parameters["halfPixel"];
            

            DirectionallightDirection = directionalLightEffect.Parameters["lightDirection"];
            DirectionalColor = directionalLightEffect.Parameters["Color"];
            DirectionallightIntensity = directionalLightEffect.Parameters["lightIntensity"];

            PointWordViewProjection = pointLightEffect.Parameters["wvp"];
            PointlightPosition = pointLightEffect.Parameters["lightPosition"];
            PointColor = pointLightEffect.Parameters["Color"];
            PointlightRadius = pointLightEffect.Parameters["lightRadius"];
            PointlightIntensity = pointLightEffect.Parameters["lightIntensity"];
            Pointquadratic = pointLightEffect.Parameters["quadratic"];
            PointcameraPosition = pointLightEffect.Parameters["cameraPosition"];

            _lightAddBlendState = new BlendState()
            {
                AlphaSourceBlend = Blend.One,
                ColorSourceBlend = Blend.One,
                AlphaDestinationBlend = Blend.One,
                ColorDestinationBlend = Blend.One,
            };
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:46,代码来源:PreLightMap.cs


注:本文中的Engine.CreateRenderTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。