- Home /
Is there a way to do this effect/shader?
hi all, i'm trying to do this kind of shader, some kind of blending to background without rendering any object behind the one with this shader, is this possible? i put some screenshots of the effect i want and the effect i have.
first i took this shader from the invaders project of Eric5h5
Shader "Alpha/SelfIllum" {
Properties {
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white"
}
Category {
Lighting On
ZWrite Off
Cull Back
Blend SrcAlpha OneMinusSrcAlpha
Tags {Queue=Transparent}
SubShader {
Material {
Emission [_Color]
}
Pass {
SetTexture [_MainTex] {
Combine Texture * Primary, Texture * Primary
}
}
}
}
}
i tried to modify it without success, this is the effect i have:
and this is the effect i tried to achieve:
is this even possible ? thanks for your answers, basically im trying to do some kind of "fake destructible 2d terrain" as the one in the Eric5h5's invaders project was great but for phone seems to be a bit slowly
Do you mean, the transparent part of your object (sphere) would have it ignore any objects behind it, and just render the background there?
i found this http://www.unifycommunity.com/wiki/index.php?title=Depth$$anonymous$$ask , i think that's enough for now, if anyone, if anyone has a better solution please tell me !
You need to use a better background for your terrain; look at the ratty outline.
Answer by FishBone · Feb 15, 2012 at 07:13 PM
Changing ZWrite to On, and deleting the line "Tags {Queue=Transparent}" should probably do it.
Your answer
Follow this Question
Related Questions
How to make additive-shaded particles appear behind sprites? 2 Answers
Camera with shader? 2 Answers
how to change progection matrix for some objects 0 Answers
Semi transparent Object behind walls? 1 Answer
Png Surfaces transparent overlapping 1 Answer