Cross pipeline workflow. Project for mobile, console and PC.

Hi!
I have a question on which i would love to hear your opinion.
So if you plan to create something crossplatform like for pc, console, ios and android with high-end graphics then what approach you choose. One more for this question, keep in mind that you would release it not right now but 1-2 years from now.

I mentioned high end graphics so you know that mobile devices should be from middle+ segment or i think it is called pre-top. I know that it makes target audience less but still.

if you better approach or some ideas that you want to share i would glad to hear it.

The main reason to ask it because hdrp did not plan for mobile devices and supporting urp + hdrp complicates workflow.

Shader Graph stack change in 9.x and 10.x does help on URP + HDRP setup as you can now author same shader graph that has both URP and HDRP shader passes in same file.

HDRP isn’t really an realistic option for mobile so your alternatives are rather:

  • URP for all
  • URP on weaker platforms + HDRP on rest
2 Likes

Yes, I also thought that to make hdrp works on mobile i would have to cut it to urp at some point:)

Thank you for insight about shadergraph! It will be very useful to work with to passes. I will definitely try it. What I am also thinking about is texture setup. I would have to import same texture through custom importer and convert it to hdrp + urp or ask artists to prepare two set of textures. I also need to manage materials in special way so it will automatically fill parameters and textures.

I don’t really get why you’d need another set of textures.

As I can see HDRP/Lit shader and URP/Lit shader use different textures.
In image below you can see that hdrp use one texture for metallic-occlusion-smoothness and URP shader ask occlusion to be separate texture.
6050669--654446--upload_2020-7-3_10-30-24.jpg

I would also need to convert all light sources because as I see hdrp use diffirent intensity units unlike urp.

HDRP Directional light
6050669--654485--upload_2020-7-3_10-43-2.png

URP Directional light
6050669--654488--upload_2020-7-3_10-43-42.png

For a 1 to 2 years schedule I will recommend URP.

We aim at having URP as the main pipeline when doing a cross platform game/project (Missing feature are work in progress).

HDRP isn’t cross platform on purpose and constraint flexibility in the favor of optimization for specific recent hardware. It is also more challenging to understand / manipulate.

Note that quality of graphic is driven by artists :slight_smile:

2 Likes

As so you refer to default texture mapping on default shaders. This wasn’t what I was talking about. I referred to new shader graph update (SRP 9.x and newer) that lets you author shaders for multiple targets (so both HDRP and URP) on single shader file. Basically you’d author your custom shaders with SG that take the same texture input. The immediate gains from this are:

  • Same texture mapping for your assets regardless of the pipeline
  • Same materials regardless of the pipeline (you don’t have to swap shaders from materials if you author release for HDRP or URP)

Of course there other considerations, this isn’t just SRP asset swap but you can minimize the work needed by putting platform specific values into separate additively loaded scenes so you don’t have to reauthor full scenes with assets per pipeline. Currently these things differ a lot between these two pipelines:

  • Lighting and exposure (where you can use realistic values on HDRP but not on URP)
  • HDRP and URP both have additional data components on each light source and camera
  • URP just got volume framework but it works with different effects for some part, so you’d have to author URP and HDRP (postprocessing) separately
  • Both have a different way to handle sky

Of course, you’d really want to just stick with URP if you can do it, just putting this info out there if someone really wants to use different SRPs for the same project.

This sounds awesome and sounds like things are going into the right direction. @rz_0lento Can you give an example, even if it is just a screengrab, of any SG example where something is setup for both HDRP and URP please?

Yes I understand that quality can be achieved by artists but not always or it will cause a lot of custom shaders, post effects and workarounds. Stylization is always a way and we all know it. I just do not want to compromise on graphics on some platform like PS5 and PC. Maybe not right now when I have time to try different approaches.

Oh, I did not think in this way. Yes it may work! Thank you! I still would have to make sure that additional textures from HDRP will not go to URP build but I know how it can be done on building step.

