Advanced stencil buffer ops
Advanced stencil buffer ops
Hello!
I am just probably blind, but can't find answer in docs.
I need to manipulate with stencil buffer and use it for masking.
So is there any way to achieve these without modifying the library?
1) Stencil ops like invert/increment/decrement
2) Select depth/stencil buffer mode like 8-bits for stencil and 24-bit depth (and what is default)
3) Color masking (like render into blue channel only or disabling color rendering at all)
4) Rendering directly to stencil buffer from pixel shader
Thanks in advance! I'd be looking for this forever...
I am just probably blind, but can't find answer in docs.
I need to manipulate with stencil buffer and use it for masking.
So is there any way to achieve these without modifying the library?
1) Stencil ops like invert/increment/decrement
2) Select depth/stencil buffer mode like 8-bits for stencil and 24-bit depth (and what is default)
3) Color masking (like render into blue channel only or disabling color rendering at all)
4) Rendering directly to stencil buffer from pixel shader
Thanks in advance! I'd be looking for this forever...
Re: Advanced stencil buffer ops
You have to modify the library. The stencil buffer is only used by the shadow volumes, and there is no any direct way to modify it.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Advanced stencil buffer ops
Ok thanks!
So question to library maintainers.
Is there any good reason for this? I offer to write the patch for SMaterial.
IMHO it is an elementary function of any 3D engine and should be accesible directly through Irrlicht API (Ogre also has it accessible in material system).
So question to library maintainers.
Is there any good reason for this? I offer to write the patch for SMaterial.
IMHO it is an elementary function of any 3D engine and should be accesible directly through Irrlicht API (Ogre also has it accessible in material system).
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Advanced stencil buffer ops
Well, we discussed this a while ago, and did not yet decide whether we really need stencil modes in the material system, or just in scene manager settings. Because it's only required to have it in SMaterial if these values change from object to object during one render stage. Otherwise, it could be provided via a different, e.g., a shadow scene and the main scene. But for a first start you could provide a patch for the basic driver interfaces to access stencil settings. These functions could then be used for the higher levels once we know where to put it.
Re: Advanced stencil buffer ops
I've been using stencil ops without modifying the library for a long time.
Works well since irr doesn't touch the stencil when one doesn't use its stencil shadows.
The color masking is already supported, and rendering to stencil is really slow, so you really don't want to do that on any card.
Works well since irr doesn't touch the stencil when one doesn't use its stencil shadows.
The color masking is already supported, and rendering to stencil is really slow, so you really don't want to do that on any card.
Re: Advanced stencil buffer ops
2 hendu:
Well I need it for "Stencil then cover" vector graphics rendering like NV_path_rendering.
What I am trying to acomplish is to make accelerated VG library for my bachelor thesis.
And this is the best (fastest & simplest) way to do that. In fact it definitely is not that
slow as you say. The performance is really good. I got just nasty hacked demo at this point,
so I cannot provide any further info. But if everything will be according to plan, I will
release the library demo with source here in next few weeks.
2 hybrid:
I am on it
Well I need it for "Stencil then cover" vector graphics rendering like NV_path_rendering.
What I am trying to acomplish is to make accelerated VG library for my bachelor thesis.
And this is the best (fastest & simplest) way to do that. In fact it definitely is not that
slow as you say. The performance is really good. I got just nasty hacked demo at this point,
so I cannot provide any further info. But if everything will be according to plan, I will
release the library demo with source here in next few weeks.
2 hybrid:
I am on it
Re: Advanced stencil buffer ops
Are you related to cairo by any chance? Recent talk on phoronix is that rendering trapezoids on the cpu is still faster unless you have a really good gpu (ivy bridge is not enough for example).
Re: Advanced stencil buffer ops
I am just cairo user
Main point of the thesis is to let everything compute on GPU from path (line strip) and compare results.
But If you ever see the NV_path_rendering extension, they claim it is many times faster than cairo
(there are graphs in their paper). So I really look forward to see my results.
Main point of the thesis is to let everything compute on GPU from path (line strip) and compare results.
But If you ever see the NV_path_rendering extension, they claim it is many times faster than cairo
(there are graphs in their paper). So I really look forward to see my results.
Re: Advanced stencil buffer ops
Yes, on a high-end Nvidia GPU no doubt
I googled nv_path_rendering benchmarks, and found this:
http://zrusin.blogspot.fi/2011/09/nv-pa ... ering.html
Qt software rendering was 4x the speed of the gpu-accelerated nv extension, on a Quadro 600.
I googled nv_path_rendering benchmarks, and found this:
http://zrusin.blogspot.fi/2011/09/nv-pa ... ering.html
Qt software rendering was 4x the speed of the gpu-accelerated nv extension, on a Quadro 600.
Re: Advanced stencil buffer ops
Yes, as you say no doubt
I cannot compare anything with that 'cause I am running on HD5870.
Second think is, I am currently targeting SM4 cards and working with
geometry shaders which eliminates many old cards. Thats why I am
interested in the results. At this point "only Carmack knows!"
I cannot compare anything with that 'cause I am running on HD5870.
Second think is, I am currently targeting SM4 cards and working with
geometry shaders which eliminates many old cards. Thats why I am
interested in the results. At this point "only Carmack knows!"
Re: Advanced stencil buffer ops
So here comes the first diff for stencil access!
(I am ready for criticism and to modify it.)
Diff file here
(I am ready for criticism and to modify it.)
Diff file here
-
- Competition winner
- Posts: 80
- Joined: Tue Jun 29, 2010 10:06 pm
- Location: Valencia, Spain
Re: Advanced stencil buffer ops
It would help to have total control of the Stencil Buffer. Would be easier to make, optimizations shadows and other actions.
We know that the future is in use Shadow Maps, but there are still nostalgic like me
PD: Thanks Kalda for the DIFF!!!
We know that the future is in use Shadow Maps, but there are still nostalgic like me
PD: Thanks Kalda for the DIFF!!!
Follow me on twitter: @themrcerebro