voldemort@Posted: Wed Jun 07, 2006 4:51 am :
Tutorial Tip how to create a mask effect in doom 3

I stumbled on this little masking trick when after I had created a model of a ornate cross and textured it and then make a 2d picture of it
I saved it as a trasparent tga so only the cross would show up
I then had the bright Idea to try to make blood flow around and over it by simply adding the stages of flowing blood to my surprise the cross acted like a mask and the blood only appeared on the cross itself nowhere else

so I tested this masking technique as a true mask I made a ring shape and made it black and then the light black as well so that the texture was absolutly black but still had a trasparent background
then I added this mtr

Code:
textures/exhale2/mask_test3
{
   twosided
   noshadows
   noselfshadow
   DECAL_MACRO
   

   {
      forceHighQuality
      blend diffusemap
      map       textures/learning/tst3.tga
      alphatest 0.5
      
   }


   {
      blend         add
      map            textures/decals/blood_drip1
      translate      1,time*-0.1
      rgba 0.2
      
   }
   {
      blend         add
      map            textures/decals/blood_drip1a
      translate      1,time*-0.02
      rgba 0.2
   }
}



and it works I had blood flowing ounly in the ring the rest of the square texture has nothing in it

I then made a series of rivulets (vein structures) the same way and made them tileable and then added a translate parm so they scrolled and it worked I had rivulets of blood flowing in this manner quite nice effect now I the onlything to do is modify the blood so that the whit is hidden

still havnt quite worked that one out yet but its a nice start

anyone else know how to create masks like this Alternative methods would be apprecieated



voldemort@Posted: Wed Jun 21, 2006 3:03 pm :
just additional fun

lets say you want a jiggling or quivering mass of goo
create the base mask (yoiur blob with tentacles)

then add a shear or centerscale stage parm with a table
examples
shear flo1Table [ time * -0.05 ], 0.5

or
centerScale (.924 + fol1Table[time / 95]), (.924 + fol1Table[time / 95])

the numbers will vary in my case for the texture in question I needed a odd number like .924 to look right

the degree of alphatest determines how much of your mask will show up

examples 0.9 (very little) 0.0000001 ( the whole enchilada)



voldemort@Posted: Wed Jun 21, 2006 3:06 pm :
forgot to mention for stages that you want to ignore the alphatest stage its preaty simple i allready said how the stage parm

ignoreAlphaTest
and magic its ignored
works well with blend filter stages