Comments (2)
Hmm... I'd suggest URP's camera stacking, however that doesn't let you set the background at a lower resolution sadly. :(
Can do something with a 2 camera setup, though the transition between full resolution and the lower resolution is likely going to leave an obvious line/seam across the screen. Shouldn't be too difficult to setup though, Can adjust the clipping planes to those values to make sure each camera draws the correct parts. The Background Camera would output to a Render Texture object that's set to the lower resolution, using a (Forward) Renderer that has no features (as we wouldn't want to blit the texture to itself).
The Main Camera can then use another Forward Renderer that has the Blit applied, to apply that Render Texture object (source) to the screen (Camera Color destination). Would need to be in the Before Rendering Opaques event (so it's drawn in the background).
It also needs a material/shader to handle it, but it just needs to sample _MainTex and output it. (Can do that in shadergraph just with the Sample Texture 2D node). Also need to make sure the main camera doesn't draw the skybox or that would also draw on top. I'm sure there's a setting on the camera to change that.
Alternatively, if you don't want the transition that harsh, might be able to do something with the depth buffer. Could render the full scene at full resolution (one camera, one renderer). Downsample it somehow (blit the camera source into a low res render texture object? In the before post processing event. I think that would work?). Then use another blit, same event but using a material/shader which samples _MainTex for the full res, and the other downsampled texture (by passing it in with Shader.SetGlobalTexture or material.SetTexture, may have to edit the feature to do that), and returns a result based on an interpolation (lerp) of both, using the depth texture as the t input.
Haven't really tested these, but can't think of a reason why they wouldn't work right now.
Quite a bit of text so sorry, hope it helps though. Let me know if anything needs clarifying further.
from urp_blitrenderfeature.
Thanks Cyan.
I am trying to recreate the performance trick of Mario Odyssey where the foreground is kept crisp and the background gets rendered at a fraction of the resolution to save some pixel shader units from melting.
So #2 would give the effect but not the benefit of performance.
#1 I might test but ... I tried something earlier today, with a quad instead of using your Blit, the performance was notably worse than with a single full res camera. double culling is my guess as it's done on the cpu in URP. I doubt using blit would be of benefit so I'll leave it there.
from urp_blitrenderfeature.
Related Issues (15)
- White render with cmd-drawMesh HOT 2
- It seems transparent material can't work HOT 2
- Using runtime RenderTexture
- Package installation fails with URP 14.0.3 and unity 2022.2.0b10 HOT 3
- Fixing obsolete and deprecated warnings using RTHandle HOT 2
- Avoiding double blit when rendering as image effect HOT 2
- cmd-drawMesh and depth texture HOT 2
- Rendering artifacts on Quest 2
- ScriptableRenderPass.Blit has been deprecated with 2023.x HOT 5
- Single pass VR Support HOT 2
- Affecting Asset Previews (Prefabs, materials etc.) - URP 2D - 2022.3.15f1 HOT 3
- Changing Blit material in run time HOT 1
- Blitting above an Overlay Camera HOT 2
- Possibly broken on 2021.2.2f1, no output at all. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urp_blitrenderfeature.