Feral Heart

Help & Guidance => Game Help => Topic started by: -WhereSunRises- on March 29, 2016, 05:58:22 am

Title: Help with transparency needed
Post by: -WhereSunRises- on March 29, 2016, 05:58:22 am
Hi, I found out that I don't know how to make mesh looking like a glass or at least semi- transparent. I need to make a  glass mesh but If I make texture it always ends up white :/ Anyone could help me with coding for a semi- transparent mesh please?
Title: Re: Help with transparency needed
Post by: ola232 on March 29, 2016, 09:22:15 am
Hi, if you want to make something semi transparent or glass like here is ghost coding (http://www.feral-heart.com/index.php?option=com_jfusion&Itemid=2&jfile=index.php&topic=26062.msg341652#msg341652) for that
Title: Re: Help with transparency needed
Post by: -WhereSunRises- on March 29, 2016, 03:48:19 pm
Thanks but this is for presets  :/ And I need mesh.... Thanks anyway :) You are very kind.
Title: Re: Help with transparency needed
Post by: D-ead7Dog on March 29, 2016, 03:50:40 pm
If you need the transparent code for a preset here it is!
http://www.feral-heart.com/index.php?option=com_jfusion&Itemid=2&jfile=index.php&topic=12075.0 (http://www.feral-heart.com/index.php?option=com_jfusion&Itemid=2&jfile=index.php&topic=12075.0)

Please be more specific in your title such as "Transparent Code Preset/Mesh Help" or something along that line so it's easier to figure out what it is exactly that you need just by looking at the title and we can get it solved quicker! ;)

Have a great day!
Title: Re: Help with transparency needed
Post by: Ruby1234 on March 29, 2016, 04:49:44 pm
Thanks but this is for presets  :/ And I need mesh.... Thanks anyway :) You are very kind.

Coding works regardless of what it's for.
However, this is how I, personally, make the appearance of glass ingame.
Just looks the best to me, but there's some other ways too.

Take a medium blue and make it semi-transparent in GIMP.
Just a 512x512 square or whatever, could even be smaller. Any size.

(https://i.gyazo.com/a1d2413b2d439e202971c33a3f58471f.png)

I use opacity of 50:
(https://i.gyazo.com/00b6a75a528938589c3e7f395517e161.png)

Save that as glassTex.png

Open notepad, paste this in:
Code: [Select]
material GlassMat
{
technique
{
pass
{
cull_hardware none
cull_software none
depth_write off
scene_blend add
texture_unit
{
texture glassTex.png
}
}
}
}

Go to Save As... and then select All Files from the dropdown:
(https://i.gyazo.com/2131396eae23a2c00a64587a4a6eaea9.png)

And save it as Glass.material in the line above that.

Take all that crap and toss it into:
(https://i.gyazo.com/ea08fcd9b1e7bac74643ed44de65c202.png)
(the place where your FH folder is might be different but you get the idea)

Then I go ingame to Object Maker, and load up my mesh I want to use. For giggles I just used BasicCube.mesh, which comes with the game. Then change the material to GlassMat which we just made.

(https://i.gyazo.com/c5d389f421b9e2673fda9f393829017f.png)

Boom.
Done.

Annnnnd, as a bonus, here's more realistic glass.

Bump opacity down to 15.
(https://i.gyazo.com/60d540a2b9b1a3562bdfbbd592d17720.png)

Change code to:
Code: [Select]
material GlassMat
{
technique
{
pass
{
cull_hardware none
cull_software none
depth_write off
scene_blend alpha_blend
texture_unit
{
texture glassTex.png
}
}
}
}

Result:
(https://i.gyazo.com/89b40bcf55de15503bc18b4a2b4f74fc.png)
Title: Re: Help with transparency needed
Post by: -WhereSunRises- on March 29, 2016, 06:25:05 pm
Oh my! Thanks a ton! Surely gonna do it myself now that I know how to do it :D I just can't thank you enough :D
Title: Re: Help with transparency needed
Post by: Warriorstrike on March 29, 2016, 06:30:07 pm
I'll lock this up since you seem to have found what you were looking for. Good luck with your preset!