• Shoutbox
    Active Users: 0
     
  • Notice: N/A
    Loading...
 
  • Active Users
     
  • There are currently no users chatting.
 
Results 1 to 5 of 5
  1. #1

    semi transparent / dirty or tinted windows in a map

    G'day all, can MOH recognize TGA mask alpha channel values other than 0 & 255?
    I have made a few windows for maps before, with and without sign writing on them, but that's basic 0 and 255 opacity values in the mask alpha channel.
    I have painted a dirty industrial type window with 50 glass panels for this map and I want the transparency of the panels to differ from one to the next one so I have staggered the mask values at 0, 16, 32, 64, 128, 192 for each glass panel and of course 255 for the frame.
    Anything under 128 is all clear glass in the game where as anything over is not transparent in the slightest. Not the results I'm after.
    I know this method works for glass tinting in other games, even primitive ones such as Need For Speed, which didn't require shader files at all.

    My shader for this window is...

    textures/rome/industrial_windowz
    {
    qer_editorimage textures/rome/industrial_windowz
    qer_keyword glass
    qer_keyword window
    qer_trans .6
    surfaceparm glass
    // cull none
    {
    map textures/mohcommon/envnormndy_day.tga
    tcgen environment
    alphagen const .2
    blendFunc blend
    }
    {
    map textures/rome/industrial_windowz.tga
    depthWrite
    rgbGen identity
    alphaFunc GE128
    nextbundle
    map $lightmap
    }
    }
    Changing the lines "qer_trans .6" to "qer_trans .1" and "alphagen const .2" to "alphagen const .05" didn't do anything.
    Without the line "map textures/mohcommon/envnormndy_day.tga" (used for the glass reflection, which I don't really want) my texture doesn't show at all in the game.
    When I edit the line "alphaFunc GE128" to any other value other than 128 the glass texture it not transparent at all.

    I realize there aren't many mappers around these days but perhaps someone knows of a map with dirty looking, or tinted semi transparent windows and I could checkout how it was achieved.
    Cheers

  2. #2
    Administrator Major_A's Avatar
    Join Date
    Jul 2016
    Location
    Huntington, IN USA
    Posts
    391
    Trophies
    Blog Entries
    15
    I might have what you need.

    Here is my transparent logo for ICCC



    It's in underground chamber if you want to see it

    http://www.mohaaaa.co.uk/AAAAMOHAA/node/12338


    Here is the shader

    Code:
    textures/Major_A/ICCC_2014_Major_A
        {
            qer_keyword blood
            qer_keyword blood
            //qer_trans .4
            surfaceparm mud
            polygonOffset
            {
                map textures/Major_A/ICCC_2014_Major_A.tga
                depthWrite
                blendFunc blend
                //rgbGen identity
                //tcgen environment
                //alphagen const .2    
            }
            {
                //alphaFunc GE128
                nextbundle
                map $lightmap
                //rgbGen identity
                //blendFunc GL_DST_COLOR GL_ZERO
                //depthFunc equal
            }
        }



  3. #3
    Cheers Major, much appreciated.
    At first I looked through your textures searching for a possible "window.tga" 'cause I've had bloody windows stuck on my brain for two days. lol
    I did find how to make an awesome burger though.

    It took some time to find that underground chamber. A hint or two on how to get there (for the ol' fart) would have been nice. Thank Gawd for spectator mode.

    Awesome stuff mate, cheers.

  4. #4
    Administrator Major_A's Avatar
    Join Date
    Jul 2016
    Location
    Huntington, IN USA
    Posts
    391
    Trophies
    Blog Entries
    15
    oops my bad, thought you would just spec through it lol

    shortcut on allied toilet....
    IF it's activated in .scr file.

    The underground teleport actually teleports every other time it's activated to two different spots...helps with telefragging.

    Did you shoot the hanging car? hahaha

    Glad you like the hamburger recipe I put in the map, it was really f'king good



    Let me know if that fixed your transparency problem.
    Last edited by Major_A; 05-29-2017 at 05:41 AM.



  5. #5
    Quote Originally Posted by Major_A View Post
    ...
    Did you shoot the hanging car? hahaha
    Glad you like the hamburger recipe I put in the map, it was really f'king good



    Let me know if that fixed your transparency problem.
    Nah mate, I didn't shoot the hanging car. I ran towards the gun then remembered that pic saying "look up" and thought it was a trap for the car to come crashing down on me. lol
    I had trouble trying to climb down the rope in both boats and fell a couple of times. I think I broke a hip.
    Yeah the burger had me licking my monitor for a solid 20 minutes. BTW, that main ingredient is called "mince" or "minced meat", not "hamburger". Just wondering if it's any different to "rissole"? lol
    Sorry mate, that'll teach you to edit maps stoned.

    More importantly, it solved my transparency woes. Funnily enough the shader is close to what I started with but I was using Paint Shop Pro 5 which is pathetic with the TGA format.
    I tweaked the shader so many times before realizing it was the TGA at fault.. or perhaps a little from column A and a little from column B.
    If you re-open the TGA to edit the (mask) alpha channel using PSP5 after you've made and closed it, it will distort the mask. No matter how many times I restored it there were random lines across it in the game.
    Luckily I also have Paint Shop Pro 6 which is far more targa friendly. I should have remembered that sooner (from my NFS days)... but I may have hit my head falling in one of your boats.

    Anyway, it's all good now.
    Much appreciated my friend.

    Gawd dang, now I need to wash the bloody windows, they're f'king filthy.
    Last edited by AccadaccA; 05-29-2017 at 12:31 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •