Skip to content

BeatSaber modding utils for flexible render control

Notifications You must be signed in to change notification settings

Reezonate/CameraUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CameraUtils

Beat Saber modding library that standardizes the use of GameObject layers and provides tools for easier rendering pipeline modifications

Usage examples

Check out CameraUtilsSandbox project for more code/usage examples

HMD-only rendering

class HmdOnlyExample: MonoBehaviour {
    private void Awake() {
        gameObject.SetLayer(VisibilityLayer.HmdOnlyAndReflected);
        //If you don't want object to be rendered in reflections, use VisibilityLayer.HmdOnly
    }
}

Desktop-only rendering

class DesktopOnlyExample: MonoBehaviour {
    private void Awake() {
        gameObject.SetLayer(VisibilityLayer.DesktopOnlyAndReflected);
        //If you don't want object to be rendered in reflections, use VisibilityLayer.DesktopOnly
    }
}

Registering custom Camera

  • To add your camera to the system, simply call CamerasManager.RegisterDesktopCamera(Camera yourCamera)
  • Make sure to remove your camera on destroy, using CamerasManager.UnRegisterCamera(Camera yourCamera)
  • Alternatively, you can just add AutoCameraRegistrator component to the Camera's GameObject
private void InitCamera(Camera camera) {
    camera.gameObject.AddComponent<AutoCameraRegistrator>();
}

Registering CameraEffect

  • To insert custom logic into the render pipeline, use CamerasManager.RegisterCameraEffect()
  • Make sure to remove your effects on dispose, using CamerasManager.UnRegisterCameraEffect()

See: simple Post-Process effect example

About

BeatSaber modding utils for flexible render control

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages