Frictional Games Forum (read-only)
How to go about using alphas? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: How to go about using alphas? (/thread-20814.html)



How to go about using alphas? - JonnyAnomaly - 03-18-2013

Hi,

I'm making some trees in Maya at the moment but I'm stumped with how to use alphas for branches and things in the engine. I understand how to use alpha channels in Photoshop and use them on planes in Maya to create the branches, but when I had finished I realised I was using two textures - One for the bark, and a targa for the branches. I loaded up the pine.dds from the actual game and saw that they used the alpha in the bark texture, but when I do that and save as a .dds, the alpha doesn't work in Maya and is just black.

Can anyone help clear this up for me please?


RE: How to go about using alphas? - xxxxxxxxxxxxxxxx - 03-18-2013

Well, what you wanna do is, first you put both your branch texture and your bark texture in one square texture. (You might have to scale them or crop them a bit to make it fit) Then you adjust the UV map of your model so that the branches are lying on the part with the branch and the barky parts on the bark-part. Now for the alpha, you make it so that the barky part of your texture is white on the alpha and your branches have the alpha they had before - a black rectangle with the white branch shape on it. That way your model is using one texture instead of two.

I don't think Maya can use the alpha channel of a .dds, and neither can hpl, so what you do is, you save the diffuse (= color texture) as dds and the alpha as a separate tga image instead of leaving it in the alpha channel. (You can select the whole canvas in the alpha channel and copy whats inside into a normal layer) You can then use it in Maya (transparency slot in the material) and in the material editor to create your opaque trunk and half-transparent branches. Smile


RE: How to go about using alphas? - JonnyAnomaly - 03-18-2013

(03-18-2013, 11:15 AM)Hirnwirbel Wrote: Well, what you wanna do is, first you put both your branch texture and your bark texture in one square texture. (You might have to scale them or crop them a bit to make it fit) Then you adjust the UV map of your model so that the branches are lying on the part with the branch and the barky parts on the bark-part. Now for the alpha, you make it so that the barky part of your texture is white on the alpha and your branches have the alpha they had before - a black rectangle with the white branch shape on it. That way your model is using one texture instead of two.

I don't think Maya can use the alpha channel of a .dds, and neither can hpl, so what you do is, you save the diffuse (= color texture) as dds and the alpha as a separate tga image instead of leaving it in the alpha channel. (You can select the whole canvas in the alpha channel and copy whats inside into a normal layer) You can then use it in Maya (transparency slot in the material) and in the material editor to create your opaque trunk and half-transparent branches. Smile

Great, thanks for the reply, I'll let you know how I get on!


RE: How to go about using alphas? - JonnyAnomaly - 03-18-2013

Got my tree made finally, couple of shots of it in game

http://postimage.org/image/tkz463lj9/
http://postimage.org/image/hzgupwy07/full/
http://postimage.org/image/qg5pijbkv/


The alpha branches turned out a bit blocky so I'll clean them up at some point, now for some ground foliage Smile Thanks again for the help!


RE: How to go about using alphas? - WALP - 03-18-2013

(03-18-2013, 05:32 PM)JonnyAnomaly Wrote: Got my tree made finally, couple of shots of it in game

http://postimage.org/image/tkz463lj9/
http://postimage.org/image/hzgupwy07/full/
http://postimage.org/image/qg5pijbkv/


The alpha branches turned out a bit blocky so I'll clean them up at some point, now for some ground foliage Smile Thanks again for the help!
Awesome trees you got there!