I'm trying to make a standard transparent texture where all the black in the image is removed, but I can't get this to work.
First thing to note is that my shader is NOT the problem. If I use the same shader on a texture from another map (I did it on some random plant from tohunga or something), it works exactly like it should. But when I use my texture, it doesn't. So, obviously, I'm making the image incorrectly somehow. In photoshop, I opened up the image, added in the black and saved as a .tga. Is there more to it than this?
Anyone know what I'm doing wrong?
Advertisement
Transparent Textures
#2
Posted 21 February 2013 - 04:44 PM
Define "added in the black".
[img]http://img32.imagesh...69/marleen3.png[/img]
utHD_LilliMarleen
utHD_LilliMarleen
#3
Posted 22 February 2013 - 12:03 AM
Don't add in the black. Keep the image transparent. I think radiant just adds in the black. But I'm not 100% because I'm shocking with shaders.
#4
Posted 22 February 2013 - 12:53 AM
The image had a white background, so I just used the paint bucket fill thingo and changed it to black. I also just now tried it with an image that already had a black background that I didn't have to make any changes to and it still didn't work, so I don't know what's going on here.
I tried it with a transparent background also and nothing changed. I'm pretty sure it's supposed to be black. That's what the tutorial thing I was following said anyway.
I tried it with a transparent background also and nothing changed. I'm pretty sure it's supposed to be black. That's what the tutorial thing I was following said anyway.
#5
Posted 22 February 2013 - 04:14 AM
You need to add a channel in the alpha channels (click on the channels tab in PS). Fill it with white and then go to the rgb channel and select the outside portion of your image (the area you want to be transparent) and fill this with black in the new alpha channel. Save this new image as a 32 bit tga instead of 24 bit.
Advertisement
#6
Posted 22 February 2013 - 05:43 AM
Well, it looks like the tutorial that I was following is completely wrong. It said that an alpha channel was only needed when using blendFunc, and not alphaFunc like I was using. But that isn't true it seems. Adding an alpha channel fixed the problem.
Thanks BladeKiller, much appreciated.
Thanks BladeKiller, much appreciated.
#7
Posted 22 February 2013 - 09:24 AM
Give me a link to that tutorial.
I think the tut is right you just mixed 2 things into one.
I think the tut is right you just mixed 2 things into one.
[img]http://img32.imagesh...69/marleen3.png[/img]
utHD_LilliMarleen
utHD_LilliMarleen
#9
Posted 22 February 2013 - 11:03 AM
What you tried to do is create an effect similar to "screen" or "lighten" blending modes in photoshop where lighter pixels remain visible while darker ones are transparent.
I'm using a reversed shader in my main project, meaning I'm removing all brighter pixels but leaving darker ones.
BlendFunc Filter, makes this possible, this is similar to "multiply" blend mode in photoshop and lightmaps are blended this way.
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA is a long way of writing BlendFunc blend.
Why hasn't it worked for you, not exactly sure. I know i messed around with some terrain decals with a similar shader and it worked fine for me.
But a surface has to be on top of the other. Meaning 2 faces have to exist in the same space.
That's why he's using polygonOffset, to avoid flickering.
Can you tell me what exactly were you trying to make?
I'm using a reversed shader in my main project, meaning I'm removing all brighter pixels but leaving darker ones.
BlendFunc Filter, makes this possible, this is similar to "multiply" blend mode in photoshop and lightmaps are blended this way.
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA is a long way of writing BlendFunc blend.
Why hasn't it worked for you, not exactly sure. I know i messed around with some terrain decals with a similar shader and it worked fine for me.
But a surface has to be on top of the other. Meaning 2 faces have to exist in the same space.
That's why he's using polygonOffset, to avoid flickering.
Can you tell me what exactly were you trying to make?
[img]http://img32.imagesh...69/marleen3.png[/img]
utHD_LilliMarleen
utHD_LilliMarleen
#10
Posted 22 February 2013 - 09:49 PM
I use blendFunc Filter for my decals which are on a white background and do not have an alpha channel. These are "burned" onto the surface they are in front of or projected onto. I use both projected decals for uneven surfaces and simple decals on a single plane (I use a model for this) 1 unit in front of a flat surface. I don't put the decal on the surface despite having polygonOffset in my shader because it quite often doesn't work properly.
1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users
Advertisement