Component:RenderTransformOverride: Difference between revisions

From Resonite Wiki
Move details about automatic addition on avatars to top description. Moved Bugs header below examples and made into bullet point list.
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The RenderTransformOverride component is used to scale, transform or rotate a [[SkinnedMeshRenderer (Component) | SkinnedMeshRenderer]] following a specific context.
{{Infobox Component
|Image=RenderTransformOverrideComponent.png
|Name=Render Material Override
}}
The RenderTransformOverride component is used to transform, rotate or scale a [[Slot]] following a specific [[Type:RenderingContext|rendering context]].  


It can be used, for instance, to scale a player's head to zero locally to effectively hide it from the user's view while it still being visible in mirrors, cameras and by other players.
It can be used, for instance, to scale a player's head to zero locally to effectively hide it from the user's view while it still being visible in mirrors, cameras and by other players.


It is suspected that this component is currently the cause of multiple crashes<ref>[https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/269 forceMatrixRecalculationPerRender causes RenderTransformOverride to cause a Unity crash #269]</ref>, though it was improved in [[Beta 2024.1.12.1336]]. Until those crashes are solved, it is recommended to use the [[AvatarRenderSettings (Component) | AvatarRenderSettings]] component for avatar operations.
This component is automatically added to all [[Avatar|Avatars]] on the Head [[Type:BodyNode|BodyNode]] by the [[Component:AvatarUserViewHeadOverride|AvatarUserViewHeadOverride]] component. It will also setup drives for Enabled, PositionOverride, and RotationOverride.


== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Context|Context|
|Context|RenderingContext|The Context when rendering from to apply this override.|PositionOverride|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Float3|Float3]]&gt;'''|TypeAdv1=true|If not null, will override the position of the slot this component is on.|RotationOverride|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:FloatQ|FloatQ]]&gt;'''|TypeAdv2=true|If not null, will override the rotation of the slot this component is on.|ScaleOverride|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Float3|Float3]]&gt;'''|TypeAdv3=true|If not null, will override the scale of the slot this component is on.|SkinnedMeshRenderers|{{RootFieldType|SyncRefList`1|[[Component:SkinnedMeshRenderer|SkinnedMeshRenderer]]}}|TypeAdv4=true|List of SkinnedMeshRenderers that need to be recalculated and overridden.}}
|PositionOverride|Float3|
 
|RotationOverride|FloatQ|
== Examples ==
|ScaleOverride|Float3|
[[File:ModifiedRTO.png|400px|thumb|left|A modified default]]
|SkinnedMeshRenderers|List`SkinnedMeshRenderers|
A RenderTransformOverride is automatically added to avatars and is located on the head bodynode slot. You can expand what gets automatically included to also hide the head from your viewpoint by enabling the Scale option with the values all set to 0. Do note that this will affect the shadow of your avatar from your own viewpoint while in first person.
}}
 
== Bugs ==
 
* This component has a very small chance to increase the frequency of crashes.<ref>https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/269</ref>
* This component might not function correctly if there are any Null fields in the SkinnedMeshRenderers list.<ref>https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2474</ref>
* This component currently has an imprecise understanding of the UserView context and will be active while an item is grabbed or when saving a thumbnail to the inventory.<ref>https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3732</ref>
* This component will cause motion blur to be very visible on object when looking through a cameras or in a mirror.<ref>https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1654</ref>
 
== Notes ==
<references />
 
 
 


[[Category:Components:Rendering]]
[[Category:Components:Rendering{{#translation:}}|Render Transform Override]]
[[Category:ComponentStubs]]
[[Category:Components{{#translation:}}|Render Transform Override]]

Latest revision as of 12:40, 11 March 2025

Component image 
Render Material Override component as seen in the Scene Inspector

The RenderTransformOverride component is used to transform, rotate or scale a Slot following a specific rendering context.

It can be used, for instance, to scale a player's head to zero locally to effectively hide it from the user's view while it still being visible in mirrors, cameras and by other players.

This component is automatically added to all Avatars on the Head BodyNode by the AvatarUserViewHeadOverride component. It will also setup drives for Enabled, PositionOverride, and RotationOverride.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
Context RenderingContext The Context when rendering from to apply this override.
PositionOverride Nullable`1<Float3> If not null, will override the position of the slot this component is on.
RotationOverride Nullable`1<FloatQ> If not null, will override the rotation of the slot this component is on.
ScaleOverride Nullable`1<Float3> If not null, will override the scale of the slot this component is on.
SkinnedMeshRenderers list of SkinnedMeshRenderer List of SkinnedMeshRenderers that need to be recalculated and overridden.

Examples

A modified default

A RenderTransformOverride is automatically added to avatars and is located on the head bodynode slot. You can expand what gets automatically included to also hide the head from your viewpoint by enabling the Scale option with the values all set to 0. Do note that this will affect the shadow of your avatar from your own viewpoint while in first person.

Bugs

  • This component has a very small chance to increase the frequency of crashes.[1]
  • This component might not function correctly if there are any Null fields in the SkinnedMeshRenderers list.[2]
  • This component currently has an imprecise understanding of the UserView context and will be active while an item is grabbed or when saving a thumbnail to the inventory.[3]
  • This component will cause motion blur to be very visible on object when looking through a cameras or in a mirror.[4]

Notes