Page 1 of 1

Gimp Alpha inversion?

Posted: 20 Mar 2013, 01:26
by zalpha
Okay, so I've been poking at this thing for a while, and I really need some advice.

I have a Blender model, brought in through Lightwave format into Upspring, the UV created in GIMP, but I keep running into the same issue.

It seems that the way GIMP handles alpha and the way Upspring/Spring RTS handles alpha are completely reversed. In GIMP, texture is white and transparency is black, but it is reversed in Springverse.

I've been beating my head in to reverse the alpha so it will work in Springverse somehow. It worked on my simpler model that was close to 1 bit, but with varying degrees of transparency, I've been having no love. I tried exporting to BMP and having Upspring create DDS, but have had no luck with Upspring reading the bmps properly. I've tried reversing the alpha channel in GIMP, no easy feat, but no go there, either.

So, how do you do it? :?:

Re: Gimp Alpha inversion?

Posted: 20 Mar 2013, 01:33
by smoth
lol woops misread the post correct answer.

NOPE.

the alpha is used to do a mask for the team color overlay. So where the alpha is solid, teamcolor, where the alpha is clear, no team color.

Dunno, post the model and image files, I'll try and take a look.


Also I leave my original post just in case..
if your texture looks flipped on the model
Spring is silly and assumes DDS rotation, that is the uvs are flipped vertically. If you are not using a dds.

Click texture mapping(will be on the top by object, edit etc.)

choose show uvmapping.

in this window click edit.

choose flip UVS

that should have you rocking and rolling.

Re: Gimp Alpha inversion?

Posted: 20 Mar 2013, 03:11
by knorke
I've tried reversing the alpha channel in GIMP, no easy feat, but no go there, either.
Layer -> Mask -> Add Layer Mask
(check the Invert Mask option!)
Image
I only found this out by clicking around, not tried it for texturing yet.

Without Gimp, simplest way to invert alpha channel is the free tool DXTBmp: in menu click Alpha -> Invert Alpha.
the alpha is used to do a mask for the team color overlay. So where the alpha is solid, teamcolor, where the alpha is clear, no team color.
Not sure what you mean but alpha is not just a solid/clear mask, it can be anything in between.

Re: Gimp Alpha inversion?

Posted: 20 Mar 2013, 03:13
by zalpha
Here are the gimp files, DDS, OBJ, and S3O.

Re: Gimp Alpha inversion?

Posted: 20 Mar 2013, 03:17
by zalpha
knorke wrote:
I've tried reversing the alpha channel in GIMP, no easy feat, but no go there, either.
Layer -> Mask -> Add Layer Mask
(check the Invert Mask option!)
I only found this out by clicking around, not tried it for texturing yet.

Without Gimp, simplest way to invert alpha channel is the free tool
Thanks! That did most of the trick... however, areas that should be all team color come out as flat black.

This is basically what it is supposed to look like, with white where the team color should be.

http://p3d.in/RMyu4

Or, with a yellow team color:
crystaldestroyerskinned.png
(387.25 KiB) Downloaded 1 time

Re: Gimp Alpha inversion?

Posted: 20 Mar 2013, 05:16
by zalpha
knorke wrote:Without Gimp, simplest way to invert alpha channel is the free tool DXTBmp: in menu click Alpha -> Invert Alpha
Excellent tool... only issue I am having is that after the transparency is inverted, it shifts about fifty pixels to the left for no apparent reason.

EDIT: Poke poke prod slam. Got it. When editing the alpha, had to set gimp to not write colorspace info. The transparency stopped shifting and model looks good. Thank you! 8)

Re: Gimp Alpha inversion?

Posted: 20 Mar 2013, 07:22
by CarRepairer
I decided instead of inverting alpha, I'll bend spring to my will and have it behave differently. You can modify the shader file spring uses, and/or use jK's shader gadget to tell spring how you want it to render your models. I chose to put teamcolor in texture2, and have it be transparent = teamcolor and opaque = no teamcolor. But you can do anything you wish. You could choose to leave teamcolor in tex1 and invert it in spring.

Alternatively, blender is so powerful that you can even modify the material so it renders your models the way spring does. Create a material and tell it not to use alpha from tex1. Then add tex1 as a new texture in the material, invert the alpha and tell it to mix that with some color. You can make it behave like texture2 in spring as well. I plan to enhance the blender tutorial to describe this better.

Re: Gimp Alpha inversion?

Posted: 20 Mar 2013, 11:28
by SpliFF
UPDATE: I've added details regarding this issue and Assimp textures in general to the wiki