Coder Social home page Coder Social logo

zallist / unity.zallist.universal-simple-lit-shadergraph-target Goto Github PK

View Code? Open in Web Editor NEW
86.0 86.0 14.0 66 KB

This plugin simply adds a Simple Lit material (SubTarget) to the Universal target for Shader Graph for URP

License: Other

C# 81.05% HLSL 18.95%
csharp hlsl shadergraph unity universal-render-pipeline urp

unity.zallist.universal-simple-lit-shadergraph-target's People

Contributors

bmourit avatar bnmguy avatar grenappels avatar zallist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unity.zallist.universal-simple-lit-shadergraph-target's Issues

Add deferred rendering support

Add support for deferred rendering.

  • Update kPipelineTag to SimpleLit, since deferred reads the Tag
  • Update the PBRGBufferPass.hlsl to SimpleLitGBufferPass.hlsl and modify it to do the right stuff for Blinn Phong

I'm not gonna work on this one myself unless there's multiple requests for it, but it should be super easy to do just following the existing SimpleLit shader's usage of G buffers & changing the kPipelineTag

Unity 2022.3.3 and URP 14.0.8 No rendering in builds but in editor

Hello,

I recently updated to the newest Unity LTS version and with that to the corresponding URP packages. In the editor, everything looks good but if I made a build (all platforms so far) the objects using a shader graph with simple lit are not rendering at all.

Any ideas on how to solve it?

Can not build on unity 2021.3.3 for android Vulkan

Shader error in 'Shader Graphs/LavaShader2': 'SafeNormalize': no matching 1 parameter function at /Users/isfaq/Workspace/Thunder/GrassRoller/GrassRoller/Library/PackageCache/[email protected]/Editor/ShaderGraph/Includes/PBRGBufferPass.hlsl(26) (on vulkan)

Compiling Subshader: 0, Pass: Pass 1, Vertex program with FOG_LINEAR _GBUFFER_NORMALS_OCT _MAIN_LIGHT_SHADOWS_CASCADE _MIXED_LIGHTING_SUBTRACTIVE
Platform defines: SHADER_API_MOBILE UNITY_ASTC_NORMALMAP_ENCODING UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_NO_CUBEMAP_ARRAY UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_RGBM UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION
Disabled keywords: DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 UNITY_COLORSPACE_GAMMA UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_VIRTUAL_TEXTURING _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN

Support URP 14 & Unity 2022.2

Unity pushed out version 2022.2 and URP 14. This introduced a bunch of breaking changes, mostly because they renamed and moved things.

Error after install

I get 18 errors after installation.
Library\PackageCache\com.zallist.universal-shadergraph-extensions@4721c0c\Editor\ShaderGUI\ShaderGraphSimpleLitGUI.cs(5,30): error CS0234: The type or namespace name 'Universal' does not exist in the namespace 'Unity.Rendering' (are you missing an assembly reference?)
Library\PackageCache\com.zallist.universal-shadergraph-extensions@4721c0c\Editor\ShaderGraph\Targets\UniversalSimpleLitSubTarget.cs(10,58): error CS0234: The type or namespace name 'SubShaderUtils' does not exist in the namespace 'UnityEditor.Rendering.Universal.ShaderGraph' (are you missing an assembly reference?)
...
any idea?
Unity 202.3.31, URP 10.8.1

Test if this works on URP 12 & URP 14

  • Just download it and see if it works on URP 12 (2021.2 & 2021.3) and URP 14 (2022.2)

It should just work unless there's something obvious missing in the .hlsl file. Probably just the blend mode preserving specular is broken, which isn't supported on Lit in URP 12 anyway.

Error CS0117 in Unity 2022.2.15f

Hi, firstly want to say thanks for implementing this in shadergraph.

Im getting multiple CS0117 errors after upgrading Unity to build 2022.2.15f. Was working fine in previous builds

Enabling decals breaks shaders on URP 12.1.7 (Unity version 2021.3.13f1)

Hello, love that this exists, it's wonderful so thank you. I'm encountering an issue where if I enable decal renderer feature, my shader stops compiling with this error:

Shader error in 'Shader Graphs/human': l-value specifies const object at /Users/grena/Documents/unity/star-door/Library/PackageCache/com.zallist.universal-shadergraph-extensions@1c0fc81fda/Editor/ShaderGraph/Includes/SimpleLitGBufferPass.hlsl(112) (on d3d11)

Compiling Subshader: 0, Pass: GBuffer, Fragment program with LIGHTMAP_SHADOW_MIXING _DBUFFER_MRT3 _GBUFFER_NORMALS_OCT _MAIN_LIGHT_SHADOWS _MIXED_LIGHTING_SUBTRACTIVE _REFLECTION_PROBE_BLENDING _REFLECTION_PROBE_BOX_PROJECTION
Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
Disabled keywords: DEBUG_DISPLAY DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON DYNAMICLIGHTMAP_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_ON SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _DBUFFER_MRT1 _DBUFFER_MRT2 _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN _RENDER_PASS_ENABLED _SHADOWS_SOFT

the code at line 112 is

#ifdef _DBUFFER
    ApplyDecal(unpacked.positionCS,
        surfaceDescription.BaseColor,
        specular,
        inputData.normalWS,
        /*metallic,*/
        0,
        /*surfaceDescription.Occlusion,*/
        1,
        surfaceDescription.Smoothness);
#endif

I will try upgrading to a newer version of unity since I'm not in production or anything, but I might be stuck on the current version and just wanted to flag that this specific thing was broken for me.

Add 2D renderer support

Right now the 2D renderer is just using the PBR2DRenderer.hlsl pathway, which is not the Simple Lit one. Someone needs to swap that for a 2D one based on the existing Simple Lit.shader 2D pass, in the same way, and then change the C# code to reference the new .hlsl file.

If I get any interest on this, I'll probably do it myself.

Implement backwards compatibility changes for URP 12

@bmourit on issue #3 has pointed out that this Simple Lit shader does NOT work on URP 12. This issue encompasses the work to getting it to work:

  • #if checks in C# code so that BlendModePreserveSpecular is stripped before unity 2022
  • keyword or safety check in hlsl to remove the blendmode code

Add VFX Graph support

  • Update the relevant GUI to work with VFX graph

I'm not gonna work on this one until either I need it, or there's multiple requests on it. It should be super simple since it's just a missing GUI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.