VR Tunnelling Pro
Plug-and-Play VR Comfort
Sigtrap.VrTunnellingPro.TunnellingBase Class Reference

Description

Base class for all Tunnelling effects.
Calculates motion parameters and contains shared settings.

Inheritance diagram for Sigtrap.VrTunnellingPro.TunnellingBase:
Sigtrap.VrTunnellingPro.TunnellingImageBase Sigtrap.VrTunnellingPro.TunnellingMobile Sigtrap.VrTunnellingPro.Tunnelling Sigtrap.VrTunnellingPro.TunnellingOpaque

Public Member Functions

virtual void ResetCounterMotion ()
 Reset cage and skybox orientation/offset when using counter motion. More...
 

Static Public Member Functions

static Vector3 SmoothDampAngle (Vector3 current, Vector3 target, ref Vector3 vel, float smoothTime, float maxSpeed, float dT)
 

Public Attributes

const string GLOBAL_PROP_FOGCOLOR = "_VRTP_Cage_FogColor"
 Global shader parameter controlling fog color in shaders using CageFog.cginc. More...
 
const string GLOBAL_PROP_FOGDENSITY = "_VRTP_Cage_FogDensity"
 Global shader parameter controlling fog density in shaders using CageFog.cginc. More...
 
const string GLOBAL_PROP_FOGPOWER = "_VRTP_Cage_FogPower"
 Global shader parameter controlling fog falloff in shaders using CageFog.cginc. More...
 
const string GLOBAL_PROP_FOGBLEND = "_VRTP_Cage_FogBlend"
 Global shader parameter controlling fog strength in shaders using CageFog.cginc. More...
 
const float FEATHER_MAX = 0.5f
 
const float MOTION_STRENGTH_MAX = 2f
 
const float COUNTER_STRENGTH_MAX = 2f
 
const int FPSDIV_MAX = 60
 
Transform motionTarget
 Motion calculated using this Transform. Generally shouldn't use HMD. More...
 
Color effectColor = Color.black
 Colour of vignette. Alpha is blend factor.
If applyColorToBackground true, will affect background of advanced modes. More...
 
float effectCoverage = 0.75f
 Maximum screen coverage. More...
 
float effectFeather = 0.1f
 Feather around cut-off as fraction of screen. More...
 
Cubemap effectSkybox
 Skybox to apply to vignette.
Requires skybox mode to be enabled (varies depending upon effect). More...
 
bool applyColorToBackground = false
 Depending upon effect mode, causes effectColor to affect background.
Basic vignette mode always uses effectColor. More...
 
bool useAngularVelocity = true
 Add angular velocity to effect strength? Helps players with regular sim-sickness. More...
 
float angularVelocityStrength = 1
 Strength contributed to effect by angular velocity. More...
 
float angularVelocityMin = 0
 No effect contribution below this angular velocity. Degrees per second More...
 
float angularVelocityMax = 180
 Clamp effect contribution above this angular velocity. Degrees per second More...
 
float angularVelocitySmoothing = 0.15f
 Smoothing time for angular velocity calculation. 0 for no smoothing More...
 
bool useAcceleration = false
 Add linear acceleration to effect strength? Helps players with moderate sim-sickness. More...
 
float accelerationStrength = 1
 Strength contributed to effect by linear acceleration. More...
 
float accelerationMin
 No effect contribution below this acceleration. Metres per second squared More...
 
float accelerationMax
 Clamp effect contribution above this acceleration. Metres per second squared More...
 
float accelerationSmoothing = 0.15f
 Smoothing time for acceleration calculation. 0 for no smoothing More...
 
bool useVelocity = false
 Add translation velocity to effect strength? Helps players with strong sim-sickness. More...
 
float velocityStrength = 1
 Strength contributed to effect by linear velocity. More...
 
float velocityMin
 No effect contribution below this velocity. Metres per second More...
 
float velocityMax
 Clamp effect contribution above this velocity. Metres per second More...
 
float velocitySmoothing = 0.15f
 Smoothing time for velocity calculation. 0 for no smoothing More...
 
ForceVignetteMode forceVignetteMode
 How to combine forceVignetteValue with motion value to calculate effect radius. More...
 
float forceVignetteValue
 Force effect to be this value.
