Urban Terror Forums: Transparent Textures - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Transparent Textures Rate Topic: -----

#1 User is offline   Blake Icon

  • Account: blake
  • Country:
  • Joined: 15-May 10
  • Posts: 50

Posted 21 February 2013 - 02:21 PM

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?

#2 User is offline   TyberiusPrime Icon

Posted 21 February 2013 - 04:44 PM

Define "added in the black".
[img]http://img32.imagesh...69/marleen3.png[/img]
utHD_LilliMarleen

#3 User is offline   banksy Icon

  • Account: banksy
  • Main tag: CMM|
  • Country:
  • Joined: 28-January 12
  • Posts: 373

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 User is offline   Blake Icon

  • Account: blake
  • Country:
  • Joined: 15-May 10
  • Posts: 50

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.


bullet_loaderAdvertisement

#6 User is offline   Blake Icon

  • Account: blake
  • Country:
  • Joined: 15-May 10
  • Posts: 50

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.

#7 User is offline   TyberiusPrime Icon

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.
[img]http://img32.imagesh...69/marleen3.png[/img]
utHD_LilliMarleen

#8 User is offline   Blake Icon

  • Account: blake
  • Country:
  • Joined: 15-May 10
  • Posts: 50

Posted 22 February 2013 - 09:30 AM

http://irrlichtirc.g...ansparency.html

#9 User is offline   TyberiusPrime Icon

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?
[img]http://img32.imagesh...69/marleen3.png[/img]
utHD_LilliMarleen


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Advertisement


Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942