-
-
Notifications
You must be signed in to change notification settings - Fork 2
Mirror
class in ExPresSXR.Interaction / Extends MonoBehaviour
GameObject instantiable via ExPresSXRMirror
Represents a mirror for a given camera using a RenderTexture. Allows auto generation of RenderTextures with given aspect ratio and resolution but also providing your own RenderTexture for using it further.
Supports tinting or brghtening the mirror and overlaying a (dirty) texture to make it seem more real.
For the mirror to work with AOI Raycasts a AreaOfInteresBouncer
-Component must be added to the MirrorPlane
and it's Layer must be set to AreaOfInteresBouncer
. This is already the case for the instantiable Mirror.
Make sure that the mirror's scale is set to 1 as this might cause weird behavior.
Be aware that this mirror does add distortion which does not really matter if not used together with AreaOfInterestRay-Bounces. For such cases (or just accurate mirrors) the payed plugin Mirrors and Reflections for VR is the way to go.
-
Transform _trackedTarget
: Target for which the mirror effect is simulated. It should be best set to the Camera of an XR Rig. -
Camera _mirrorCamera
: Reference to the Mirror's Camera.
-
Vector2 pixelRatio
: Aspect ratio of the mirror plane in px. Default Value:(1080, 1080)
. -
float resolutionPct
: Resolution of the mirror in percentage. Scales the amount of pixels of the aspect ratio, higher values might impact performance. Must be in range [0, 1]. Default value:1.0f
. -
bool provideCustomRenderTexture
: If enabled require providing a custom RenderTexture. Else it will be generated automatically. -
RenderTexture customRenderTexture
: The RenderTexture that is used when 'provideCustomRenderTexture' is enabled. -
Texture overlayTexture
: Texture that is laid over the mirror to make it look more realistic (e.g. dirt, fingerprints, ...). Some example textures can be found at 'ExPresS XR/Sprites/Mirror/'. -
float overlayStrength
: Strength of the effect applied by the overlayTexture. Must be in range [0, 1]. Default Value:0.5f
. -
Color tintColor
: Color that is mixed with the displayed image to change it's color. Use white for no tinting. Default Value:Color.white
. -
float brighteningFactor
: Factor that shifts the bightness the displayed image. Must be in range [0, 1]. Default Value:0.0f
. -
Transform _trackedTarget
: Target for which the mirror effect is simulated. It should be best set to the Camera of an XR Rig. -
Transform mirrorPlane
: Reference to the Mirror's Plane. -
readonly
Transform mirrorPlane
: The RenderTexture currently used for the mirror. -
readonly
Vector2 actualPixelResultion
: The pixel size of the currently used RenderTexture. Returns (0,0) if no texture is set. -
readonly
Material mirrorMaterial
: The material used to display the RenderTexture.
-
int RENDER_TEXTURE_DEPTH = 16
: Render Texture Depth of the generated RenderTexture.
Autor: Luca 'eisclimber' Dreiling; License: MIT
- Getting Started
- Development and Contribution
- Misc
- Experimentation
- Data Gatherering
- Eye Tracking
- ExPresS XR Rig
- Interaction
- Base Button
- Button Quiz
- Collision Hand Rumbler
- Collision Sound Emitter
- Exit Game Interactable (Script Deprecated)
- Interactables
- Haptic Impulse Trigger
- Socket Interactors
- Inverse Kinematics
- Localization
- Minigames
- Coin Scale
- Coin Throw
- Sword Cleaning
- Misc
- Movement
- Presentation
- UI