Jump to content
The Dark Mod Forums

Recommended Posts

Posted

What needs to change to the material bc_flaskglass to prevent this:

 

post-3633-0-18916400-1448128990_thumb.jpg

 

The ambient is (0.01, 0.01, 0.02).

 

The light from the lantern doesn't reach the flasks.

Posted

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...)

Posted

SVN looks the same as 2.03, though there are differences in the shader.

 

I'll experiment with the blend blend and cubemap as you suggest to see if I can get rid of the unwanted effect.

Posted

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.

Posted

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.

 

Posted

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
Posted

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...)

Posted

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.

Posted

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...)

Posted

Okay at work and it's too busy to do this, if no one else has looked at it, I'll get to it tonight when I get home in about 3 hours.

I always assumed I'd taste like boot leather.

 

Posted

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...)

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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...