|
behind effect
#446865
11/03/14 11:38
11/03/14 11:38
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
OP
Expert
|
OP
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
hi, I want to implement in future a behind-effect shader, a usual thing in RTS games displaying units behind trees/buildings/obstacles as a coloured outline or a filled shape like this: any idea how does it work? I want to avoid using a new view, maybe a 2nd pass is enough? thanks.
|
|
|
Re: behind effect
[Re: sivan]
#446875
11/03/14 16:56
11/03/14 16:56
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
I'd go for some custom pixel shader with depth testing...
Maybe there's some other, clever way using ZFunc and rendering the model several times.
EDIT: yeah, writing the model with a first pass (blue-see-through-wall-colored, no depthtesting, no alphawrite) and then rendering the model in a second pass as usual (with depthtesting and alphawrite)
maybe it's even easier, I don't know what kind of stuff zFunc supports since I never use it...
Last edited by Kartoffel; 11/03/14 17:03.
POTATO-MAN saves the day! - Random
|
|
|
Re: behind effect
[Re: MasterQ32]
#446892
11/03/14 21:57
11/03/14 21:57
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
maybe it can be done a little bit more efficient (although still with two passes) I'll give it a try but not today anymore
POTATO-MAN saves the day! - Random
|
|
|
|