Author Topic: Partially transparent presets  (Read 2059 times)

Offline littlepinksprite

  • Dedicated Supporter
  • ***
  • Posts: 301
  • Country: 00
  • Floof-O-Meter: 5
    • View Profile
Partially transparent presets
« on: December 04, 2011, 12:24:37 am »
This is only vaguely related to my other post on transparency help (thanks xRubyx.) I was able to successfully show the transparency on my preset. I realized however that it was total transparency that I had the code for though. Does any one else have the code for a partial transparency script, resulting in a ghost-like animal? I searched over the tutorials section of the forums, and there doesn't seem to be any help on specifically partial transparency. The code I did use for total transparency I found here: http://happyshadow.deviantart.com/art/Feral-Heart-Preset-Script-Tuto-199736102 , and put the line "alpha_rejection greater_equal 128" in my code. I assumed by using varying degrees of transparency in gimp, and by changing the number at the end of the code it would pick up the different frequencies, and appear partially transparent, but it did not come out how I thought it would.

Offline GaaraRocks!

  • Experienced Traveler
  • **
  • Posts: 244
  • Country: 00
  • Floof-O-Meter: 26
    • View Profile
Re: Partially transparent presets
« Reply #1 on: December 04, 2011, 09:56:45 am »
im not actually sure if you can make them partially transparent. Only Transparent. I use photoshop but what i did is changed my coding in the material file.

material preset_1_headMatR
{
 receive_shadows on
 technique
 {
  pass
  {
   ambient 1.000000 1.000000 1.000000 1.000000
              diffuse 1.000000 1.000000 1.000000 1.000000
              specular 0.050000 0.050000 0.050000 1.000000 12.500000
          emissive 0.000000 0.000000 0.000000 1.000000
   cull_hardware none
               cull_software none
               scene_blend alpha_blend
      alpha_rejection greater_equal  237
               texture_unit
         {
             texture USERNAME_CHARACTERNAME.png
                tex_address_mode Transparacy
                      filtering trilinear

                      }
      }
   }
}


i added the tex_address_mode Transparacy under the texture. That worked for me. However your image must be transparacy itself. In photoshop i used the eraser to rub out parts of the body i wanted Transparent. It made that area look grey and white squares but thats how you know that its transparacy. When you load it up ingame it should look seethrough.

Offline Ruby1234

  • Mean Tutorial Queen
  • Elder Grey Pelt
  • ****
  • Posts: 2,794
  • Country: us
  • Floof-O-Meter: 297
  • aka Phloxenfree.
    • View Profile
Re: Partially transparent presets
« Reply #2 on: December 04, 2011, 02:40:29 pm »
Gaara's code should work, you can just change the opacity and different brushes to customize the look.
But if you already have stuff made and all that, you can use this code to make anything partially transparent, without having to change the image:
Code: [Select]
material preset_(PresetNumberHere)_(BodyPartHere)Mat(Left(L)OrRight(R)Here)
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture (TextureNameAndFormatHere)
}
}
}
}

Offline littlepinksprite

  • Dedicated Supporter
  • ***
  • Posts: 301
  • Country: 00
  • Floof-O-Meter: 5
    • View Profile
Re: Partially transparent presets
« Reply #3 on: December 05, 2011, 09:18:05 pm »
I tried both codes even with the opacity difference in gimp and neither worked for me.