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

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 2 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...