- Home /
Custom shader of sprite results in black alpha.
I want to implement the highlighting of sprite with custom shader in my 2d top-down game. I'd downloaded a few from internet and tried to play with them but faced insurmountable issue. My transparent part of sprite become black for any custom shader. Here is what I mean:
default shader: Sprite\Default
custom shader: Custom/Grayscale
I tried about 5 different shaders, but result is the same. Is Anybody know whether the problem is in shader or maybe it is in my sprite sheet?
I've find out. The problem is in shaders. Solve it by adding commands in SubShader part:
Cull Off Lighting Off ZWrite Off Fog { $$anonymous$$ode Off } Blend SrcAlpha One$$anonymous$$inusSrcAlpha
When writing shaders for sprites it's always a good idea to start from the Sprites/Default shader.
Your answer
Follow this Question
Related Questions
Rewrite simple alphamask fixed function shader to surface or cg shader 2 Answers
Cutting hole from player character to camera through multiple sprites with edge blending 0 Answers
ShaderGraph Position from Texture Sample Issue 0 Answers
How to render a sprite in the opaque pass 0 Answers
Shader sprite overlay other sprites 0 Answers