Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Stencil buffer/multiple values.. #48879
07/08/05 13:55
07/08/05 13:55
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
I wasnt sure what forum to put this in...it's related to shaders so..
Ok, suppose i want to render multiple stencil shadows, and use this stencil buffer in a lighting shader. Is there some way to use the same stencil buffer to hold all the data for several shadow pases (say 4)..? I cant really figure out how the stencil buffer really works..(i have all this working by using multiple stencil buffer surfaces) I cant find any good documentaion on what the renderstates like STENCILMASK and STENCILWRITEMASK really do, or what the available values are.. and how do they relate to STENCILREF? I'm sure anyone who knows something about this will understand what i'm asking..

Re: Stencil buffer/multiple values.. [Re: Matt_Aufderheide] #48880
07/08/05 15:15
07/08/05 15:15
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Check the MSDN reference I posted in one of the stickies, it has those states listed and you can get more information on them from there .

-Rhuarc


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog
Re: Stencil buffer/multiple values.. [Re: Rhuarc] #48881
07/08/05 16:23
07/08/05 16:23
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
Yes i have looked at the refernces, but i still dont see any real explanation of how it works.. only very basic stuff. I have tried writing with a differnert mask, and various stencil refs.. nothing works.. is there any way to to render multiple shadows with one depthstencil buffer? I suppose i could try clearing the stencil buffer for every pass, render the shadows, then render a light pass.. but this seems awkward.

Re: Stencil buffer/multiple values.. [Re: Matt_Aufderheide] #48882
07/08/05 19:45
07/08/05 19:45
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Yeah, that does seem a little odd, and would be better if you could just do it once. I'll take a peek at it sometime this weekend and let you know if I find anything...

-Rhuarc


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog
Re: Stencil buffer/multiple values.. [Re: Rhuarc] #48883
07/09/05 14:36
07/09/05 14:36
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
Ok .. well i have gotten it work by just rendering each pass seperately, rendering the shadows in-between.. this seem to be fast..This way you only need to use one depth buffer, and only render the scene to z-buffer once.. then you can turn off zwriting from then on. I guess this is the way it's done..


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