Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling Post-processing effects on cameras via config file disables camera preview #45

Closed
mikeskydev opened this issue Feb 21, 2021 · 9 comments · Fixed by #213
Closed
Labels
bug Something isn't working

Comments

@mikeskydev
Copy link
Member

mikeskydev commented Feb 21, 2021

Steps to reproduce:

  • Edit your Open Brush.cfg config file to disable PostEffectsOnCapture. Example:
{
  "User": {
  },
  "Video": {
  },
  "Flags": {
    "PostEffectsOnCapture" : false,
  },
  "Export": {
  },
}
  • Load Open Brush.
  • Activate the camera tool.

Expected Result: Can see camera preview on each tool, with post-processing effects disabled.
Actual Result: No preview visible.
Platforms reproduced on: Windows 10, Unity editor, Release and Experimental built versions.

image

@mikeskydev mikeskydev added the bug Something isn't working label Mar 1, 2021
@mikeskydev
Copy link
Member Author

This appears to be somehow related to the Sonic Ether plugin.
Disabling either tilt shift or vignette components separately does not cause this issue, only when both are disabled together. Moving Sonic Ether to the bottom of the components stack achieves the same bug. Deleting the Sonic Ether component prevents the bug from happening.

@mikeskydev
Copy link
Member Author

mikeskydev commented Apr 8, 2021

After checking in renderdoc, it appears the image is being generated, but something is up with the alpha value. This is calculated here:

https://github.com/icosa-gallery/open-brush/blob/7e05f5f2cc5dcb21ea7d99114a9ebb7172b2ac18/Assets/ThirdParty/Sonic%20Ether/Natural%20Bloom/Shaders/SENaturalBloomAndDirtyLens.shader#L519

Setting color.a to 1.0 makes the image reappear. I'm not sure what benefit the alpha channel is adding here?

Renderdoc with RGBA
image

Renderdoc with just RGB
image

@mikeskydev
Copy link
Member Author

Fixing alpha value at 1.0 causes some brushes not to be rendered.

@andybak
Copy link
Contributor

andybak commented Jun 3, 2021

Any thoughts on why this breaks in Open Brush but not on the original Tilt Brush? What did we change in this area?

@mikeskydev
Copy link
Member Author

These shaders were closed source in TB, and they were been swapped out with open source equivalents for release, but I'm guessing there might be a few differences.

@andybak
Copy link
Contributor

andybak commented Jun 3, 2021

Could we switch to the standard Unity Post Processing v2 package? I don't think it has tilt shift but converting the current code to work with PP wouldn't be hard. Is SE Bloom more performant than the Unity Bloom?

(link to docs for future reference: https://docs.unity3d.com/Packages/com.unity.postprocessing@3.1/manual/index.html )

@mikeskydev
Copy link
Member Author

Taking a look at this again, armed with the knowledge that the output screenshot actually looks fine! instead I fixed the output alpha to 1.0 on the shader used for the preview window, rather than the capture process, which appears to produce the expected results.

https://github.com/mikeskydev/open-brush/blob/48522725812a78d99afbf5c00fd72cbb5f2b1491/Assets/Shaders/SnapshotCameraFlash.shader#L76

This still doesn't really explain why it is breaking the preview, but I'm thinking it doesn't really matter too much?

@mikeskydev
Copy link
Member Author

Just noting that the screenshot manager explicitly ignores alpha when exporting, which is probably why it doesn't encounter this issue. https://github.com/icosa-gallery/open-brush/blob/main/Assets/Scripts/ScreenshotManager.cs#L464-L481

@AlVRto
Copy link

AlVRto commented Aug 27, 2021

The cfg is like this: As in Original Tilt Brush:
"PostEffectsOnCapture" : false,
But, Now is working, with:
},
"Flags": {
"PostEffectsOnCapture" : true,
and also with the original empty:
{
"User": {
},
"Video": {
},
"Flags": {
},
"Export": {
},
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants