Class EntitiesGraphicsSystem
Renders all entities that contain both RenderMesh and LocalToWorld components.
Inherited Members
Namespace: Unity.Rendering
Assembly: Unity.Entities.Graphics.dll
Syntax
[WorldSystemFilter(WorldSystemFilterFlags.Default|WorldSystemFilterFlags.Editor, WorldSystemFilterFlags.Default)]
[UpdateInGroup(typeof(PresentationSystemGroup))]
[UpdateAfter(typeof(UpdatePresentationSystemGroup))]
[BurstCompile]
public class EntitiesGraphicsSystem : SystemBase
Properties
EntitiesGraphicsEnabled
Toggles the activation of EntitiesGraphicsSystem.
Declaration
public static bool EntitiesGraphicsEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
To disable this system, use the HYBRID_RENDERER_DISABLED define.
MaxBytesPerBatch
The maximum GPU buffer size (in bytes) that a batch can access.
Declaration
public static int MaxBytesPerBatch { get; }
Property Value
Type | Description |
---|---|
int |
Stats
Declaration
public EntitiesGraphicsStats Stats { get; }
Property Value
Type | Description |
---|---|
EntitiesGraphicsStats |
Methods
GetMaterial(BatchMaterialID)
Returns the Material that corresponds to the given registered material ID, or null
if no such material exists.
Declaration
public Material GetMaterial(BatchMaterialID material)
Parameters
Type | Name | Description |
---|---|---|
BatchMaterialID | material | A material ID received from RegisterMaterial(Material). |
Returns
Type | Description |
---|---|
Material | The Material object corresponding to the given material ID if the ID is valid, or |
GetMesh(BatchMeshID)
Returns the Mesh that corresponds to the given registered mesh ID, or null
if no such mesh exists.
Declaration
public Mesh GetMesh(BatchMeshID mesh)
Parameters
Type | Name | Description |
---|---|---|
BatchMeshID | mesh | A mesh ID received from RegisterMesh(Mesh). |
Returns
Type | Description |
---|---|
Mesh | The Mesh object corresponding to the given mesh ID if the ID is valid, or |
RegisterMaterial(Material)
Registers a material with the Entities Graphics System.
Declaration
public BatchMaterialID RegisterMaterial(Material material)
Parameters
Type | Name | Description |
---|---|---|
Material | material | The material instance to register |
Returns
Type | Description |
---|---|
BatchMaterialID | Returns the batch material ID |
RegisterMaterialPropertyType(Type, string, short)
Registers a material property type with the given name.
Declaration
public static void RegisterMaterialPropertyType(Type type, string propertyName, short overrideTypeSizeGPU = -1)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type of material property to register. |
string | propertyName | The name of the property. |
short | overrideTypeSizeGPU | An optional size of the type on the GPU. |
RegisterMaterialPropertyType<T>(string, short)
A templated version of the material type registration method.
Declaration
public static void RegisterMaterialPropertyType<T>(string propertyName, short overrideTypeSizeGPU = -1) where T : IComponentData
Parameters
Type | Name | Description |
---|---|---|
string | propertyName | The name of the property. |
short | overrideTypeSizeGPU | An optional size of the type on the GPU. |
Type Parameters
Name | Description |
---|---|
T | The type of material property to register. |
RegisterMesh(Mesh)
Registers a mesh with the Entities Graphics System.
Declaration
public BatchMeshID RegisterMesh(Mesh mesh)
Parameters
Type | Name | Description |
---|---|---|
Mesh | mesh | Mesh instance to register |
Returns
Type | Description |
---|---|
BatchMeshID | Returns the batch mesh ID |
UnregisterMaterial(BatchMaterialID)
Unregisters a material from the Entities Graphics System.
Declaration
public void UnregisterMaterial(BatchMaterialID material)
Parameters
Type | Name | Description |
---|---|---|
BatchMaterialID | material | Material ID received from RegisterMaterial(Material) |
UnregisterMesh(BatchMeshID)
Unregisters a mesh from the Entities Graphics System.
Declaration
public void UnregisterMesh(BatchMeshID mesh)
Parameters
Type | Name | Description |
---|---|---|
BatchMeshID | mesh | A mesh ID received from RegisterMesh(Mesh). |