0
Under review
skeletorso 3 weeks ago • updated 3 weeks ago 7

I'm using shader forge 1.38 and unity 2017.1.0f3. Some existing shaders created in a previous version of shader forge generate a console error immediately upon opening them in the latest version and the material turns magenta.


Console reads:

Shader error in 'Shader Forge/waterFog': undeclared identifier 'sceneUVs' at line 93 (on glcore)

Compiling Vertex program with DIRECTIONAL


Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY 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


Under review

Do you have a screenshot on the node tree and the lighting settings?

Yeah, there are two shaders so far I've found in my project that have this issue. The one I posted the error for earlier has a lot of nodes and was hard to get it on an image. This one also has the problem but maybe will be easier to diagnose because it's smaller. This one also seems to produce two console errors which I'll paste below the image.


Console error 1:

Shader error in 'Shader Forge/shockWave': undeclared identifier 'sceneUVs' at line 123 (on glcore)

Compiling Vertex program with SHADOWS_DEPTH
Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF1 SHADER_API_DESKTOP UNITY_HARDWARE_TIER3


Console error 2:

Shader error in 'Shader Forge/shockWave': undeclared identifier 'sceneUVs' at line 70 (on glcore)

Compiling Vertex program with DIRECTIONAL
Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY 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




What happens if you change the Screen Pos mode from Tiled to Scene UVs?

There's no change. Still magenta, same console errors.

The error has something to do with the screen pos node. I was working on a new shader and got the error as soon as I used the screen pos node. It must be a bit more complicated than that because I'm using the screen pos node in other shaders that can open correctly.

It's likely because it's used in the refraction input in this case. It should work though, so it's a bug

The new shader that I was working on which broke when I attached the screen pos node that I mentioned in my last post was ultimately connected to vertex offset. Just letting you know in case it helps discover the issue.