-
Notifications
You must be signed in to change notification settings - Fork 792
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
Universal/runtime render pass #2719
Conversation
I removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also missing changelog.
...y.render-pipelines.universal/Samples~/RenderPassSamples/BlurryRefraction/RunPassAtRuntime.cs
Outdated
Show resolved
Hide resolved
...y.render-pipelines.universal/Samples~/RenderPassSamples/BlurryRefraction/RunPassAtRuntime.cs
Outdated
Show resolved
Hide resolved
...y.render-pipelines.universal/Samples~/RenderPassSamples/BlurryRefraction/RunPassAtRuntime.cs
Outdated
Show resolved
Hide resolved
...y.render-pipelines.universal/Samples~/RenderPassSamples/BlurryRefraction/RunPassAtRuntime.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.universal/Samples~/RenderPassSamples/Shaders/KawaseBlur.shader
Outdated
Show resolved
Hide resolved
// make fog work | ||
#pragma multi_compile_fog | ||
|
||
#include "UnityCG.cginc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be written in SRP shader library / URP. This is using old built-in shader library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shader also needs to be stereo aware. @thomas-zeng
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated shader should now use the universal shader library and is now using HLSL instead of cginc.
for (var i = 1; i < settings.blurPasses - 1; i++) | ||
{ | ||
cmd.SetGlobalFloat("_offset", 0.5f + i); | ||
cmd.Blit(tmpRT1, tmpRT2, settings.blurMaterial); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work on XR. @thomas-zeng can you help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XR prefers to use DrawMesh will fullscreen quad to do blit.
cmd.Blit in some cases will use built-in blit shader which doesn't work well with URP.
With DrawMesh, we can explicit set the blit shader. And DrawMesh has better yflip control.
See how URP SSAO handles blit here:
Line 289 in 1d37e20
cmd.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, material, 0, (int)pass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result is used in Shader Graph is it possible to use XR textures in shader graph?
… into universal/runtimeRenderPass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As more package samples are added to URP there needs to be a common template that makes it easy for users to investigate and navigate the samples. With this being the first sample landing in URP this is not an issue at the moment but it might need to be revisited in the near future.
…y-Technologies/Graphics into universal/runtimeRenderPass
XR for MockHMD: Single pass instanced is not working but if instanced is turned off the Kawase blur will the correct result return on the left lens. |
… into universal/runtimeRenderPass
Closing PR. Can be reopened if necessary. |
Status
This is a Draft and is currently still missing documentation.
Purpose of this PR
This PR fixes the render passes not being able to be enqueued at runtime.
Which is requested by this bug case: https://fogbugz.unity3d.com/f/cases/1211195/
And to show the feature working is a sample implemented which also helps the user.
Testing status
I tested this PR locally on Windows 10 using DX11 on UniversalGraphicsTest.
I have also tested the feature manually when creating the sample using the fix.
Comments to reviewers
Please check the sample and come with feedback making the sample better for the user.