EDIT January 31st, 2022: This tutorial is being updated and moved to Google! Please refer to the new version wherever possible, as it has better optimisation & overall clarity.
https://docs.google.com/document/d/1otpZc7OyhgXwbK8KPFEl4ogVCACvSptYVBNI-uuFdac/edit?usp=sharing
Transparent
-Oh, the wonders of making body parts disappear!
Start with your preset/object.
(This is preset 2 for the purpose of this tutorial, but I repeat,
IT'S NOT MINE. Kay? Kay. c:)
Now, all you do is open your preset in Photoshop or GIMP, like you would any other time.
But this time, we need to make sure you have an alpha channel of transparency enabled. To do this, simply go to Layers >> Transparency >> Add Alpha Channel, like so for GIMP;
Fullsize ImageIf the option is not available, it usually means you already have it enabled, so you should be all good!
Now just erase the part(s) you want to be gone. I'm going to erase the midsection.
Now, and this is important, save your image,
AS A .PNG. Why, you might ask? First of all, I always use .png just because .jpg doesn't always look as well on presets, but second, .jpg
DOES NOT support transparency. And look at that, we just used transparency! So guess what, we need a
.png. c:
Once you've saved as a .png, open your material code, which should look something like this as default;
material preset_#_bodyMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#body.jpg
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#head.jpg
}
}
}
}
material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.jpg
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
texture_unit
{
texture preset_#tail.jpg
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#mane.png
}
}
}
}
Now, you need to change whatever part is using transparency to .png instead of .jpg, but for me, all my stuff is in .png anyway, so I'm going to go ahead and switch it all.
material preset_#_bodyMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
texture_unit
{
texture preset_#head.png
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
texture_unit
{
texture preset_#head.png
}
}
}
}
material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.png
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
texture_unit
{
texture preset_#eye.png
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
texture_unit
{
texture preset_#tail.png
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#mane.png
}
}
}
}
Now, before we save and test, we should make sure that we have the actual transparency code in there, which is this simple line;
alpha_rejection greater_equal 128which gets placed above all the
texture_unit lines. Or at least all the ones you're using transparency on.
So, you can do that manually if you're only doing a few body parts, but if you're doing them all, then take it from me;
material preset_#_bodyMatL
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#head.png
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#head.png
}
}
}
}
material preset_#_eyeMatL
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#eye.png
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#eye.png
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#tail.png
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture preset_#mane.png
}
}
}
}
Now press Ctrl+H, or go to Edit->Replace...
And type _# in the "Find what:" section.
Then in the "Replace with:" section, put an underscore:
_
and then put your preset's actual number after that. Then click Replace all.
^ Only if you're using the code I just gave you, because I use # signs in it where your actual preset's number should be.
So since I'm using preset 2, this is what I'd be doing;
But you'd be using whatever number preset you're doing.
Now, make sure you
SAVE your material file, then go ahead and close it. Once we take a look ingame, you should have something like this! - Eep!
Have fun with it!
-
Semi-Transparent
-Similar to the
Ghost code, but not quite as glowy, and it actually
uses transparency, instead of giving the
feel of it.
Start with this guy again.
But this time, we're going to make him slightly see-through. To do this, we are going to open the textures, and change the opacity. It is completely up to you what you do with the opacity. But as said above, we are going to make sure we have an alpha channel for transparency, like so;
Fullsize ImageAnd then we are going to change the opacity. Like so;
Fullsize ImageNow we save as a
.png. Yes, it MUST BE a
.png, kay? Kay. c:
After we've saved all of that, (and by "all of that" I mean, go through and do it to all the parts you want to be see through. You can experiment with just using the eraser tool at a lower opacity to do this just for markings.) open your material file. Replace the current code with this one;
material preset_#_bodyMatL
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_bodyMatR
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_#body.png
}
}
}
}
material preset_#_headMatL
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_#head.png
}
}
}
}
material preset_#_headMatR
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_#head.png
}
}
}
}
material preset_#_eyeMatL
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_#eye.png
}
}
}
}
material preset_#_eyeMatR
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_#eye.png
}
}
}
}
material preset_#_tailMat
{
technique
{
pass
{
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_#tail.png
}
}
}
}
material preset_#_maneMat
{
technique
{
pass
{
cull_hardware none
cull_software none
depth_check on
depth_write off
scene_blend alpha_blend
texture_unit
{
texture preset_#mane.png
}
}
}
}
Then
Now press Ctrl+H, or go to Edit->Replace...
And type _# in the "Find what:" section.
Then in the "Replace with:" section, put an underscore:
_
and then put your preset's actual number after that. Then click Replace all.
So you should be doing something like this;
But you probably aren't using preset 2, so it'd be whatever number you're using.
Now,
SAVE your material file, then you may close it, or leave it open, whatever floats your boat, and lets go take a look in-game.
It's certainly.. different, right?
Haha, obviously this code works better for just markings, or objects, but hey, I believe you guys can make it work!
Good luck!