rosch@Posted: Wed May 09, 2007 1:26 pm :
Hello,
I've got the following problem:

I made a model in 3dsmax and exported it as ase-file for importing it into doom3. Everything works fine so far. I've got a diffuse-map and a normal-map. Both work correctly in the engine. But the diffusemap contains an aplha channel, which i want to use. It's saved as 32 bit tga file.

So how can I get the alpha channel beeing used in the engine? I've tried different sollutions for the .mtr file but I don't get it to work correctly.

Most examples here on the board are for decal or map textures. So is there anything different with model textures?



Lumpengnom@Posted: Wed May 09, 2007 1:34 pm :
you can do this with alphatest. Note that alphatest won´t let you work with degrees of transparency. Either it´s totally transparent or totally opaque. I don´t know how to use degrees of transparency. I´d be interested in this, too.



OC_Klonsemann@Posted: Wed May 09, 2007 2:40 pm :
For what du you wanna use half alpha blend ?

Smokepuff oder glassdirt is always done with w/b alpha to crop image in what is visible and the diffuse is done per blend overlay.

For get alphachannel working use alphaTest as this.
Code:
models/your_shader{
   
   diffusemap models/your_diff_with_alpha.tga
   
   {
      blend diffusemap
      map models/your_diff_with_alpha.tga
      alphaTest 0.5
   }
   
   bumpmap   addnormals(models/your_local.tga, heightmap(models/your_h.tga, 2 ) )
   specularmap   models/your_s.tga
}



rosch@Posted: Wed May 09, 2007 4:56 pm :
YEAH! Thankyou! You're my hero of the day.
Well the first test looks like this now:

Image

of course it's far from being finished :)

I expect that I can't get shadows through this thing, eh? Think I read something like this on the sdk site.



OC_Klonsemann@Posted: Wed May 09, 2007 5:18 pm :
Yes thats right, only polygons can cause shadows in Doom3 not alphachannels.



OC_Klonsemann@Posted: Wed May 09, 2007 6:32 pm :
What you could do is to create another TGA with black color and the alphachanel you painted. Then blur the alpha with a big ammount and use this for a lighttexture, projected by a well placed light near the railing. :wink:



rosch@Posted: Wed May 09, 2007 11:20 pm :
Yeah. I will try this out. Thanks for the hint.



irishlostboy1980@Posted: Thu May 10, 2007 1:10 am :
another option for you is this.
detach the planes that have the alpha mapped texture, and export those planes as a seperate model. then import the two models into the editor seperately. this will allow the "solid" bits of the bannister to render as normal, with potential for normal maps and all that jazz. i always had problems with opacity and normal maps.
it might be best just to model in the swirly bits as a 3d model. it could be done without using too many polys, and it would cast corect shadows then.
anyway, just thought i would throw my two pence worth out there :oops:



rosch@Posted: Thu May 10, 2007 12:15 pm :
Well, maybe I'll try this out to, becuase I'm not really satisfied with the result now. But the result got a little bit better after some work on the outlines of the tga's outline.



irishlostboy1980@Posted: Thu May 10, 2007 7:19 pm :
my money is on just to model the whole thing solidly in 3d. it will be less of a compramise. also experiment with exporting models in bits. this can be quite handy for some stuff.