0
Not a bug

Lightmap Support Error

robchristian3d 10 jaar geleden bijgewerkt door Freya Holmér (Developer) 9 jaar geleden 9
Updated Shaderforge from version 0.36 to 1.06
Since then ticking on Lightmap Support is causing my shaders to turn pink with this error.

Shader error in 'Shader Forge/Specular/Robs_Diff+Spec+Normal_Shader': undeclared indetifier 'unity_LightmapST' at line 91'

I found I could fix it by adding
half4 unity_LightmapST;
sampler2D unity_Lightmap;
to the shader file underneath the first block of lines that begin with 'uniform'

Image 373

The problem with that solution is that it gets removed every time I edit or open the shader in Shader Forge.

Is there any solution to this? I realise that support for unity 4 has been dropped after 1.06, but unfortunately I'm unable to upgrade with the game I'm currently working on. Are you still doing any bug fixes for the unity 4 version? Alternatively, is there a way to downgrade to a previous version of Shader Forge? I'd use the version that was working for me in my old backups, however that was all the way back in beta with 0.36 so is missing other things I need.

Any support you can give would be much appreciated.
Thanks.

Antwoord

Antwoord
Not a bug
You can't use the Unity 5 version of SF in Unity 4, you'll get issues like this.
And yes, I'm no longer supporting Unity 4 SF, which is why I'll always recommend going Unity 5!

If you want the old version, download it through Unity 4, and you'll get the latest compatible version
Antwoord
Not a bug
You can't use the Unity 5 version of SF in Unity 4, you'll get issues like this.
And yes, I'm no longer supporting Unity 4 SF, which is why I'll always recommend going Unity 5!

If you want the old version, download it through Unity 4, and you'll get the latest compatible version
Hey thanks for getting back to me. For clarity, I'm using 1.06 which is the version I get when downloading from the asset store on Unity 4.
Ah, hm, odd. Not sure what might have caused that :/
Mail me and I'll give you an old version if you like
Hi Joachim, I'm using SF 1.06 in Unity 4.6.6.p3 and finding I'm getting bugs as soon as I toggle Lightmapping in SF. Even with just a diffuse (_MainTexture) hooked up. The errors I'm getting:

Shader error in 'Custom/PitchSF': undefined variable "unity_LightmapST" undefined variable "unity_LightmapST" at line 65
Shader error in 'Custom/PitchSF': undefined variable "unity_Lightmap" unable to find compatible overloaded function "tex2D(error, float2)" at line 76
So reading above it looks like the wrong version of SF gets downloaded with U4. Is this going to be rectified? I see this is marked as answered but the problem isn't really fixed and it's been 5 days since I posted. I also am on 1.06 (downloaded with U4). Please update or provide a version that works with U4. Thanks
As there's been no response I've made a new thread specifically for the U4 1.06 issue (perhaps this one isn't being read since it's marked as fixed/not a bug). Really need this looked at as we're shipping very soon. http://shaderforge.userecho.com/topic/790560-/
I am also getting the same bug: using Unity 4.6.3 and SF from the asset store. (1.06). I cant upgrade to Unity 5 as my project has too many 3rd party dependencies to switch at the moment.
You'll need to use the workaround in the first post in that case I'm afraid :(