Skip to content

Commit

Permalink
Added ability to turn off vignette for particle rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicElysium committed Sep 30, 2024
1 parent 6f644a5 commit 0938e6f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Assets/Scripts/CatalogData/CatalogInputController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using UnityEngine.XR;
using Valve.VR;
using Valve.VR.InteractionSystem;
using VolumeData;
using VRHand = Valve.VR.InteractionSystem.Hand;

[RequireComponent(typeof(Player))]
Expand Down Expand Up @@ -65,6 +66,7 @@ private enum RotationAxes
// Vignetting
private float _currentVignetteIntensity = 0;
private float _targetVignetteIntensity = 0;
private bool _vignetteEnabled = true;

// VR-family dependent values
private VRFamily _vrFamily;
Expand Down Expand Up @@ -145,6 +147,10 @@ private void OnEnable()
_startGripCenter = Vector3.zero;

_inputState = InputState.Idle;

// Set whether the vignette is enabled
// TODO: remove the dependency on VolumeData namespace
_vignetteEnabled = Config.Instance.tunnellingVignetteOn;
}

private void OnDisable()
Expand Down Expand Up @@ -250,7 +256,12 @@ private void StateTransitionScalingToMoving()
private void Update()
{
// Common update functions
UpdateVignette();

if (_vignetteEnabled)
{
UpdateVignette();
}

if (Camera.current)
{
Camera.current.depthTextureMode = DepthTextureMode.Depth;
Expand Down

0 comments on commit 0938e6f

Please # to comment.