Combined with motion value according to forceVignetteMode. More...
 
Transform motionEffectTarget = null
 Transform used for artificial tilt and framerate division.
Should be a child of Motion Target and a parent of the HMD.
Target's transform should not be modified by anything else. More...
 
bool useCounterMotion = false
 Counter-motion moves/rotates cage/skybox opposite to motionTarget motion. More...
 
float counterRotationStrength = 1f
 Scale counter-rotation relative to motionTarget motion. More...
 
Vector3 counterRotationPerAxis = Vector3.up
 Scale counter-rotation on individual axes.
Multiplied by counterVelocityStrength.
X: Pitch, Y: Yaw, Z: Roll. More...
 
bool useArtificialTilt = false
 Artifically tilt the camera when moving to simulate acceleration forces. More...
 
float tiltStrength = 0f
 Strength of artificial tilt relative to linear acceleration.
Degrees per (metres per second squared). More...
 
Vector2 tiltMaxAngles = 5*Vector2.one
 Maximum artificial tilt in degrees. Zero for no clamp.
X: Pitch, Y: Roll. More...
 
float tiltSmoothTime = 0f
 Smooth out tilt over this time. More...
 
int framerateDivision = 1
 Divide VR framerate by this number while keeping HMD and cage at device framerate.
Forces stepped motion of motionEffectTarget rather than changing rendering.
More...
 
bool divideTranslation = true
 Apply framerateDivision division to linear motion. More...
 
bool divideRotation = true
 Apply framerateDivision division to rotation. More...
 

Properties

bool usingMotionEffectTarget [get]
 Indicates whether the motionEffectTarget is currently being used for motion effects. More...
 

Public Types

enum  BackgroundMode {
  BackgroundMode.COLOR, BackgroundMode.SKYBOX, BackgroundMode.CAGE_COLOR, BackgroundMode.CAGE_SKYBOX,
  BackgroundMode.CAGE_ONLY, BackgroundMode.BLUR
}
 Determines what is drawn over the periphery in the vignetted region. More...
 
enum  MaskMode { MaskMode.OFF, MaskMode.MASK, MaskMode.WINDOW, MaskMode.PORTAL }
 Determines whether and how objects can mask the vignette. More...
 
enum  MSAA {
  MSAA.AUTO, MSAA.OFF, MSAA.X2, MSAA.X4,
  X8
}
 Antialiasing modes for cage RenderTexture. More...
 
enum  ForceVignetteMode {
  ForceVignetteMode.NONE = 0, ForceVignetteMode.CONSTANT = 10, ForceVignetteMode.MAX = 20, ForceVignetteMode.MIN = 30,
  ADD = 40
}
 How to calculate effect radius according to motion and force effect value. More...
 

Member Enumeration Documentation

◆ BackgroundMode

Determines what is drawn over the periphery in the vignetted region.

Enumerator
COLOR 

Vignette uses a simple color.

SKYBOX 

Vignette uses a skybox.

CAGE_COLOR 

Vignette reveals a 3D sub-scene to provide a static "cage" for static reference. Cage scene has a solid backgorund color.

CAGE_SKYBOX 

Vignette reveals a 3D sub-scene to provide a static "cage" for static reference. Cage scene has a skybox background.

CAGE_ONLY 

Vignette reveals a 3D sub-scene to provide a static "cage" for static reference. Cage scene has a transparent background and is composited on top of the main scene.

BLUR 

Vignette blurs, rather than replaces, the periphery.

◆ ForceVignetteMode

How to calculate effect radius according to motion and force effect value.

Enumerator
NONE 

summary>Do not force effect value

summary>Ignore motion and force effect value

CONSTANT 

summary>Take the maximum of force value and motion value

MAX 

summary>Take the minimum of force value and motion value

MIN 

summary>Add force effect value and motion value

◆ MaskMode

Determines whether and how objects can mask the vignette.

Enumerator
OFF 

No masking used.

MASK 

Vignette is excluded by mask objects.

WINDOW 

Background is always shown except through mask objects.

PORTAL 

Background is always shown but only through mask objects - inverted WINDOW mode.

◆ MSAA

Antialiasing modes for cage RenderTexture.

Enumerator
AUTO 

summary>Take MSAA setting from quality settings.

