Transparency in textures - how?

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

Sat Jul 14, 2007 10:07 am

  • How does one make textures with transparency? For rails, ladders, windows, membranes, etc. Is there is postfix that will make this happen - as with the glowmasks and so on?
    2 GHz Mac Pro
    Mac OS X 10.6.2
    nvidia GeForce 8800 GT
    Clueless Newbie
    Keyboard killer
     
    Posts: 518
    Joined: Wed Jan 03, 2007 1:01 pm

Sat Jul 14, 2007 11:09 am

  • same ways as in quake3

    first make a image with a alfachannel. where the alfa is white the image will be opace, black transparent. anything inbetween will be a blend. then fire yp you favorite texteditor and do something like:
    Code: Select all
    textures/procyon2/mfx1
    {
       qer_editorimage textures/Procyon2/mfx1.tga

       {
          map textures/Procyon2/mfx1.tga
          blendfunc blend
       }

       {
          blendfunc filter
          map $lightmap
          rgbGen identity
          tcGen lightmap
       }
    }

    save in nexuiz/data/scripts/yourmap.shader. Now open nexuiz/data/scripts/shaderlist.txt and add youmap on a new line at the borrom. Ofc replace filenamesand paths in the shader with your own.

    Alternativly, if the areas to be transparent on yer image is all black (and no ares that shoud not be arent) you can use someit like:
    Code: Select all
    textures/procyon2/grid1
    {
       qer_editorimage textures/procyon2/grid1.tga

       surfaceparm nomarks
       surfaceparm trans
       surfaceparm alphashadow
       cull none
       nopicmip
       nomipmaps



       {
          map textures/procyon2/grid1.tga
          rgbGen identity
          alphafunc GT0
       }

       {
          map $lightmap
          rgbGen identity
          tcGen lightmap
          blendfunc filter
       }
    }


    (alphafunc GT0 insted of blendfunc blend)
    HOF:
    <Diablo> the nex is a "game modification"
    <Diablo> quake1 never had a weapon like that.
    <Vordreller> there was no need for anything over 4GB untill Vista came along
    <Samua>]Idea: Fix it? :D
    <Samua>Lies, that only applies to other people.
    User avatar
    tZork
    tZite Admin
     
    Posts: 1337
    Joined: Tue Feb 28, 2006 6:16 pm
    Location: Halfway to somwhere else

Sat Jul 14, 2007 2:33 pm

  • tZork wrote:same ways as in quake3

    first make a image with a alfachannel. where the alfa is white the image will be opace, black transparent. anything inbetween will be a blend. then fire yp you favorite texteditor and do something like:

    Ok. Thanks. B)
    2 GHz Mac Pro
    Mac OS X 10.6.2
    nvidia GeForce 8800 GT
    Clueless Newbie
    Keyboard killer
     
    Posts: 518
    Joined: Wed Jan 03, 2007 1:01 pm

Sat Jul 21, 2007 11:13 am

  • tZork wrote:same ways as in quake3

    first make a image with a alfachannel. where the alfa is white the image will be opace, black transparent.


    Hmm.. I see I need to figure out how to make an image with an alpha channel. But I think that might be a topic for a different forum. Does radiant / nexuiz accept other formats than .tga?


    Alternativly, if the areas to be transparent on yer image is all black (and no ares that shoud not be arent) you can use someit like:
    Code: Select all
    textures/procyon2/grid1
    {
       qer_editorimage textures/procyon2/grid1.tga

       surfaceparm nomarks
       surfaceparm trans
       surfaceparm alphashadow
       cull none
       nopicmip
       nomipmaps



       {
          map textures/procyon2/grid1.tga
          rgbGen identity
          alphafunc GT0
       }

       {
          map $lightmap
          rgbGen identity
          tcGen lightmap
          blendfunc filter
       }
    }


    (alphafunc GT0 insted of blendfunc blend)


    I tried this. Pasted it into my shader script and changed the filenames so they would fit that I'm doing. But that made the compiler quit early in the process and left me with a map with no shadow effects at all.
    2 GHz Mac Pro
    Mac OS X 10.6.2
    nvidia GeForce 8800 GT
    Clueless Newbie
    Keyboard killer
     
    Posts: 518
    Joined: Wed Jan 03, 2007 1:01 pm

Sat Jul 21, 2007 2:56 pm

  • Clueless Newbie wrote:Hmm.. I see I need to figure out how to make an image with an alpha channel.

    With gimp: right click -> Layer -> Transparency -> Add alpha channel

    But I think that might be a topic for a different forum. Does radiant / nexuiz accept other formats than .tga?

    Yes, jpeg & png. However jpeg doesn't support alpha channels, so it's of no use in this case.
    User avatar
    KadaverJack
    Site admin and forum addon
     
    Posts: 1102
    Joined: Tue Feb 28, 2006 9:42 pm

Sat Jul 21, 2007 4:43 pm

  • tZork wrote:same ways as in quake3

    first make a image with a alfachannel. where the alfa is white the image will be opace, black transparent. anything inbetween will be a blend.


    Are you sure it's not the other way around? Turns out PS can make files with Alpha channels (through the "save for web" option), but there the black is opaque and white is transparent.

    And I can't find any way to invert the aplha layer. (not in Gimp either)
    2 GHz Mac Pro
    Mac OS X 10.6.2
    nvidia GeForce 8800 GT
    Clueless Newbie
    Keyboard killer
     
    Posts: 518
    Joined: Wed Jan 03, 2007 1:01 pm

Sun Jul 22, 2007 11:31 am

  • in ps, select the alfa (channels tab) and hit ctl+i (you can also use save as and select tga / png, no need for the save 4 web stuff)
    HOF:
    <Diablo> the nex is a "game modification"
    <Diablo> quake1 never had a weapon like that.
    <Vordreller> there was no need for anything over 4GB untill Vista came along
    <Samua>]Idea: Fix it? :D
    <Samua>Lies, that only applies to other people.
    User avatar
    tZork
    tZite Admin
     
    Posts: 1337
    Joined: Tue Feb 28, 2006 6:16 pm
    Location: Halfway to somwhere else

Sun Jul 22, 2007 6:02 pm

  • tZork wrote:in ps, select the alfa (channels tab) and hit ctl+i (you can also use save as and select tga / png, no need for the save 4 web stuff)

    I'm using PS 2 Elements, and it doesn't seem to have an alpha channels tab.

    The texture I'm working on is this:

    Image

    As far as I can tell the apha channel is the inverse of what it's supposed to be - according to the description tZork gave in his reply. But it seems to be transparent in the right places as it appears in my post. If the alpha is inverse, can the shaders be written to accommodate this (so black is opaque and white transparent)?
    2 GHz Mac Pro
    Mac OS X 10.6.2
    nvidia GeForce 8800 GT
    Clueless Newbie
    Keyboard killer
     
    Posts: 518
    Joined: Wed Jan 03, 2007 1:01 pm



Return to Nexuiz - Editing




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest