VGUI2 already supports rendering transparent textures, just override the
paint() function of the panel and don't draw where you don't want pixels
(your source TGA art for the textures needs to have an alpha channel to
make use of this functionality).

- Alfred

William Ravaine wrote:
> Hey,
>
> Im trying to perform masking with VGUI surfaces. My goal is to take a
> base
> texture and apply a binary mask texture to it (white = transparent,
> black =
> solid) so that I can give my rectangular texture rounded edges or any
> other
> kind of shape I want.
>
> This is usually done by rendering the mask texture on the destination
> surface, and then rendering the base texture on top using a special
> blend
> function that will only retain the parts of the base texture where
> the color
> of the mask texture underneath is black.
>
> Now I've been searching a bit in the HL2 SDK code, and the only
> potential
> tool I've found is RenderTarget and procedural textures. However,
> there
> doesnt seem to be any way of modifying the blend function from the
> material
> system, since I guess the blending formulas are defined in the
> material
> shaders themselves.
>
> So i'm wondering if there's an obvious, easy way of doing masking
> that I
> would have missed, or if I'm going ot have to resort to writting a
> shader
> for this?
>
> Any help appreciated!
> Spk
>
>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list
> archives, please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to