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

Support HDRP materials #73

Open
cpetry opened this issue Apr 17, 2020 · 13 comments
Open

Support HDRP materials #73

cpetry opened this issue Apr 17, 2020 · 13 comments

Comments

@cpetry
Copy link
Contributor

cpetry commented Apr 17, 2020

Hi there,

I would like to update my project to HDRP.
Currently this package uses its own shaders.
Is there a way to put in a switch to use HDRP shaders instead of the custom GLTF shaders?

I would gladly contribute when I got time again.

@Siccity
Copy link
Owner

Siccity commented Apr 17, 2020

I think we did something along those lines already in a previous update. Have you tested?

@cpetry
Copy link
Contributor Author

cpetry commented Apr 17, 2020

Did not yet test it but I know of materials being able to convert from StandardShader to HDRP Lit and alike. This though only works in editor mode. I would need that in runtime.
I'll test and report back.

@cpetry
Copy link
Contributor Author

cpetry commented Apr 17, 2020

By the way:
What is the reason behind the custom shaders? Wouldn't it be possible to just set all material parameters on Standard shaders?

@Siccity
Copy link
Owner

Siccity commented Apr 18, 2020

GLTF packs textures a bit differently. Instead of repacking textures, i figured i'd let people use their GLTF textures as-is.

@cpetry
Copy link
Contributor Author

cpetry commented Apr 18, 2020

Just noticed something:
I changed normal map handling in the shaders to using UnpackScaleNormal().
As you don't convert them to "Unity NormalMaps" this is wrong.
Sorry for this.

It would greatly reduced import speed I assume if this conversion would be implemented. See https://answers.unity.com/questions/801670/runtime-loading-normal-texture.html
Therefore this should be changed back in your shaders

@cpetry
Copy link
Contributor Author

cpetry commented Apr 18, 2020

After thinking about it further:
Shouldn't there be any unpacking at all inside the shader? The direction itself should be already existing "as-is"

@cpetry
Copy link
Contributor Author

cpetry commented Apr 20, 2020

Just checked it. It seems UnpackScaleNormal() is right here after all. Sorry for the confusion.
Didn't find though a conversion inside the scripts. Does GLTF by default save it correctly for Unity?

@cpetry
Copy link
Contributor Author

cpetry commented Jun 4, 2020

Just checked: HDRP does not work out of the box like this. Shader parameter names are completely different. On the HDRP package are editor scripts for converting these.
I will see if I can start on using the HDRP Lit shader and setting some basic parameters accordingly.

@LaserYGD
Copy link

LaserYGD commented Feb 1, 2022

Also interested in this, just found out it's not supported.

@LaserYGD
Copy link

LaserYGD commented Feb 1, 2022

Works fine on URP/built-in, would be great to get it on HDRP since that's the render pipeline most archviz and high-end graphics use which would be helpful since we'd be able to get unreal assets to unity HDRP.

@dirrogate
Copy link

same here. Would love to have a way to upgrade Gltf shaders to Hdrp. Even, if only from editor.

@keyserjaya
Copy link

Bump +1

@ghost
Copy link

ghost commented Mar 12, 2022

I got this working on HDRP simply by opening the shaders and adding HDRP to the target list on 2021.2, works fine just with that one simple step!
https://i.gyazo.com/f73410e23cdf8d219f6916c4fe22d520.png

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

5 participants