0
Fixed

unity 5.3 beta PBR shader errors

Peter Leary 4 years ago • updated by Andy Buchanan 4 years ago 10

Hi there,

I just started up the 5.3 beta and I'm having a few issues with the PBR shader. When i go to create a new one in an empty project I get this message -


Shader error in 'Shader Forge/NewShader': 'max': no matching 2 parameter intrinsic function; Possible intrinsic functions are: max(float|half|double|min10float|min16float|int|uint|min12int|min16int|min16uint, float|half|double|min10float|min16float|int|uint|min12int|min16int|min16uint) at line 163 (on glcore)
Compiling Vertex program with DIRECTIONAL SHADOWS_OFF LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF
Platform defines: UNITY_NO_SCREENSPACE_SHADOWS UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_TEXTURE_ALPHASPLIT_ALLOWED

And this -

Shader error in 'Shader Forge/NewShader': undeclared identifier 'unity_LightGammaCorrectionConsts_PIDiv4' at line 163 (on glcore)

Compiling Vertex program with DIRECTIONAL SHADOWS_OFF LIGHTMAP_OFF DIRLIGHTMAP_OFF DYNAMICLIGHTMAP_OFF
Platform defines: UNITY_NO_SCREENSPACE_SHADOWS UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_DESKTOP UNITY_TEXTURE_ALPHASPLIT_ALLOWED


I realise this kind of thing happens a bit with beta verisions but I thought I'd mention it incase no one else has and I think the release is just around the corner (the 8th or so).

Thanks!

Pete

Answer

Answer
Fixed

This has now been fixed in 1.26

Answer
Fixed

This has now been fixed in 1.26

Hello, the Asset Store still seems to be serving up only the v1.25 package as of today.

You need to run 5.3.0f4 at least

Okay, have it now, I tried d/l whilst still in 5.2.3. Can I suggest you put the minimum version req. in the "download new version" message on the Shader Forge about dialog?


Ta!

I'm having problems with this line in multiple shaders (including your samples)


float specularPBL = max(0, (NdotL*visTerm*normTerm) * unity_LightGammaCorrectionConsts_PIDiv4 );


It's not able to resolve unity_LightGammaCorrectionConsts for some reason. Ideas?


Shader compiles fine if I forcein the raw constant value (3.141592653/4)




Just reopen it in SF 1.26 and it should fix itself

Yes I think it's okay now, I had some unexpected weirdness with the source controls systems there.


But please note that the packaged demo shaders don't work without being re-opened too :-)

Pretty sure I recompiled them before upload. Did you do a clean install? (Delete SF before importing the new version)

No, but it said it was replacing everything. It may have been lying about that. Hmmm.