I think I will try to calculate how much time we need to support this hybrid workflow approximately and this help us to choose.

You need to enable preview packages in Project Settings → Package Manager, download latest hdrp and urp 9.x with shader graph and you can see new system.
6051437--654584--upload_2020-7-3_15-10-39.png

1 Like

Sure, this is from 9.0.0-preview.33 with both URP and HDRP packages in the project:

Note that you first pick the targets you want the SG to apply for and then it lets you pick the material variant from the list per SRP. Like, I could have put HD StackLit and URP Unlit here and it could expose the master nodes accordingly on the list. If you wire input to a node that’s only supported by one target then the other will just ignore that wire.

1 Like

Ah you beat me to it :smile:

I’d like to note that while Unity doesn’t support runtime SRP swapping (it’s strongly adviced against), I do have a prototype where I can runtime swap between URP and HDRP. It requires a lot of thought and main issue I faced on that was with the exposure control as HDRP’s exposure always bled into URP side despite me resetting exposure manually from HDRP before SRP swap. I’m hoping something like this will eventually be supported workflow with less friction.

My prototype worked fine as long as I used low intensity values on HDRP side and exposure at 0 for everything but you’d really want the full lighting range for HDRP to get most of it. I had separate scene for both URP and HDRP that had lighting, camera and volumes. I still used same SG stack materials for both so actual models and materials in scene could stay intact on other “base” scene.

Basically what I did on the script then was that upon swap, I first unloaded extra SRP scene, then swapped the SRP Asset between URP and HDRP and then loaded new additive scene for that newly loaded SRP variant. All this could be also automated in the editor so one could have editing time toggle to swap between these two.

I just read this: < What is next for us at Unity with Scriptable Render Pipelines >

Apparently Unity is on this already:

This is EXACTLY what I did earlier on my proto :slight_smile:

2 Likes

This is EXACTLY the right answer for us. URP for now, and in the future be able to target HDRP on desktop and URP on mobile from the same shader graph, with some features missing on mobile. Absolutely bullseye.

We had actually migrated to Unreal for a number of months just to be able to target broadly, but are coming back to Unity because Unreal is a rogue operation and everything is nicer and more professional with Unity. That brought back the headache of looking great on desktop and OK on mobile. Targeting both pipelines from the same project is EXACTLY what we need. I think that anyone who’s cross-platform is in the same boat.

Do note that while shader graphs can now target both URP and HDRP, there’s still a lot of friction on smoothly authoring actual game content (levels, lighting, cameras etc) for both of these today. Apparently 2021 is the cycle where they’ll make it simpler but we haven’t really seen any concrete plans/roadmap for this beyond the shader graph change. I’ve welcome some estimate on which components Unity will streamline next (I’ve seen sky volume setup for URP on github so that could be one).

1 Like

Can you give a link for volume setups in URP?

Right now, I think for most of the staff it will be different scenes or prefabs but it is kinda tricky.
@rz_0lento Do you know Is there any difference in lightmaps when bake for HDRP or URP if enviroment is the same?

https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.4/manual/Volumes.html

Additionally, this is the sky volume rework that I was referring to earlier:
https://github.com/Unity-Technologies/Graphics/tree/universal/SkyVolumes

[quote=“Camarent, post:18, topic: 798376, username:Camarent”]
Do you know Is there any difference in lightmaps when bake for HDRP or URP if enviroment is the same?
[/quote]Considering you need different light data components per SRP, I very much doubt you could reuse baked light data today across the different SRPs either. I haven’t done any testing with this though so that’s just me guessing.

The core shader of HDRP is vastly unoptimized at this point, so would kill mobile performance imo. It even kills my desktop for simple things, because is just very heavy.

If you plan to go all out with custom shaders of your own creation though, could run on mobile, but will be much harder journey and defeat the purpose of using HDRP slightly.

Also image effects are generally heavy and even heavier on HDRP, again wont help with mobile that is best to use some tricks for similar effects than go with full volumes.

1 Like