summary>Don't use MSAA.

OFF 

summary>2x MSAA

X2 

summary>4x MSAA

X4 

summary>8x MSAA

Member Function Documentation

◆ ResetCounterMotion()

virtual void Sigtrap.VrTunnellingPro.TunnellingBase.ResetCounterMotion ( )
inlinevirtual

Reset cage and skybox orientation/offset when using counter motion.

Reimplemented in Sigtrap.VrTunnellingPro.TunnellingImageBase.

Member Data Documentation

◆ accelerationMax

float Sigtrap.VrTunnellingPro.TunnellingBase.accelerationMax

Clamp effect contribution above this acceleration. Metres per second squared

◆ accelerationMin

float Sigtrap.VrTunnellingPro.TunnellingBase.accelerationMin

No effect contribution below this acceleration. Metres per second squared

◆ accelerationSmoothing

float Sigtrap.VrTunnellingPro.TunnellingBase.accelerationSmoothing = 0.15f

Smoothing time for acceleration calculation. 0 for no smoothing

◆ accelerationStrength

float Sigtrap.VrTunnellingPro.TunnellingBase.accelerationStrength = 1

Strength contributed to effect by linear acceleration.

◆ angularVelocityMax

float Sigtrap.VrTunnellingPro.TunnellingBase.angularVelocityMax = 180

Clamp effect contribution above this angular velocity. Degrees per second

◆ angularVelocityMin

float Sigtrap.VrTunnellingPro.TunnellingBase.angularVelocityMin = 0

No effect contribution below this angular velocity. Degrees per second

◆ angularVelocitySmoothing

float Sigtrap.VrTunnellingPro.TunnellingBase.angularVelocitySmoothing = 0.15f

Smoothing time for angular velocity calculation. 0 for no smoothing

◆ angularVelocityStrength

float Sigtrap.VrTunnellingPro.TunnellingBase.angularVelocityStrength = 1

Strength contributed to effect by angular velocity.

◆ applyColorToBackground

bool Sigtrap.VrTunnellingPro.TunnellingBase.applyColorToBackground = false

Depending upon effect mode, causes effectColor to affect background.
Basic vignette mode always uses effectColor.

◆ counterRotationPerAxis

Vector3 Sigtrap.VrTunnellingPro.TunnellingBase.counterRotationPerAxis = Vector3.up

Scale counter-rotation on individual axes.
Multiplied by counterVelocityStrength.
X: Pitch, Y: Yaw, Z: Roll.

◆ counterRotationStrength

float Sigtrap.VrTunnellingPro.TunnellingBase.counterRotationStrength = 1f

Scale counter-rotation relative to motionTarget motion.

◆ divideRotation

bool Sigtrap.VrTunnellingPro.TunnellingBase.divideRotation = true

Apply framerateDivision division to rotation.

◆ divideTranslation

bool Sigtrap.VrTunnellingPro.TunnellingBase.divideTranslation = true

Apply framerateDivision division to linear motion.

◆ effectColor

Color Sigtrap.VrTunnellingPro.TunnellingBase.effectColor = Color.black

Colour of vignette. Alpha is blend factor.
If applyColorToBackground true, will affect background of advanced modes.

◆ effectCoverage

float Sigtrap.VrTunnellingPro.TunnellingBase.effectCoverage = 0.75f

Maximum screen coverage.

◆ effectFeather

float Sigtrap.VrTunnellingPro.TunnellingBase.effectFeather = 0.1f

Feather around cut-off as fraction of screen.

◆ effectSkybox

Cubemap Sigtrap.VrTunnellingPro.TunnellingBase.effectSkybox

Skybox to apply to vignette.
Requires skybox mode to be enabled (varies depending upon effect).

◆ forceVignetteMode

ForceVignetteMode Sigtrap.VrTunnellingPro.TunnellingBase.forceVignetteMode

How to combine forceVignetteValue with motion value to calculate effect radius.

◆ forceVignetteValue

float Sigtrap.VrTunnellingPro.TunnellingBase.forceVignetteValue

Force effect to be this value.
Combined with motion value according to forceVignetteMode.

◆ framerateDivision

int Sigtrap.VrTunnellingPro.TunnellingBase.framerateDivision = 1

