Skip to content
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

Add support for HDRP surface options & advanced options #9

Open
SmallSix666 opened this issue Jan 22, 2024 · 6 comments
Open

Add support for HDRP surface options & advanced options #9

SmallSix666 opened this issue Jan 22, 2024 · 6 comments

Comments

@SmallSix666
Copy link

An HDRP version would be perfect

@RobProductions RobProductions self-assigned this Jan 22, 2024
@RobProductions
Copy link
Owner

Hi @SmallSix666 , OpenGraphGUI should work with HDRP out of the box in theory, I just haven't tested it yet. If you'd like to try it out and let me know how it goes I can look into any issues that you encounter. Otherwise I'll see if I can test it myself some point soon. Thanks for your interest!

@SmallSix666
Copy link
Author

Basically can achieve, but HDRP comes with the Options property can not be called out, or URP
111

@RobProductions
Copy link
Owner

Basically can achieve, but HDRP comes with the Options property can not be called out, or URP

Ah gotcha, it seems like those extra fields might come from the HDShaderGUI class as described here but can't say for sure yet.

This might be a little tricky as it would mean extracting some of the functionality into components and working them into 2 separate classes to input into Shader Graph based on if you use URP or HDRP. Will take a look at this over the next few weeks when I have some time, and thanks for reporting it!

@RobProductions RobProductions changed the title HDRP Add support for HDRP surface options & advanced options Jan 23, 2024
@SmallSix666
Copy link
Author

Ok, looking forward to your update

@RobProductions
Copy link
Owner

I did a preliminary look into this and although I was able to get the Rendering.HighDefinition namespace imported into the assembly definition, it seems the necessary HDShaderGUI class is inaccessible due to its protection level:

image

This confused me because the link I shared above pointed to that as the recommendation solution to custom material inspectors, but that's when I realized it was part of the HDRP version 11.0 docs. If you take a look at the 10.0 docs you won't find any pages about customizing the inspector for ShaderGraphs that use HDRP. This is just a guess, but I believe this means support for that was added in version 11.0 when they must have made HDShaderGUI non-protected.

Unfortunately, to depend on version 11 would mean raising the minimum Unity version to 2021 LTS as opposed to 2020, and I would really like to keep 2020 support. Additionally I'm not sure what consequences there will be for adding the HDRP ASMDEFs to the OpenGraphGUI ASMDEF if the end user does not have those definitions present in their project. I found a way to add a compile time constant if HDRP version 10 or 11 is detected so that will be great for the code, but I don't know if Unity will complain about missing references in the .asmdef file.

Here's what could happen: a separate branch specifically for HDRP support could be made which both raises Unity minimum and requires HDRP 11.0, which would also allow us to make hardcoded references to the HDRP namespaces without worrying about compatibility issues. Sadly it would mean maintaining 2 separate code bases and as one person I'm not sure if I have the time to really deal with that as I'd really like to make sure Built-in and URP are supported as best possible. I'm sorry for the inconvenience :(

Still, there is a path for this to happen and I would like to see it, so for now I'll leave the issue open and think on it some more. If someone was able to test all of this properly and contribute the necessary HDRP code I could definitely get that branch set up. For now though I'll put it on the backburner and wait until I have more time. Thanks again for reporting your findings!

@SmallSix666
Copy link
Author

Ok, thank you very much

@RobProductions RobProductions removed their assignment Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants