Forum

Stencil Buffer?

Is it planned to implement access to the directx stencil buffer? or are there other tricks to use a texture as a mask for a second texture without having graphiccard with pixelshader ?

thx ele

whats you graphics card ? with older graphics cards with pixelshader 1.4 it should also be possible.

try the attached shader, its a shader with two techniques runnig on PS 1.4 cards.
the tex input is masked by the brightness of the mask input. you have low and high threshold (0…1) for selecting the masking range. technique LumaBlack shows black and technique LumaMask shows the mask image in the areas where the brightness of the mask image is in the range defined by the thresholds.

LumaKey.fx (3.5 kB)

mhh ive got a geforce 4200 go in my 2 year ol dell inspiron 8500 and unfortunately no pixelshader works on this machine :(

you have two options:

*play around with Blend (Advanced) kalle? didn’t you have a patch for that in your legendary videofx compilation?

*even without a shader-compatible grafikkard you can achieve many of the multitexturing effects using the fixed function pipline in an effect code.

you may already have noticed that in some effects that ship with vvvv there are several techniques. one usually named TFixedFunction. this technique is supposed to run on every hardware. looking at the implementation of such a technique you’ll see that it looks different than the others. it uses the directx fixed function pipline commands. it maybe a bit tricky but what you want to do should be possible and much more.

see the effect states for a list of possible states you can set for an effect. you’ll see that you can achieve effects like bumpmapping, multiple-lighting, …even without shader-capable hardware.

we didn’t see a need for stencilbuffer support in vvvv yet since most problems can be dealt with in an other way.