Gimp Alpha inversion?

Gimp Alpha inversion?

Share and discuss visual creations and creation practices like texturing, modelling and musing on the meaning of life.

Moderators: MR.D, Moderators

Post Reply
zalpha
Posts: 23
Joined: 19 Mar 2013, 18:39

Gimp Alpha inversion?

Post 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? :?:
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Gimp Alpha inversion?

Post 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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Gimp Alpha inversion?

Post 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.
zalpha
Posts: 23
Joined: 19 Mar 2013, 18:39

Re: Gimp Alpha inversion?

Post by zalpha »

Here are the gimp files, DDS, OBJ, and S3O.
Attachments
forhelp.zip
(1.43 MiB) Downloaded 31 times
zalpha
Posts: 23
Joined: 19 Mar 2013, 18:39

Re: Gimp Alpha inversion?

Post 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
zalpha
Posts: 23
Joined: 19 Mar 2013, 18:39

Re: Gimp Alpha inversion?

Post 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)
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Gimp Alpha inversion?

Post 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.
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Gimp Alpha inversion?

Post by SpliFF »

UPDATE: I've added details regarding this issue and Assimp textures in general to the wiki
Post Reply

Return to “Art & Modelling”