Move render pipelines into separate repos#259
Conversation
Codecov Report
@@ Coverage Diff @@
## master #259 +/- ##
=======================================
Coverage 56.79% 56.79%
=======================================
Files 159 159
Lines 9441 9441
Branches 937 937
=======================================
Hits 5362 5362
Misses 3850 3850
Partials 229 229
Continue to review full report at Codecov.
|
Roland09
left a comment
There was a problem hiding this comment.
Looking good. Did some tests with URP and HDRP imports.
I'd change "Built-in" to "Standard" to keep it consistent.
Import works okay, but e. g. HDRP has problems with some materials because of changes from HDRP 8 to HDRP 10. We'll address those after the merge.
Entering play mode takes very long, e. g. Tom & Jerry takes 4 minutes.
Play mode problems:
HDRP: table flickers black
URP: nothing is visible except the lights
Those are problably not related to the refactoring.
|
@Roland09 Thanks! Where does it still say "Built in" instead of "Standard"? The URP/HDRP issues seem due to Hybrid Renderer v1, you'll need to use v2. |
VPE currently supports three render pipelines: The standard built-in renderer, the Universal Render Pipeline and the High Definition Render Pipeline. While built-in becomes less and less relevant, VPE should support both URP and HDRP:
Unfortunately, the two RPs are not compatible, i.e. it's not possible to convert a URP scene into HDRP and vice versa, and that's another issue, but it's also impossible to keep both dependencies in the same project (not without weird side effects, anyway).
This PR moves all URP and HDRP related code into separate Unity packages. These are:
Both projects have dependencies to
VisualPinball.EngineandVisualPinball.Unity, so they have the full VPE API at their disposal. Within VPE, you can access the current render pipeline anywhere by usingRenderPipeline.Current.New Project Setup
Before this PR, VPE checked whether URP or HDRP was a dependency of the project and converted the materials accordingly. With this PR, VPE checks whether
VisualPinball.Unity.UrporVisualPinball.Unity.Hdrpare in the project. More specifically, it checks whether there are other implementations ofIRenderPipelinethan the standard (a.k.a built-in) implementation.That means even though your project is set up with HDRP, VPE won't convert to HDRP, unless
VisualPinball.Unity.Hdrpis added as a package as well. It actually can't, because that code is now part ofVisualPinball.Unity.Hdrp. So you need to add two packages: The VPE (this) package, and the HDRP package. The same applies for URP.Patcher Changes
The patcher used to be a dependency of
VisualPinball.Unity. That meant it hadn't access to VPE's Unity API, only to the common core API. This PR inverses dependencies.VisualPinball.Unityloads any implementation ofIPatcher. Thus, the patcher assembly now has access toVisualPinball.Unityand thus toIRenderPipelineas well, where it can apply render-specific patches.In fact, it did that before using
IRenderPipelinePatcher, which moved intoIRenderPipelineas well, asIMaterialAdapter.Ball Creation
Balls were instantiated via code before and every RP had its own ball creation code. With this PR, ball creation is part of
IRenderPipeline, and it returns aGameObject. That allowed us to change the creation approach and use prefabs for ball creation that are much easier to deal with.TODO
.metafiles