Divide VR framerate by this number while keeping HMD and cage at device framerate.
Forces stepped motion of motionEffectTarget rather than changing rendering.

◆ GLOBAL_PROP_FOGBLEND

const string Sigtrap.VrTunnellingPro.TunnellingBase.GLOBAL_PROP_FOGBLEND = "_VRTP_Cage_FogBlend"

Global shader parameter controlling fog strength in shaders using CageFog.cginc.

◆ GLOBAL_PROP_FOGCOLOR

const string Sigtrap.VrTunnellingPro.TunnellingBase.GLOBAL_PROP_FOGCOLOR = "_VRTP_Cage_FogColor"

Global shader parameter controlling fog color in shaders using CageFog.cginc.

◆ GLOBAL_PROP_FOGDENSITY

const string Sigtrap.VrTunnellingPro.TunnellingBase.GLOBAL_PROP_FOGDENSITY = "_VRTP_Cage_FogDensity"

Global shader parameter controlling fog density in shaders using CageFog.cginc.

◆ GLOBAL_PROP_FOGPOWER

const string Sigtrap.VrTunnellingPro.TunnellingBase.GLOBAL_PROP_FOGPOWER = "_VRTP_Cage_FogPower"

Global shader parameter controlling fog falloff in shaders using CageFog.cginc.

◆ motionEffectTarget

Transform Sigtrap.VrTunnellingPro.TunnellingBase.motionEffectTarget = null

Transform used for artificial tilt and framerate division.
Should be a child of Motion Target and a parent of the HMD.
Target's transform should not be modified by anything else.

◆ motionTarget

Transform Sigtrap.VrTunnellingPro.TunnellingBase.motionTarget

Motion calculated using this Transform. Generally shouldn't use HMD.

◆ tiltMaxAngles

Vector2 Sigtrap.VrTunnellingPro.TunnellingBase.tiltMaxAngles = 5*Vector2.one

Maximum artificial tilt in degrees. Zero for no clamp.
X: Pitch, Y: Roll.

◆ tiltSmoothTime

float Sigtrap.VrTunnellingPro.TunnellingBase.tiltSmoothTime = 0f

Smooth out tilt over this time.

◆ tiltStrength

float Sigtrap.VrTunnellingPro.TunnellingBase.tiltStrength = 0f

Strength of artificial tilt relative to linear acceleration.
Degrees per (metres per second squared).

◆ useAcceleration

bool Sigtrap.VrTunnellingPro.TunnellingBase.useAcceleration = false

Add linear acceleration to effect strength? Helps players with moderate sim-sickness.

◆ useAngularVelocity

bool Sigtrap.VrTunnellingPro.TunnellingBase.useAngularVelocity = true

Add angular velocity to effect strength? Helps players with regular sim-sickness.

◆ useArtificialTilt

bool Sigtrap.VrTunnellingPro.TunnellingBase.useArtificialTilt = false

Artifically tilt the camera when moving to simulate acceleration forces.

◆ useCounterMotion

bool Sigtrap.VrTunnellingPro.TunnellingBase.useCounterMotion = false

Counter-motion moves/rotates cage/skybox opposite to motionTarget motion.

◆ useVelocity

bool Sigtrap.VrTunnellingPro.TunnellingBase.useVelocity = false

Add translation velocity to effect strength? Helps players with strong sim-sickness.

◆ velocityMax

float Sigtrap.VrTunnellingPro.TunnellingBase.velocityMax

Clamp effect contribution above this velocity. Metres per second

◆ velocityMin

float Sigtrap.VrTunnellingPro.TunnellingBase.velocityMin

No effect contribution below this velocity. Metres per second

◆ velocitySmoothing

float Sigtrap.VrTunnellingPro.TunnellingBase.velocitySmoothing = 0.15f

Smoothing time for velocity calculation. 0 for no smoothing

◆ velocityStrength

float Sigtrap.VrTunnellingPro.TunnellingBase.velocityStrength = 1

Strength contributed to effect by linear velocity.

Property Documentation

◆ usingMotionEffectTarget

bool Sigtrap.VrTunnellingPro.TunnellingBase.usingMotionEffectTarget
get

Indicates whether the motionEffectTarget is currently being used for motion effects.


The documentation for this class was generated from the following file: