Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

EditorGraphicsSettings.defaultMeshBufferTarget

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static DefaultMeshBufferTarget defaultMeshBufferTarget;

Description

The default GPU buffer target that Unity applies to the vertex and index buffers of meshes.

This property corresponds to the Default Mesh Buffer Target setting in the Graphics section of the Project Settings window.

The default value is DefaultMeshBufferTarget.None.

When the value is DefaultMeshBufferTarget.None, Unity adds compute access only to mesh buffers that require it. You can’t choose which target Unity applies; Unity selects either a raw or structured target depending on the platform and graphics API.

When the value is DefaultMeshBufferTarget.Raw, Unity creates the vertex and index buffers of every mesh with GraphicsBuffer.Target.Raw, so compute shaders and ray tracing shaders can access mesh data without Unity recreating the buffers with a different target.

This setting only takes effect on platforms that support compute shaders. When you change this value, Unity recreates the GPU resources of all loaded meshes.

You can’t change this property while in Play mode. If you try to change it in Play mode, Unity throws an InvalidOperationException.