UnityEngine.Rendering.CommandBuffer.DrawMesh C# (CSharp) Method

DrawMesh() private method

private DrawMesh ( Mesh mesh, Matrix4x4 matrix, Material material ) : void
mesh Mesh
matrix Matrix4x4
material Material
return void
        public void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material material)
        {
            MaterialPropertyBlock properties = null;
            int shaderPass = -1;
            int submeshIndex = 0;
            INTERNAL_CALL_DrawMesh(this, mesh, ref matrix, material, submeshIndex, shaderPass, properties);
        }

Same methods

CommandBuffer::DrawMesh ( Mesh mesh, Matrix4x4 matrix, Material material, [ submeshIndex, [ shaderPass, [ properties ) : void
CommandBuffer::DrawMesh ( Mesh mesh, Matrix4x4 matrix, Material material, int submeshIndex ) : void
CommandBuffer::DrawMesh ( Mesh mesh, Matrix4x4 matrix, Material material, int submeshIndex, int shaderPass ) : void

Usage Example

コード例 #1
0
    /// <summary>
    /// Sends render commands to native code
    /// </summary>
    public static void RenderOnscreen(Noesis.View view, bool flipY, UnityEngine.Rendering.CommandBuffer commands)
    {
        // This is a workaround for a bug in Unity. When rendering nothing Unity sends us an empty MTLRenderCommandEncoder
        if (UnityEngine.SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Metal)
        {
            if (_dummyMesh == null)
            {
                _dummyMesh             = new UnityEngine.Mesh();
                _dummyMesh.vertices    = new UnityEngine.Vector3[3];
                _dummyMesh.vertices[0] = new UnityEngine.Vector3(0, 0, 0);
                _dummyMesh.vertices[1] = new UnityEngine.Vector3(0, 0, 0);
                _dummyMesh.vertices[2] = new UnityEngine.Vector3(0, 0, 0);
                _dummyMesh.triangles   = new int[3] {
                    0, 2, 1
                };
            }

            if (_dummyMaterial == null)
            {
                _dummyMaterial = new UnityEngine.Material(UnityEngine.Shader.Find("UI/Default"));
            }

            commands.DrawMesh(_dummyMesh, new UnityEngine.Matrix4x4(), _dummyMaterial);
        }

        commands.IssuePluginEventAndData(_renderOnscreenCallback, flipY ? 1 : 0, view.CPtr.Handle);
    }
All Usage Examples Of UnityEngine.Rendering.CommandBuffer::DrawMesh