+1
Fixed
Alpha Clip & Lightmap generate incorrect shadows
I'm still on 4.2.2f so some of this might not still be an issue for 4.3.X and I understand that it may or may not be fixed.
Using the provided Vegetation shader example:
Using the provided Vegetation shader example:
- Edit shader > Enable Lightmap support > Compile
- Shader Compile Errors:
- Shader error in 'Shader Forge/Examples/ClipAndTransmission': Program 'vert', unexpected #endif (compiling for d3d11) at line 17
- Edit shader > Disable OpenGL > Compile
- Shader Compile Warnings:
- Shader warning in 'Shader Forge/Examples/ClipAndTransmission': Program 'vert', unexpected #endif (compiling for d3d11) at line 17
- Shader warning in 'Shader Forge/Examples/ClipAndTransmission': Program 'vert', implicit truncation of vector type (compiling for d3d11) at line 38
- Shader warning in 'Shader Forge/Examples/ClipAndTransmission': GLSL preprocess error: Unmatched #endif at line 132
- Set object using Vegetation shader and ground shadow will cast on to Static > Bake Lightmap (Single Lightmap)
- Bake Lightmap Error:
- Material doesn't have a texture property '_MainTex'
- Edit shader > Rename "Diffuse" property to "MainTex" > Compile > Bake Lightmap (Single Lightmap)
Answer
0
Answer
Fixed
Freya Holmér (Developer) 11 years ago
Can be solved with Robert Briscoe's response below
This is actually a part of a bigger problem! It looks like turning on lightmapping will break your shaders if you're using transmission or light wrapping, which this shader does. I also noticed that the light probe data will be used even when lightmapped, so this turned into several issues in one.
(I also moved this from helpdesk to the main forum, marked as a bug)
(I also moved this from helpdesk to the main forum, marked as a bug)
Tricky. Are you able to get this to work with Unity's built-in shaders?
Interesting! (I'm researching why SF doesn't do this at the moment)
Just a thought that popped into my head, but could it be due to the way that SF writes to the depth buffer? IE: doesn't take alpha clip into account, I posted some findings about this in this bug:
http://shaderforge.userecho.com/topic/305397-doubl...
http://shaderforge.userecho.com/topic/305397-doubl...
It does take depth into account in all passes available, but I'm suspecting Unity is adding some sort of pass that I haven't accounted for
I just wanted to let you know that the first compile error has now been fixed in 0.19 :)
I rand into this problem a while back and it turned out that it was because Beast only bakes alpha masked shadows for shaders placed in the /Transparent/ Folder. It's a pain in the arse, and i'm not sure if it can be fixed through SF.
One thing that would be nice to add in regards to Lightmapping and SF shaders though is the addition of Transmissive Color.
More info on this here: http://answers.unity3d.com/questions/49537/can-transparent-textures-be-lightmapped.html?sort=oldest
One thing that would be nice to add in regards to Lightmapping and SF shaders though is the addition of Transmissive Color.
More info on this here: http://answers.unity3d.com/questions/49537/can-transparent-textures-be-lightmapped.html?sort=oldest
Awesome, thanks robert.briscoe, that did the trick for the shadows!
Might need an alert in SF or something to tell users this.
Might need an alert in SF or something to tell users this.
The Beast implementation seems more and more hacked in. Unity could use a proper lightmapping solution, this is just an interface design nightmare.
I will have to add a console to SF that displays warnings like this
I will have to add a console to SF that displays warnings like this
Answer
Fixed
Can be solved with Robert Briscoe's response below
What about adding an option to set Transmissive Color in SF for Lightmaps? Perhaps it could just detect a colour node plugged into the transmission input in the editor and use that?
Customer support service by UserEcho