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


C# PloobsEngine.RenderBatch方法代码示例

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


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

示例1: Draw

 protected override void Draw(Microsoft.Xna.Framework.GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList<PloobsEngine.Light.ILight> lights)
 {
        render.PushBlendState(laser_blends);
        effect.CurrentTechnique = effect_technique;                            
        world.SetValue(obj.WorldMatrix);
        wvp.SetValue(shader_matrices_combined[1] = obj.WorldMatrix * cam.View * cam.Projection);
        effect_color.SetValue(color.ToVector4());
        effect_center_to_viewer.SetValue(cam.Position);
        render.RenderBatch(obj.Modelo.GetBatchInformation(0)[0], effect);
        render.PopBlendState();
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:11,代码来源:BoltShader.cs

示例2: PosDrawPhase

 public override void PosDrawPhase(GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList<PloobsEngine.Light.ILight> lights)
 {
     Matrix wld = obj.WorldMatrix;
     for (int i = 0; i < obj.Modelo.MeshNumber; i++)
     {
         BatchInformation[] bi = obj.Modelo.GetBatchInformation(i);
         for (int j = 0; j < bi.Count(); j++)
         {                                       
             this._shader2.Parameters["DiffuseMap"].SetValue(obj.Modelo.GetTextureInformation(i)[j].getTexture(TextureType.DIFFUSE));
             Matrix w1 = Matrix.Multiply(bi[j].ModelLocalTransformation, wld);
             this._shader2.Parameters["worldViewProjection"].SetValue(w1 * cam.ViewProjection);
             this._shader2.Parameters["lightSamplerBuffer"].SetValue(render[PrincipalConstants.lightRt]);
             this._shader2.Parameters["LightBufferPixelSize"].SetValue(new Vector2(0.5f / render[PrincipalConstants.lightRt].Width, 0.5f / render[PrincipalConstants.lightRt].Height));
             render.RenderBatch(bi[j], _shader2);
         }
     }       
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:17,代码来源:PrePassShader.cs

示例3: Draw

        protected override void Draw(Microsoft.Xna.Framework.GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList<PloobsEngine.Light.ILight> lights)
        {
            this._shader.Parameters["FarClip"].SetValue(cam.FarPlane);
            this._shader.Parameters["View"].SetValue(cam.View);
            this._shader.Parameters["Projection"].SetValue(cam.Projection);            

            Matrix wld = obj.WorldMatrix;
            for (int i = 0; i < obj.Modelo.MeshNumber; i++)
            {
                BatchInformation[] bi = obj.Modelo.GetBatchInformation(i);
                for (int j = 0; j < bi.Count(); j++)
                {
                    
                    Matrix w1 = Matrix.Multiply(bi[j].ModelLocalTransformation, wld);
                    this._shader.Parameters["World"].SetValue(w1);
                    this._shader.Parameters["VPIT"].SetValue(Matrix.Transpose(Matrix.Invert(w1 * cam.View)));
                    render.RenderBatch(bi[j], _shader);
                }
            }
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:20,代码来源:PrePassShader.cs

示例4: PosDrawPhase

        public override void PosDrawPhase(GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList<PloobsEngine.Light.ILight> lights)
        {
            render.PushRasterizerState(cullMode);
            render.PushBlendState(BlendState.NonPremultiplied);
            alphagradative.Parameters["camCenter"].SetValue(cam.Position);

            for (int i = 0; i < obj.Modelo.MeshNumber; i++)
            {
                BatchInformation[] bi = obj.Modelo.GetBatchInformation(i);

                for (int j = 0; j < bi.Count(); j++)
                {
                    alphagradative.Parameters["colorMap"].SetValue(obj.Modelo.getTexture(TextureType.DIFFUSE, i, j));
                    Matrix w1 = Matrix.Multiply(obj.WorldMatrix, bi[j].ModelLocalTransformation);
                    alphagradative.Parameters["wvp"].SetValue(w1 * cam.ViewProjection);
                    alphagradative.Parameters["w"].SetValue(w1);

                    render.RenderBatch(bi[j], alphagradative);
                }
            }
            render.PopBlendState();
            render.PopRasterizerState();         
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:23,代码来源:ForwardGradativeAlphaShader.cs


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