-
Notifications
You must be signed in to change notification settings - Fork 175
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
Converting the shaders from BRP to URP? #8
Comments
The portal shader works fine with URP. To get the portals working in URP you need to enable Post Processing on both Portal Cameras scripts. Then code changes:
I'm still working on the slice shader but I've heard Brackeys has a working slide shader for HDRP/URP. EDIT: I have noticed an odd visual glitch, if you walk through the portal backwards there is a screen flicker. |
EDIT |
I hope this helps with enabling post processing. You'll need to do it on both cameras. |
I have yet another problem, in the portal script, portalcam.render() doesn't work anymore, it gives an error. Any thoughts? EDIT: I moved the onPreCull function body to be called on RenderPipelineManager.beginCameraRendering |
I've not had any issues with |
@jeffries7 I did not, I did however figured out a way, I had to change portalcam.render to UniversalRenderPipeline.RenderSingleCamera(context, portalcam); and now it works flawlessly |
@joaoachando but what is "context"? To me it says that there's no such thing as context |
@FuranTheAwakened On the portal.cs change to public void Render (ScriptableRenderContext context) and send the context in the MainCamera script where you call the .Render function. The contex is received as a ScriptableRenderContext in the RenderPipelineManager.beginCameraRendering |
Thank you @joaoachando Now there's another problem: https://drive.google.com/file/d/12XMdVidhfvOXO34zb5QXxUaYUfpEyrUx/view?usp=sharing |
@FuranTheAwakened you need to change the main camera script up a bit. "RenderPipelineManager.beginCameraRendering += OnBeginCameraRendering;" in start and instead of an onPreCull function you want to put all the portal logic in "void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera)". The other issue looks like you forgot to delete your history on the model. |
Hello everyone, I have a problem. The exposure on my RenderTexture is kinda darker and hasn't got the right exposure(it is darker). I am using 'new RenderTexture (Screen.width, Screen.height, 0, RenderTextureFormat.DefaultHDR, RenderTextureReadWrite.Linear);' for the RenderTexture. Thanks in advance. problem.mp4 |
Fixed it by disabling post processing on portal cameras. |
I used Sebastian Lague's portal tutorial and reading this: SebLague/Portals#8
Did everyone else also manage to fix the problem with the render texture being to dark? I am using URP and cannot disable post processing because it stops rendering scene objects... I am also using post processing on the main camera. Edit: I managed to fix it but I'm still left with weird shadows and flickering... |
Hi, this was nearly two years ago but the project where this system works with URP is on my Github Page(https://github.com/trauty/Why). |
Hey, I tired to clone your project but I'm running low on space and was able to clone it but there were many errors. I instead took a look at your code and the fix is identical to what I did, so I'm not sure it would fix my problem. I am using many lights and post processing effects which may be the source of the flicker and weird shadows. I've spent way to long trying to get it working so I appreciate your help but will probably not continue further... Thanks anyway! |
I want to add the portals in unity urp 2022, the portal shader works but I have the same odd visual glitch, do you know how to fix it? (I do not need the slice shader) |
I fix the bug by remove the screen space ambient occlusion of the URP renderer asset |
Does anyone know how to convert the Portal.shader and the Slice.shader in order to make it work with the Universal Render Pipeline? I'm new to everything, and basically I'm not being able to make either of this work.
Hope that someone has faced this issue and will be willing to share the acquired knowledge.
The text was updated successfully, but these errors were encountered: