guycalledfrank / bakery-issues

Bug tracker for Bakery
4 stars 0 forks source link

shader errors in the console #39

Closed laurentopia closed 3 years ago

laurentopia commented 3 years ago

when i updated the URP shadergraphs from the new shader I get these errors in the console `Shader error in 'hidden/preview/Add_54DC0F2B': undeclared identifier '_MainLightWorldToShadow' at Assets/Bakery/shader/ShaderGraph/URP/BakeryDecodeLightmap.hlsl(340) (on d3d11)

Compiling Vertex program Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING Disabled keywords: UNITY_NO_DXT5nm UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_VIRTUAL_TEXTURING ` image

guycalledfrank commented 3 years ago

URP graphs will show errors in the editor/console, but will work in the scene, because there are different keywords defined in these scopes.

laurentopia commented 3 years ago

when I change the graph, for example move the node's position, not even connect new things, then save it it turns pink though.

laurentopia commented 3 years ago

also this happens image

laurentopia commented 3 years ago

i'm testing in a blank project with The Bakery unpacked in and oddly enough, what used to work fine a few days ago now pinks out image I'm stumped!

laurentopia commented 3 years ago

image

guycalledfrank commented 3 years ago

Hmm the errors are not exactly what I'd expect. In the graph editor, if you click a little gear icon on any "Custom" node, does it still link to BakeryDecodeLightmap file? Will it work if you reassign the file? Also I wonder if you moved the folder with the graphs (it feels like SG may store project-root-relative paths)

laurentopia commented 3 years ago

yes it links to the decode file image I reassigned but same this one is the default bakery project in default location...

guycalledfrank commented 3 years ago

Does it still happen with the patch from this issue? https://github.com/guycalledfrank/bakery-issues/issues/47

laurentopia commented 3 years ago

everything works now! what did you do?

guycalledfrank commented 3 years ago

I just put shadow-related code inside #ifdef UNIVERSAL_SHADOWS_INCLUDED. Seems like it's defined in every scene of my project, but undefined in the shader editor. I guess it's also not defined in your project for some reason. Anyway, works this way.