ITagSet RenderTags { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The RenderTags property of the SceneCamera class specifies which scene objects should be rendered by the camera based on their tags. Only objects that have at least one of the specified tags in this set will be rendered. This allows for selective rendering of objects in the scene, which can be useful for optimizing performance or creating specific visual effects.

Usage

To use the RenderTags property, you can assign it a set of tags that you want the camera to render. This is done by creating an instance of a class that implements the ITagSet interface and adding the desired tags to it. Once set, the camera will only render objects that have at least one of these tags.

Example

// Example of setting RenderTags for a SceneCamera
SceneCamera camera = new SceneCamera();

// Create a tag set and add desired tags
ITagSet renderTags = new TagSet();
renderTags.Add("Player");
renderTags.Add("Enemy");

// Assign the tag set to the camera's RenderTags property
camera.RenderTags = renderTags;

// Now, the camera will only render objects tagged with "Player" or "Enemy".