x


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:

alt text

and this is the effect i tried to achieve:

alt text

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

more ▼

asked Feb 13 '12 at 06:35 PM

Sytto gravatar image

Sytto
43 5 6 10

Do you mean, the transparent part of your object (sphere) would have it ignore any objects behind it, and just render the background there?

Feb 13 '12 at 11:44 PM DaveA

yes, is this possible? thank for your answer

Feb 14 '12 at 01:36 PM Sytto

i found this http://www.unifycommunity.com/wiki/index.php?title=DepthMask , i think that's enough for now, if anyone, if anyone has a better solution please tell me !

Feb 14 '12 at 02:31 PM Sytto

You need to use a better background for your terrain; look at the ratty outline.

Feb 14 '12 at 02:51 PM Jessy

I think taht it is closeup :)

Feb 15 '12 at 01:48 PM cupsster
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Changing ZWrite to On, and deleting the line "Tags {Queue=Transparent}" should probably do it.

more ▼

answered Feb 15 '12 at 07:13 PM

FishBone gravatar image

FishBone
151 1 3

thanks, it worked

Feb 15 '12 at 11:13 PM Sytto
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1649
x1091
x265
x17
x15

asked: Feb 13 '12 at 06:35 PM

Seen: 596 times

Last Updated: Feb 15 '12 at 11:13 PM