Help With a Shader -1 reply

  • 1
  • 2

Please wait...

Thesolis

Thesolis

50 XP

19th July 2008

0 Uploads

64 Posts

0 Threads

#1 9 years ago

Hi.

I'm trying to make a shader that makes the texture below transparent in the black parts.

I've seen it done in Quake 3 and thought I would experiment, but my script attempts were not working.

Thanks.

images.jpg




cloudflint

Go raibh grásta Dé leat

50 XP

7th January 2008

0 Uploads

123 Posts

0 Threads

#2 9 years ago

I took this shader from imperial.shader, it should do what you need:

lets assume your texture is called "grate" and is in a folder called "mymap" which is in the textures folder

textures/mymap/grate { surfaceparm nonopaque surfaceparm trans q3map_material HollowMetal q3map_nolightmap q3map_onlyvertexlighting cull twosided { map textures/mymap/grate alphaFunc GE128 blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA depthWrite } }

That should make the black transparent, make it sound like metal when you walk on it, and render it two sided. I didnt have time to test it so im not 100% sure but its a start.




sinchiss

Om nom nom

50 XP

12th May 2008

0 Uploads

171 Posts

0 Threads

#3 9 years ago

What part of that shader makes the texture sound like metal? How does a shader even do that?




cloudflint

Go raibh grásta Dé leat

50 XP

7th January 2008

0 Uploads

123 Posts

0 Threads

#4 9 years ago

i believe its the line:

q3map_material HollowMetal

Which makes it so when you walk on it it makes a metal sound.




Thesolis

Thesolis

50 XP

19th July 2008

0 Uploads

64 Posts

0 Threads

#5 9 years ago

Thanks, I'll try it in a bit.




Thesolis

Thesolis

50 XP

19th July 2008

0 Uploads

64 Posts

0 Threads

#6 9 years ago

Hmmm, I did something wrong.

The console says that it can't find the texture in the shader.

I checked the paths and everything is fine in the editor.




Thesolis

Thesolis

50 XP

19th July 2008

0 Uploads

64 Posts

0 Threads

#7 9 years ago

Fixed the path problem but I can't see through the texture. Maybe because it's jpg?




sinchiss

Om nom nom

50 XP

12th May 2008

0 Uploads

171 Posts

0 Threads

#8 9 years ago

All the textures I have that have transparency (in game) are either .PNG or .TGA files. Then again, this shader isn't the one I use, so I'm not sure whether or not the filetype even matters. Paste your shader file here, so we can have a look at it.

And thanks Cloudfint, obviously didn't read through it well enough the first time :P




Thesolis

Thesolis

50 XP

19th July 2008

0 Uploads

64 Posts

0 Threads

#9 9 years ago
Spoiler: Show
textures/mymap/grate { surfaceparm nonopaque surfaceparm trans q3map_material HollowMetal q3map_nolightmap q3map_onlyvertexlighting cull twosided { map textures/mymap/grate.tga alphaFunc GE128 blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA depthWrite } }

I just used the one above. I might also mentions I'm using Quake 3 and not JKA, but their engines are pretty much the same so the script should work either way. I have JKA still but I'm experimenting.




Jonny2199

Click >HERE< to find an idiot.

50 XP

18th September 2005

0 Uploads

1,046 Posts

0 Threads

#10 9 years ago

Something about an Alpha Layer. I think. You need to make one in GIMP and make the bits you want invisible black.




  • 1
  • 2