Transparent Textures ( what format to use? and how to save it out )

Started by
5 comments, last by riuthamus 11 years, 2 months ago

So, we are trying to get the grass working again and in doing so have run into some issues.

RuinValor%202013-02-23%2005-52-15-38.png

This is done with a PNG file exported and no alpha associated with it at all. I know that is an issue so we have tried to use several different options and none of them seem to work. I have saved this out to be a TGA with an alpha channel and I have saved it as a DXT5, but none of them are working.

We are attempting to load the alpha's via premultiplied rednering. Is this the proper technique? Should we be doing something else? Is there a setup we need to use so our alpha's can load with these texture formats?

Furthermore, we read that premultiplied works with DXT4 and DXT2 but the photoshop plugin that lets me make DDS files does not have an option to export as DXT4 or DXT2, only 1, 3, or 5. Thanks for your help with this as this is a very annoying problem.

Note: I have tried to save this out using superPNG but when I do it removes the background and doesnt keep the alpha layer, even though i told it to do so....

Advertisement

DXT2 and DXT4 are identical formats (except for the header) to their DXT1/5 counterparts, so save them out as DXT1/5. You need to set the alpha blend mode on the GPU to use premultiplied alpha though (on all platforms I have worked on, which doesn't include PC).

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

I dont see that option in photoshop when saving out as a DDS. Is there a preset I need to load into it? or some options I need to modify?

[media]

[/media]

It's an option when setting up the renderstate before using shaders, it's not an option for the file. Like I said, the file format is identical apart from the header.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

Telanor, our shader guy, says that I am explaining it wrong. I have dispatched him to this post to express it further. I have done some searching and everything I find suggests that the issue should be the shader since photoshop already exports in the alpha mode suggested.

http://forum.unity3d.com/threads/18604-Alpha-Straight-vs-Premultiplied

but.... Telanor insists that I do not understand! So, I will have him explain this better. Thanks Para

Shaders just set the alpha of a pixel, they don't read the existing colour value. So it is the renderstate that needs to set the alpha blend operation before the shader is run.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

Ah, thanks!

This topic is closed to new replies.

Advertisement