GLTFUtility icon indicating copy to clipboard operation
GLTFUtility copied to clipboard

Support HDRP materials

Open cpetry opened this issue 4 years ago • 13 comments

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.

cpetry avatar Apr 17 '20 17:04 cpetry

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

Siccity avatar Apr 17 '20 18:04 Siccity

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 avatar Apr 17 '20 19:04 cpetry

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?

cpetry avatar Apr 17 '20 19:04 cpetry

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

Siccity avatar Apr 18 '20 00:04 Siccity

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 avatar Apr 18 '20 20:04 cpetry

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 avatar Apr 18 '20 21:04 cpetry

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 avatar Apr 20 '20 05:04 cpetry

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.

cpetry avatar Jun 04 '20 17:06 cpetry

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

LaserYGD avatar Feb 01 '22 14:02 LaserYGD

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.

LaserYGD avatar Feb 01 '22 16:02 LaserYGD

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

dirrogate avatar Feb 23 '22 08:02 dirrogate

Bump +1

keyserjaya avatar Mar 04 '22 09:03 keyserjaya

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

ghost avatar Mar 12 '22 03:03 ghost