コード例 #1
0
        /// 描画処理
        public override bool DoDraw2(DemoGame.GraphicsDevice graphDev, Vector3 BasePos)
        {
            //       useMdlHdl.Render( graphDev, baseMtx * Matrix4.Scale(new Vector3(0.15f, 0.15f, 0.15f)) );

//        Matrix4 mtx = GetBoneMatrix( 2 );
//        Common.VectorUtil.Set( ref BodyPos, mtx.M41, mtx.M42, mtx.M43 );
//        boundingShape.SetMult( mtx );

            var currentMatrix = CalcSpriteMatrix(graphDev.GetCurrentCamera().Pos, BasePos);
            var worldViewProj = graphDev.GetCurrentCamera().Projection *graphDev.GetCurrentCamera().View *currentMatrix;

            spriteShader.SetUniformValue(0, ref worldViewProj);

            graphDev.Graphics.SetShaderProgram(spriteShader);
            graphDev.Graphics.SetVertexBuffer(0, vertices);
            graphDev.Graphics.SetTexture(0, StaticDataList.textureUnified);

//		graphDev.Graphics.Enable(EnableMode.Blend);
//        graphDev.Graphics.SetBlendFunc(BlendFuncMode.Add, BlendFuncFactor.SrcAlpha, BlendFuncFactor.OneMinusSrcAlpha);

            graphDev.Graphics.Disable(EnableMode.DepthTest);
            graphDev.Graphics.Enable(EnableMode.CullFace);
            graphDev.Graphics.SetCullFace(CullFaceMode.Back, CullFaceDirection.Ccw);
            graphDev.Graphics.DrawArrays(DrawMode.TriangleFan, 0, 4);

            return(true);
        }
コード例 #2
0
        /// 描画処理
        public override bool DoDraw2(DemoGame.GraphicsDevice graphDev, Vector3 BasePos)
        {
            var currentMatrix = CalcSpriteMatrix(graphDev.GetCurrentCamera().Pos, BasePos);
            var worldViewProj = graphDev.GetCurrentCamera().Projection *graphDev.GetCurrentCamera().View *currentMatrix;

            spriteShader.SetUniformValue(0, ref worldViewProj);

            graphDev.Graphics.SetShaderProgram(spriteShader);
            graphDev.Graphics.SetVertexBuffer(0, vertices);
            graphDev.Graphics.SetTexture(0, StaticDataList.textureUnified);

            graphDev.Graphics.Enable(EnableMode.CullFace);
            graphDev.Graphics.SetCullFace(CullFaceMode.Front, CullFaceDirection.Ccw);
            graphDev.Graphics.Disable(EnableMode.DepthTest);
            graphDev.Graphics.DrawArrays(DrawMode.TriangleFan, 0, 4);
            if (TexIdForText < 3)
            {
                if (appearCount == (int)Data.SetupValue.AppearAndLeaveTime && deadflag2 == false)
                {
                    ObjTex.changeText();
                }
                ObjTex.Draw2(graphDev, BasePos);
            }
            return(true);
        }
コード例 #3
0
 /// 描画
 public override bool Draw(DemoGame.GraphicsDevice graphDev)
 {
     if (objMark.TypeId == 0)
     {
         SetBillboardMatrix(graphDev.GetCurrentCamera());
     }
     else
     {
         SetBillboardMatrixY(graphDev.GetCurrentCamera());
     }
     objMark.Draw(graphDev);
     return(true);
 }
コード例 #4
0
        /// 描画処理
        public override bool DoDraw(DemoGame.GraphicsDevice graphDev)
        {
            if (billFlg == true)
            {
                SetBillboardMatrix(graphDev.GetCurrentCamera());
            }
            else if (billYFlg == true)
            {
                SetBillboardMatrixY(graphDev.GetCurrentCamera());
            }

            objEff.Draw(graphDev);
            return(true);
        }
コード例 #5
0
ファイル: ObjChHobit.cs プロジェクト: hatano0x06/Coroppoxus
        /// 描画処理
        public override bool DoDraw2(DemoGame.GraphicsDevice graphDev, Vector3 BasePos)
        {
            CalcSpriteMatrix(graphDev.GetCurrentCamera().Pos, BasePos);
            ctrlResMgr.SetSpriteData(BasePos, rotation, uvPos, uvSize, texSize);

            return(true);
        }
