How do i make the game recognize an alpha channel? -1 reply

  • 1
  • 2

Please wait...

Arc Nine

GF Pwns Me!

50 XP

3rd August 2009

0 Uploads

58 Posts

0 Threads

#1 9 years ago

Title is pretty self-explanatory.




AshuraDX

WTF ?! BOOOOOOOM !

50 XP

10th May 2009

0 Uploads

1,462 Posts

0 Threads

#2 9 years ago

you need a shader file : "texturepath" { { map "texturepath" blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA }

replace "texturepath" with the file path of your image ,models/weapons2/gun/texture as example




Arc Nine

GF Pwns Me!

50 XP

3rd August 2009

0 Uploads

58 Posts

0 Threads

#3 9 years ago

Thanks a bunch m8! I'll rep you.




Arc Nine

GF Pwns Me!

50 XP

3rd August 2009

0 Uploads

58 Posts

0 Threads

#4 9 years ago

Okay, new problem: 90822847.jpg help?




kidoncrack

Bean pot pie

50 XP

25th March 2008

0 Uploads

181 Posts

0 Threads

#5 9 years ago
Arc Nine;4966440Okay, new problem: 90822847.jpg help?

The shader you made is borked. If you copypasted Ashura's shader, add a '}' at the end.




AshuraDX

WTF ?! BOOOOOOOM !

50 XP

10th May 2009

0 Uploads

1,462 Posts

0 Threads

#6 9 years ago

oh ! sorry I forgot to put this } at the end sorry :lookaround:




Arc Nine

GF Pwns Me!

50 XP

3rd August 2009

0 Uploads

58 Posts

0 Threads

#7 9 years ago

thanks m8ey! Problem solved!




Raziel2121

Ninjas Are Cooler

50 XP

3rd September 2008

0 Uploads

155 Posts

0 Threads

#8 9 years ago

ill explain it a bit further for you

models/players/dante/head { cull disable { map models/players/dante/head alphaFunc GE128 depthWrite rgbGen lightingDiffuse } }

this would be an alpha shader one for my dante skin now if you replace where it says dante and head with your model name and Texture name it should work fine so would be like this

models/players/Modelname/Texturename { cull disable { map models/players/ModelName/Texturename alphaFunc GE128 depthWrite rgbGen lightingDiffuse } }

to add more textures to the list you would set it up like this

models/players/dante/head { cull disable { map models/players/dante/head alphaFunc GE128 depthWrite rgbGen lightingDiffuse } }

models/players/dante/head { cull disable { map models/players/dante/head alphaFunc GE128 depthWrite rgbGen lightingDiffuse } }

note the spaces hope this helps




Arc Nine

GF Pwns Me!

50 XP

3rd August 2009

0 Uploads

58 Posts

0 Threads

#9 9 years ago

i'm perfectly fine and i got the alpha channel workin. thanks guys.




Pande

Sexeh like teh gizmo

50 XP

9th April 2008

0 Uploads

610 Posts

0 Threads

#10 9 years ago

Raziel you may have watned to explain that AlphaFunc GE128 is a VERY strict alpha test. It will scan the image, and any pixels that are absolutely solid color will stay and any that have even an ounce of alpha to them will be removed. Although, there may be a flip point, such as 50% or something, I'm not sure. i.e. a pixel with over 50% solid color stays but under is removed.

I would go with blendfunc SRC_ALPHA GL_ZERO always, which is Source = alpha multiplied by Zero, or Alpha of a pixel multiplied by zero. Which in easy terms means, alpha is made transparent. :)




  • 1
  • 2