Transparent textures in Blender

General debates and discussion about the Guild of Writers and Age creation

Postby Robert The Rebuilder » Wed Sep 13, 2006 11:45 am

I want to make an object semi-transparent. I produced a texture, useAlpha_crystal.tiff, that has an alpha channel with 50% alpha throughout. I UV mapped an object, gave it a material, and exported my age. In the output of the export, I can see that it denoted the texture as using alpha. However, when I'm in my age, the object is completely opaque (i.e. not semitransparent).

What should I do to get this to work? Note: the texture is gray scale, so it only has two channels: grayscale and alpha.
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Postby Branan » Wed Sep 13, 2006 11:56 am

Tiff? the Tagged Image File Format?

'tis evil. Get rid of it. :P

Try using a full RGBA TGA file. If you want it to be grayscale, just set RGB to the same vallue, and use the Alpha channel as normal. Wierd file formats tend to muck with graphics, especially once you throw in Alpha channels. If you're having issues with that sort of thing, always go to the simplest level. In this case, a TGA, which is the simplest format out there for images.
Image
Your friendly neighborhood shard admin
User avatar
Branan
Gehn Shard Admin
 
Posts: 694
Joined: Fri Nov 16, 2007 9:45 pm
Location: Portland, OR

Postby Robert The Rebuilder » Wed Sep 13, 2006 12:26 pm

Thanks for the suggestion, Paladin. I made a TGA file with 4 channels, brought it into the plugin, exported it, tried it out in Uru, and it is still opaque.

The log prints out "Setting transparency for useAlpha_crystal.tga". So, the plugin's plLayer.write() method is definitely attempting to configure itself properly.

Any other ideas? Does someone out there have an age that succesfully uses a texture containing an alpha channel?
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Postby Branan » Wed Sep 13, 2006 12:54 pm

It might only allow for two options - transparent or not. I know that in a lot of games, to save calculation time, it's possible to tell the engine that any alpha value above X is fully opaque, and any value below X is fully transparent. Saves a lot on Blending calculations. Try creating a new image that blends the alpha from 0 on one side to FF on the other, and see if that does anything. If it suddenly cuts off at one point, then we know that's what's happening.

Also, have you made sure you have the latest plugin version? daily snapshots are still being made, I believe, so try updating.
Image
Your friendly neighborhood shard admin
User avatar
Branan
Gehn Shard Admin
 
Posts: 694
Joined: Fri Nov 16, 2007 9:45 pm
Location: Portland, OR

Postby Robert The Rebuilder » Wed Sep 13, 2006 1:37 pm

Again, thanks for the help, Paladin. I'm actually using the version from the SVN trunk, which is identical to latest.zip. Although the plugin has some code for checking the individual pixel's alpha values, this is only activated when texture compression is on. And all that does is decide whether to use DXT1 vs DXT5. The relevant code is the one inside plLayer.write() that checks for the 'useAlpha' prefix on the texture file name.

When using PRPExplorer to look at my DrawableSpans, I noticed that it only has one spans instead of separate ones for regular (*Spans) and blended (*BlendSpans). Did the pre-refactored plugin properly do this?
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Postby Branan » Wed Sep 13, 2006 1:52 pm

No idea. You'll have to ask Paradox or Trylon about that... I don't know if anyone besides those two knows how that script actually works.

I'm gonna try to learn, though, mostly because there's a few things I'd like to see done to it, and I'd feel bad if I kept asking others to do it for me. If I figure out what's up before someone else does, I'll certainly tell you :)
Image
Your friendly neighborhood shard admin
User avatar
Branan
Gehn Shard Admin
 
Posts: 694
Joined: Fri Nov 16, 2007 9:45 pm
Location: Portland, OR

Postby Paradox » Wed Sep 13, 2006 4:09 pm

Robert,

I happen to agree with Paladin, TIFF is evil; Use PNG :P

Anyways, open the PRP file with PRPExplorer and look at the texture. Some crazy things can happen between imports and exports.

The texture type should be DXT-5 (IIRC, I might be wrong, but it should definately be a DXT-? type).

If nothing else works, convert your texture to a DDS file and import it into PRPExplorer yourself. (But use IngisKahn's release, since mine might cause havoc with the sizes :ph34r: )
Paradox
 
Posts: 1290
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Postby Aloys » Wed Sep 13, 2006 4:32 pm

I haven't tried any alpha transparency in a while, but before that I had no problems. I remember however I used PNG files rather than TGAs for some reason.. Not sure why but I seem to remember I ran into issues with TGAs and the plugin. But that was a while ago when Trylon first made the transparency addition to the plugin, so things might have changed since.

But I just got the lastest version of the plugin and I got an even weirder problem: my textures aren't exported at all. :blink: I don't get any error message, the export goes fine, but my textures aren't exported at all.. Maybe there's something afoot with that latest version... (or even some versions before that, I hadn't upgraded in several weeks)

[edit]
BTW I used my regular test Age, it hasn't changed in a while and I had exported it successfully on previous versions of the plugin. So if something's wrong it doesn't come from this Age at least.
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Postby zib_redlektab » Wed Sep 13, 2006 5:09 pm

I agree, use png. I succesfully mapped all of the cave paintings in galamay with alpha mapped pngs. Not sure what your problem could be...
Lurker extraordinaire!
http://www.zibland.com
User avatar
zib_redlektab
 
Posts: 240
Joined: Sat Sep 29, 2007 6:24 am
Location: Avoiding Direct Sunlight

Postby Mystified Explorer » Wed Sep 13, 2006 9:47 pm

I Third that. I used .png for some transparent glass textures and it worked out fine :)
Mystified Explorer
 
Posts: 170
Joined: Fri Oct 05, 2007 2:49 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 48 guests