Jump to content
Sign in to follow this  
docbrown

hiddenselection & alpha channel

Recommended Posts

I am trying to make a little name tag at the moment that has a base shape, and then a series of flat faces that are placed just in front of the base shape.

Each flat face is a letter position at 9mm x 9mm in blender's scale, and each face is designated a hidden selection. The plan is to place letters on each face by script or init to spell out someone's name rather than having to do a separate texture for everyone's name in the group.

I have created separate letter textures in Photoshop with an alpha channel and saved as .png, then used Texview2 to convert to .paa. However, this is the result when the texture is applied to those forwarded faces. The alpha channel is ignored.

V7URVGq.png

The strange thing is, when those same letters are applied to a larger area, the alpha channel is applied. Here's an example of those same letters being applied to one of BI's signs.

http://i.imgur.com/NhJ2Xs6.png (693 kB)

So i tried a different method of creating the alpha channel texture, by saving them as *_ca.tga instead, and and then converting to *_ca.paa but still getting the same results. In the example below, the new textures are shown as a black square.

rEXc1t2.png

Would appreciate any help to get the alpha channel applied on the letter textures.

Thanks.

Edited by docbrown

Share this post


Link to post
Share on other sites

My first though: Youre saving as PNG ? .... dont think thats normal. Tried using 32bit TGA?

Share this post


Link to post
Share on other sites

Yeah, i did try *_ca.tga 32bit. Results shown in the second screenshot as black squares instead of letters.

Share this post


Link to post
Share on other sites

Do you have lodNoShadow = 1 set in the model's Named Properties window too? You might be experiencing problems with the game trying to generate a shadowLOD from a non-closed geometry on these faces.

Other things you might want to try if the above isn't the issue:

Try applying this .rvmat to the faces you want the alpha texture to appear on:

a3\misc_f\helpers\usertexture.rvmat

It's the .rvmat used on the 1m and 10m square user texture panels - at one time these objects also experienced the same black background problem with Alpha textures applied, but BIS fixed it.

If that doesn't work try some of the different Lighting & shadows settings that are in the lower lext corner of the Face Properties window (the one you are using to apply the texture and .rvmat to the model). Try things like unchecking the Enable Shadows box (have to click it twice to uncheck it fully).

Share this post


Link to post
Share on other sites

I tried all of da12thMonkey's suggestions one by one then all at the same time, even set some faces to "Reversed (transparent)" in the Lighting & Shadows area of face properties, just to see what would happen, and still got the same results. Thinking it might be a size issue, I scaled the model up to around 20m on the x axis and the letters still got a black texture.

Do you need any other lods for alpha channel to work? At the moment, its only the one lod at 1.000.

Share this post


Link to post
Share on other sites

Hey DocBrown,

what about trying to apply them as detail textures over the top of another standard texture? if you give each small face a plain texture and then try adding the letters over the top only as detail? I'm not sure if you could still easily control that via script, but it might be worth a try? If you are scaling it up and it still isn't working then I would suggest you can rule out the cause being size related.

D

Share this post


Link to post
Share on other sites

Thanks daringd, i'm open to any suggestions at the moment, but i'm not entirely sure what you mean. Each letter position currently has a texture assigned in the p3d which is a scaled and cropped version of the area it sits on top of. How would you add the letters over the top as detail? If you could point out some examples where this happens in-game, i'd like to take a look.

I've uploaded the source files here with what i have so far, hopefully someone could take a look and let me know where i'm going wrong.

Edited by docbrown

Share this post


Link to post
Share on other sites

Figured it out, finally. The faces that were intended to display letters required a base texture that contained an alpha channel in the p3d. Originally, the base texture for each of these selections were *_co.paa's. I set their texture with a letter which already had an alpha, and now each hidden selection can be defined with setObjectTexture, with alpha channel intact.

http://i.imgur.com/3yb0lKE.png (2267 kB)

Thanks to those who chimed in, appreciate it.

Share this post


Link to post
Share on other sites

Interesting "bug" .

Thanks for letting us know the trap.

I know with all my "aircraft markings", big and small, I've always predefined (in the p3d) with one example of the same (alpha) texture, to be flipped to another at run-time. Only luck then that I haven't tripped over this issue.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×