Jump to content

  • Log In with Google      Sign In   
  • Create Account


Restoring the stencil on x360


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
No replies to this topic

#1 sinfawkes   Members   -  Reputation: 103

Like
0Likes
Like

Posted 02 November 2013 - 05:07 AM

Hi,

 

In our project, we want to get better performance on Xbox360, so for some specific pass, we want to use hi-stencil to do some pre-PS culling. But unfortunately, some bits of the stencil buffer were used for other reasons in other passes. So my idea is as below if restoring stencil value is available,

 

a. render the geometries with color writing disable, and set the unused stencil bit to my specific value.

b. render the geometries with color writing disable, and zero the unrelated stencil bits with writing mask. On the other hand, use the hi-stencil ref num same as the stencil value, with hi-stencil func notequal. So the pixels which are not on the geometries are set to culled in hi-stencil buffer.

c. render full screen quad with ps and coloring writing on. So just render on the part with hi-stencil not culled.

d. restore stencil buffer to the original value.

 

Yeah, I've already know that we can restore the depth value using a simple depth-restore ps with color writing disabled. My question is that, can we create a simple ps to retore stencil buffer? Or is there any other solution for my situation?



Sponsor:



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