コード例 #1
0
 public override void RenderMesh(Material material, FrameBuffer buffer)
 {
     foreach (Fragment fragment in fragments)
     {
         buffer.SetColor(fragment.x, fragment.y, Color4.black);
     }
 }
コード例 #2
0
        public override void RenderMesh(Material material, FrameBuffer buffer)
        {
            Texture        texture = material.texture;
            FragmentShader ps      = material.shader.ps;

            if (texture != null)
            {
                texture.BeginSample();
            }

            foreach (Fragment fragment in fragments)
            {
                Fragment fg = ps.Do(fragment, texture);

                if (fg.depth < buffer.GetDepth(fg.x, fg.y))
                {
                    buffer.SetDepth(fg.x, fg.y, fg.depth);
                    buffer.SetColor(fg.x, fg.y, fg.color);
                }
            }

            if (texture != null)
            {
                texture.EndSample();
            }
        }