Jump to content
The Dark Mod Forums

bc_flaskglass lights up in the dark


grayman

Recommended Posts

The 2.03 material has a blend add stage. In the SVN version it's a blend blend stage which reduces this effect though you would need to darken or remove that stage and the cubemap stage to completely eliminate any effects that don't respect lighting.

 

Have you tried the SVN version?

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Removed the cubemap, but nothing changed.

 

It's the red/green/blue settings in the blend blend that are the problem. At 0.1, the glass is all lit up in the dark. At 0.01, the glass is dark in the dark, but not very visible when light shines on it. Answer is somewhere in between. I'll fiddle with the numbers.

 

Thanks.

Link to comment
Share on other sites

Hey Gman, take a look at the work I did on this stained glass window. It lights when light sources shine on it, and it's almost black in the dark.

 

post-529-0-89696600-1448203855_thumb.jpg

post-529-0-39214700-1448203855_thumb.jpg

 

Here's the mat def

 

 



// Author: AluminumHaste
textures/darkmod/glass/stained_glass_clear_2sided
{
    noshadows
    translucent
    glass
    twoSided
    forceoverlays
    sort decal
    sort nearest
    forceOpaque
    sort postProcess

    qer_editorimage textures/darkmod/glass/stained_glass_clear_ed
    diffusemap textures/darkmod/glass/stained_glass_clear_d
    {
        blend    add
        map        textures/darkmod/glass/stained_glass_clear_d
        rgb     0.08
    }
    {
        vertexProgram heatHaze.vfp
        vertexParm  0  0 , 0  // texture scrolling
        vertexParm  1  2  // magnitude of the distortion

        fragmentProgram heatHaze.vfp
        fragmentMap 0  _currentRender
        fragmentMap 1  textures/darkmod/glass/stained_glass_clear_local // the normal map for distortion
    }
    
    description "A highly ornate transluscent stained glass window"
    //--------------------------------------------------------------------------------------------------------
    {
        blend gl_dst_alpha, gl_one
        maskalpha
        cubeMap env/gen1
        // tone down the reflection a bit
        red     Parm0 * 0.12
        green   Parm1 * 0.12
        blue    Parm2 * 0.12
        texgen  reflect
    }
    // add our texture on top
    {
        blend   gl_dst_color, gl_one
        map    textures/darkmod/glass/stained_glass_clear_d
        red     Parm0
        green   Parm1
        blue    Parm2
    }
    {
        blend filter
        map textures/darkmod/glass/stained_glass_clear_d
    }

    // This is the code required for frob highlighting this texture
    {
        if ( parm11 > 0 )
            blend       gl_dst_color, gl_one
            map         _white
            rgb         0.40 * parm11
       }
    {
        if ( parm11 > 0 )
            blend       add
            map         textures/darkmod/glass/stained_glass_clear_d
            rgb         0.15 * parm11
    }
    //bumpmap textures/darkmod/glass/stained_glass_clear_local
    specularmap textures/darkmod/glass/stained_glass_clear_s
    
    // TDM Ambient Method Related
    {                            
        if (global5 == 1)        
        blend add                
        map                _black        
        scale            1, 1        
        red                global2    
        green            global3    
        blue            global4    
    }                            
}
  • Like 1

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

We could make those flasks fully light-responding like AH's window. So they don't show up in the dark at all. That way people don't have to tweak RGB settings to get them to look right in a given setting.

 

A simpler example of a lit transparency (simpler than the window def above) is our cobwebs. They need a bump map, which can be the fake _flat, then a blend add stage to hold the diffusemap. Obs rediscovered that adding a bump map can make flasks and other transparencies light-interacting.

 

The one disadvantage is they don't ever get shadowed, so they can be oddly lit by a light the other side of a wall.

  • Like 1
Link to comment
Share on other sites

Yeah, the SVN versions are light reactive as per that discovery but the "milky texture" is still somewhat problematic.

It might be solvable by making the diffuse stage a texture with alpha as the "milky texture" instead.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

The engine will stop us using the alpha channel for lit materials. All light interactions are drawn "blend add", which ignores alpha. For solid objects, the background color is always black so you wouldn't know that a blend had been used. But for transparencies, the background is whatever solid object has already been drawn, and the brightness of the foreground object is simply added to the colour in the background.

 

That said, the milky stage could be light-interacting too of course so it shouldn't be a problem.

Link to comment
Share on other sites

Hmm pretty strange experimental results then.

 

The "blend blend" acts much more like a diffuse than "blend add" in the material here.

 

Obviously I haven't tested all permutations of OpenGL blend modes but I wonder if

the better route might be to assign the stage a light vfp shader so it re-runs the light

interaction for that stage...

 

Time to tinker again I guess.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Are you referring to the video or an in-game test Biker?

 

The specular is some random grey-ish texture with a little grime to indicate that these are old flasks.

 

specularmap textures/darkmod/metal/flat/silver01

 

feel free to find a suitable grey specular texture.

 

The surface is a little strange on some of the objects in the video due to the fact that this is just bare surface normals

with no true normal map to smooth them. So you might be seeing the specular hit triangle edges and produce gourad artifacts.

The fix is to make High-Poly versions of the models and bake them as normal maps for the affected objects...

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...