- Home /
The question is answered, right answer was accepted
Shadows looks different in editor than in build
I have run through a lot of posts yesterday in order to achieve real time shadows with Sprites, using the sprite renderer and a modified version of the Diffuse shader that is built in inside unity and it looks nice in the editor and game window but whenever I make a build the shadows looks ugly:
Does anyone have an idea why this could be happening?
the build is running in fantastic...
you are using custom shader ==> Shader have target render platform . Your build platform is not support the shader. Like old Android not support shader using OpenGL 3.0. Or Android not support shader using DX 9.
Check if your shader have the right target build
I have downloaded the Built-In Shaders of Unity and I have modified the "Sprite-Diffuse"
I have modified the last line: original: Fallback "Transparent/VertexLit" change: Fallback "Transparent/Cutout/VertexLit"
and I have modified the property "Cast Shadows" that is hidden in the inspector on the sprite renderer, my build platform is PC
not really an answer, but a possible alternative... wouldnt it be easier to duplicate your character, make his material grey/transparent, and feed the same animations in? if your shadow is always going to be on a flat background, this would work. if youre casting shadows over 3d geometry or more complex situations, it wouldnt work.
@b1gry4n - thanks for your reply, I wanted to have more realistic shadows because the geometry will not be flat, that scenario was only for testing purposes, I have achieved the desired effect by modifying the Standard Shader of Unity, the solution seems to work fine except for unity 5.6
Answer by xrguajardo · Jun 02, 2018 at 02:18 AM
Modified the standard shader , added the subshader of the Sprite-Diffuse at the very beginning and now it's working fine, it's also required to change the render queue to 3000