Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (firecrest, AndrewAMD), 387 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
behind effect #446865
11/03/14 11:38
11/03/14 11:38
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline 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.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: behind effect [Re: sivan] #446866
11/03/14 12:17
11/03/14 12:17
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Set ZNEAR or add the corresponding render states for ZFunc and so on..


Visit my site: www.masterq32.de
Re: behind effect [Re: MasterQ32] #446867
11/03/14 13:47
11/03/14 13:47
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
ööö... now I'm not sure exactly how but at least a good starting point laugh


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: behind effect [Re: sivan] #446868
11/03/14 13:54
11/03/14 13:54
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
znear is a flag. You just have to use set();


POTATO-MAN saves the day! - Random
Re: behind effect [Re: Kartoffel] #446871
11/03/14 14:48
11/03/14 14:48
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
I know that. but don't know how to utilize it to display the covered parts of an animated model with a colour, when it is partially covered by another model.


Free world editor for 3D Gamestudio: MapBuilder Editor
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 Offline
Expert
Kartoffel  Offline
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: Kartoffel] #446883
11/03/14 19:26
11/03/14 19:26
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
i think kartoffels idea is the right way i don't think it will work in one pass


Visit my site: www.masterq32.de
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 Offline
Expert
Kartoffel  Offline
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
Re: behind effect [Re: Kartoffel] #446897
11/04/14 08:12
11/04/14 08:12
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
thanks, what I really needed was the concept. 2 passes migth be okay, probably I'll use it only for the 1st 1-2 lods to lower performance cost caused by the high unit model quantity.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: behind effect [Re: sivan] #446901
11/04/14 10:47
11/04/14 10:47
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline OP
Expert
sivan  Offline OP
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
by ZEnable I can do this (ZFunc does not really help and ZNEAR also seems to be not useful):



unfortunately unit-to-unit coverage has a bad look I can't resolve currently...


Free world editor for 3D Gamestudio: MapBuilder Editor
Page 1 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1