Jump to content

GeNa always thinks HDRP is active in a project with both URP and HDRP


Eternic

Recommended Posts

I've just started using GeNa Pro so I might be missing something here, but in my project that has both the URP and HDRP packages, whenever I add a Road Spline it is assigning the HDRP shader even though URP is currently being used.

When the project is using URP if I call GeNa.Core.GeNaUtility.GetActivePipeline() it returns HighDefinition and if I replace all calls to that in the accessible code with my own alternative it still doesn't fix the Road Spline's shader issue. I expect it's doing it rendering pipeline check in DLLs.

 

This is the code I'm using to return the correct currently used rendering pipeline which checks the name to work around missing types if one or both of the SRP packages isn't in the project:

if (UnityEngine.Rendering.GraphicsSettings.currentRenderPipeline)
{
	if (UnityEngine.Rendering.GraphicsSettings.currentRenderPipeline.GetType().ToString().Contains("HighDefinition"))
	{
		return GeNa.Core.Constants.RenderPipeline.HighDefinition;
	}
	else
	{
		return GeNa.Core.Constants.RenderPipeline.Universal;
	}
}
return GeNa.Core.Constants.RenderPipeline.BuiltIn;
Link to comment
Share on other sites

There's definitely a lot of hurdles and extra work involved in having both URP and HDRP in one project, but it is viable. There are some shipped games like Road 96 (which Unity has highlighted as an example of the possibility of using URP and HDRP in some talks) that use a URP build for Switch and HDRP for PC and other consoles and there are others that have done or are doing the same. I believe Lego Builder's Journey might do the same with it's Switch and mobile versions but I'm not sure about that.

 

I'm not yet sure about the viability of having URP and HDRP used in a single build, I need to do some more testing on that, but usually the idea is maintaining support for both in a project so lower end hardware builds could use URP and higher end HDRP. I've not had any insurmountable issues using and switching between both pipelines except for this GeNa issue.

 

Outside of creating complete product that works with URP and HDRP in the end, just having a simpler project with which to develop content with GeNa targeting URP and HDRP seems like a pretty likely scenario for yourselves and users wanted to create custom Spline Extensions or whatever to share with the community. There's no reason GetActivePipeline() should return the wrong information when it's possible to detect the correct one.

Link to comment
Share on other sites

@Eternic It is not recommended to have both URP and HDRP installed this causes many conflicts in code, shaders and build processes. Since both pipelines do share some of the same code base and core content. I would recommend 2 seperate projects and like Manny said before Unity do recommend that you don't have both installed at the same time.

Link to comment
Share on other sites

Ok, that's fair enough, and as you say, having multiple projects is currently the best way to do it. I think you should still fix the pipeline detection function as going forward Unity will be continuing to improve support for URP and HDRP in the same project and right now switching between them in the editor doesn't have any issues.

This is a quote from a Unity developer 2 weeks ago for example:

Quote

Unity is exploring ways to enable both URP and HDRP in the same project in a future version of Unity. At the moment this isn't easy to manage due to hardware and platform differences. That being said, we've seen developers accomplish this generally by having two separate projects - one for URP and another for HDRP. 

How you convert from one pipeline to another will depend on the actual shaders themselves. If you wrote these shaders yourselves, then you can write a script to converts those from one pipeline to another. If you use Shader Graph, the PBR Node actually works pretty well across both pipelines (same with Unlit, though there's a lot less features). If you are relying on 3rd party assets, then you will need to ask the creator to understand their cross-pipeline support.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...