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 for URP shader #75

Closed
dblatner opened this issue Apr 21, 2020 · 10 comments
Closed

Support for URP shader #75

dblatner opened this issue Apr 21, 2020 · 10 comments

Comments

@dblatner
Copy link

Hey there!

Wether using GLTFUtility for VR or mobile application, URP would boost performance a lot. This would be the first GLTF solution supporting URP at the moment.

Probably the only thing to update is:

  • have a compile-time check if URP is used
  • if URP then: change shader references from standard shaders/materials to URP shaders in the material importer

What do you think?

@Siccity
Copy link
Owner

Siccity commented Apr 21, 2020

Sounds simple enough. I can try, but I have no experience with URP.

@Stanke17
Copy link

Any update on this?

@marcusx2
Copy link

marcusx2 commented Aug 15, 2020

Please, URP is a must for mobile projects. Specially WebGL.

@Siccity Is URP support coming soon?

@Siccity
Copy link
Owner

Siccity commented Sep 8, 2020

Just added basic URP support. Please verify that the shaders work correctly.

@marcusx2
Copy link

marcusx2 commented Sep 8, 2020

@Siccity It works! Just one thing, it seems to add a metallic material to the model for no reason. There is no metallic material in the original model, is there a way to configure this?

So it's working, but it seems to assign the wrong materials/material properties.

I will give you an example, check out this model

Using Piglet, it looks like this, exactly how it looks like on sketchfab. But using GLTFUtility, it looks like this:

Untitled

EDIT
Oops, Piglet also assigns a metallic material. But on GLTFUtility it looks way, way more metallic for some reason.

It would be nice if it was possible to edit the material from the model directly without having to create a material preset. This would be extremely useful when there are tons of meshes, Because right now, I need to reassign the material to each mesh.

EDIT 2
If I edit the model to use a specular material with the same texture instead of metallic, it works perfectly. Maybe all you need to do is change to use a specular material by default instead of metallic? I tested with many models, this issue doesn't happen with just the example I showed above.

@Siccity
Copy link
Owner

Siccity commented Sep 8, 2020

@marcusx2 In normal PBR rendering conditions, a material is either metallic or specular. The model you are using is exported using metallic settings. GLTFUtility is correct to use metallic shader, and I assume both sketchfab and Piglet does the same. I think the problem here is that I set up the shader graph wrong, due to my inexperience with URP. You can edit the default shaders in GLTFUtility/Materials/URP. If you are able to spot the issue I can fix it.

@marcusx2
Copy link

marcusx2 commented Sep 8, 2020

@Siccity Oh I see. Sorry, I don't know the next thing about shaders either! Maybe you can try Unity Discord? They have a shader channel there.

@Siccity
Copy link
Owner

Siccity commented Sep 9, 2020

I just committed a small fix for the materials. I found that i had hooked the roughness input to the metallic output, and not hooked the metallic input to anything. Now it's all hooked up and hopefully looks better!

@marcusx2
Copy link

marcusx2 commented Sep 9, 2020

@Siccity Thanks! It's working perfectly now. Is there a way that I can edit the materials in the editor without having to create a copy? I mean
image
clicking on the material right there and editing it.

@Siccity
Copy link
Owner

Siccity commented Sep 10, 2020

@marcusx2 this is the default way Unity does it. You can't edit source materials on fbx or obj either. I might make a setting in the future that exports these source materials as editable copies

@Siccity Siccity closed this as completed Sep 10, 2020
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

4 participants