sigtrapgames / VrTunnellingPro-Unity

Plug-and-play VR comfort for Unity.
http://www.sigtrapgames.com/vrtp/
MIT License
180 stars 21 forks source link

How to control the size central vision #7

Closed a962097364 closed 2 years ago

a962097364 commented 2 years ago

When the motionTarget is moving, the size of central vision is changing based on the motion. However, I don't know which is the main code about changing the size. I want to ask about it. Thank you.

a962097364 commented 2 years ago

I also want to ask the function of _blurRt0 and _blurRt1 in TunnellingImageBase.cs, thank you.

sigtrapgames commented 2 years ago

Using forceVignetteMode and forceVignetteValue (0-1) is the easiest way to control the vignette. That will lerp between 0 screen coverage and effectCoverage.

For example, forceVignetteMode = ForceVignetteMode.CONSTANT; effectCoverage = 0.8f; forceVignetteValue = 0.5f; will produce a vignette covering effectCoverage * forceVignetteValue = 0.4 of the screen.

The blur RTs are the render textures used when the effect is set to blur mode. They are alternated to perform each blur pass. For example, if there are 3 blur passes:

  1. Blit(screen, _blurRt0)
  2. Blit(_blurRt0, _blurRt1, blur shader)
  3. Blit(_blurRt1, _blurRt0, blur shader)
  4. Blit(_blurRt0, _blurRt1, blur shader)
  5. Blit(_blurRt1, screen)
a962097364 commented 2 years ago

Thanks a lot! I think I got it.