コード例 #6
0
ファイル: ObjChWall.cs プロジェクト: hatano0x06/Coroppoxus
        /// 描画処理
        public override bool DoDraw2(DemoGame.GraphicsDevice graphDev, Vector3 BasePos)
        {
            var currentMatrix = CalcSpriteMatrix(graphDev.GetCurrentCamera().Pos, BasePos);
            var worldViewProj = graphDev.GetCurrentCamera().Projection *graphDev.GetCurrentCamera().View *currentMatrix;

            spriteShader.SetUniformValue(0, ref worldViewProj);

            graphDev.Graphics.SetShaderProgram(spriteShader);
            graphDev.Graphics.SetVertexBuffer(0, vertices);
            graphDev.Graphics.SetTexture(0, StaticDataList.textureUnified);

            graphDev.Graphics.Enable(EnableMode.CullFace);
            graphDev.Graphics.SetCullFace(CullFaceMode.None, CullFaceDirection.Ccw);
            graphDev.Graphics.Disable(EnableMode.DepthTest);
            graphDev.Graphics.DrawArrays(DrawMode.TriangleFan, 0, 4);

            return(true);
        }
コード例 #7
0
ファイル: ShapeFrustum.cs プロジェクト: hatano0x06/Coroppoxus
/// デバック用
///---------------------------------------------------------------------------

        /// デバック用:描画
        public void Draw(DemoGame.GraphicsDevice graphDev, Rgba color)
        {
            DemoGame.RenderGeometry drawTri = new DemoGame.RenderGeometry();
            drawTri.MakeTriangle();

            DemoGame.Camera camera = graphDev.GetCurrentCamera();

            for (int i = 0; i < EntryNum; i++)
            {
                drawTri.DrawTriangle(graphDev.Graphics, Triangle[i], camera, color);
            }

            drawTri = null;
        }
コード例 #8
0
ファイル: ShapeSphere.cs プロジェクト: hatano0x06/Coroppoxus
/// private メソッド
///---------------------------------------------------------------------------



/// デバック用
///---------------------------------------------------------------------------

        /// デバック用:描画
        public void Draw(DemoGame.GraphicsDevice graphDev, int hitIdx, Rgba color1, Rgba color2)
        {
            DemoGame.RenderGeometry drawSph = new DemoGame.RenderGeometry();
            drawSph.MakeSphere();

            DemoGame.Camera camera = graphDev.GetCurrentCamera();

            if (hitIdx < 0)
            {
                drawSph.DrawSphere(graphDev.Graphics, this.Sphre, camera, color1);
            }
            else
            {
                drawSph.DrawSphere(graphDev.Graphics, this.Sphre, camera, color2);
            }

            drawSph = null;
        }
コード例 #9
0
        internal void DrawSprites(DemoGame.GraphicsDevice graphDev)
        {
            FrameBuffer fbuffer = graphicsContext.GetFrameBuffer();
//		Matrix4 projection = Matrix4.Ortho( 0, fbuffer.Width, fbuffer.Height, 0, -100.0f, 100.0f ) ;
            float   aspect     = graphicsContext.Screen.AspectRatio;
            float   fov        = FMath.Radians(45.0f);
            Matrix4 projection = graphDev.GetCurrentCamera().ViewProjection;

//		graphicsContext.Enable( EnableMode.Blend ) ;
            graphDev.Graphics.Enable(EnableMode.CullFace);
            graphDev.Graphics.SetCullFace(CullFaceMode.None, CullFaceDirection.Ccw);
            graphDev.Graphics.Disable(EnableMode.DepthTest);
            graphicsContext.SetVertexBuffer(0, vertexBuffer);
            for (var sprite = drawList; sprite != null; sprite = sprite.drawNext)
            {
                var material = sprite.Material;
                graphicsContext.SetShaderProgram(material.ShaderProgram);
                material.ShaderProgram.SetUniformValue(0, ref projection);
                graphicsContext.SetBlendFunc(material.BlendFunc);
                graphicsContext.SetTexture(0, material.Texture);
                int next = (sprite.drawNext == null) ? indexCount : sprite.drawNext.indexID;
                graphicsContext.DrawArrays(DrawMode.Triangles, sprite.indexID, next - sprite.indexID);
            }
        }