Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


clear only partial bits of stencil buffer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 joeblack   Members   -  Reputation: 261

Like
0Likes
Like

Posted 14 May 2014 - 06:20 AM

Hi,

i would like to use stencil buffer for two different things, so that first 4 bytes will encode one value and second 4 bytes different value.

 

I can do this by   StencilWriteMask   and StencilReadMask , but my issue is that one value will not change during frame, but second will change multiple times, so i need to clear this value multiple times per frame.

 

When i call ClearDepthStencilView with StencilWriteMask will it only affect chosen values ? Or i need to perform "clean" manually with full screen quad ?



Sponsor:

#2 kauna   Crossbones+   -  Reputation: 2745

Like
1Likes
Like

Posted 14 May 2014 - 09:34 AM

As far as I know, it isn't possible to preserve Stencil buffer bits. 

 

When you say bytes, I assume that you are talking about bits. 

 

Cheers!



#3 BornToCode   Members   -  Reputation: 935

Like
1Likes
Like

Posted 14 May 2014 - 10:16 AM

The entire stencil must be cleared at once. you cannot just clear a portion of it.



#4 joeblack   Members   -  Reputation: 261

Like
1Likes
Like

Posted 14 May 2014 - 10:50 AM

As far as I know, it isn't possible to preserve Stencil buffer bits. 
 
When you say bytes, I assume that you are talking about bits. 
 
Cheers!


Yes, i ment bits, i allways mess it up

#5 Burnt_Fyr   Members   -  Reputation: 1245

Like
2Likes
Like

Posted 14 May 2014 - 03:03 PM

One option would be to setup a stencil op such as ZERO, or REPLACE ,  in combination with your write mask, and render a full screen quad, so that each pixel of the stencil buffer is written to what you want. This would add some Draw calls, but would get the functionality that you want.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS