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

[URP] Shader improvements #118

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

Kibsgaard
Copy link
Contributor

Hi Siccity,

Thanks for this great tool.

I started by improving the ShaderGraphs shaders to be feature complete and fixed some issues (see commit messages). You should be able to merge the first two commits as is.

After completing that, I found out the performance of those shaders is subpar, so I also modified the URP Lit shader to better support the glTF spec.
I changed the MetalRough, Occlusion and SpecGloss texture maps to the following:
Metallic (B), Roughness (1.0f - G), Occlusion (R).
Specular setup: Specular (RGB), Gloss (A). Occlusion (R)
The rest of the shader is the same and references the URP 'library' files directly.

I also added a helper class to setup the correct keywords depending on active textures, colors and modes. This is almost just a copy of BaseShaderGUI.cs (which is not available at runtime) from the URP package.

I changed the default URP ShaderSettings to use this modified Lit shader instead of the ShaderGraph shaders.

My main concern with this approach is cross-version support with different URP package versions. This Lit.shader and LitInput.hlsl was copied from URP 7.3.1 (Unity 2019.4.8f1). One solution could be to have separate shaders for each URP version with breaking changes.

@marcusx2
Copy link

@Siccity What do you think of these improvements?

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

Successfully merging this pull request may close these issues.

2 participants