Jump to content
The Dark Mod Forums

Colored Specular bug with "wet stain" decal


nbohr1more

Recommended Posts

I found the first "color specular: bug (Tears of St Lucia basement):

 

stlucia_2020-03-11_11_35_53.thumb.jpg.100cdfa0ad967b5b3ed07fc8329145bf.jpg

 

The yellow patch on the ground flickers with r_testSpecularFix enabled. A few other places in this mission have these strange specular patches.

Probably attempts to make it look moist?

  • Thanks 1

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

5 hours ago, nbohr1more said:

I found the first "color specular: bug (Tears of St Lucia basement):

 

stlucia_2020-03-11_11_35_53.thumb.jpg.100cdfa0ad967b5b3ed07fc8329145bf.jpg

 

The yellow patch on the ground flickers with r_testSpecularFix enabled. A few other places in this mission have these strange specular patches.

Probably attempts to make it look moist?

 

There are no patches in that area that I can see in the map.  The closest thing is a dirt decal, but it's on the other side.  And the stone texture, textures/darkmod/stone/cobblestones/cobblestone_blue_black, does not have a specular stage.

Link to comment
Share on other sites

6 hours ago, Springheel said:

There are no patches in that area that I can see in the map.  The closest thing is a dirt decal, but it's on the other side.  And the stone texture, textures/darkmod/stone/cobblestones/cobblestone_blue_black, does not have a specular stage.

According to r_showSurfaceInfo, it is 9-th surface in _area123 with material textures/decals/stain01bwet.
Somehow, it applies to a triangular part of this floor.
It has specularmap textures/decals/stain01b_s.tga, which includes mild orange tones. Although I'm not sure why it looks so strong. Since the specular color is not set explicitly in the material, should the shader assume it is (1 1 1) ?

Link to comment
Share on other sites

  • 1 month later...
On March 11, 2020 at 11:02 PM, stgatilov said:

According to r_showSurfaceInfo, it is 9-th surface in _area123 with material textures/decals/stain01bwet.
Somehow, it applies to a triangular part of this floor.
It has specularmap textures/decals/stain01b_s.tga, which includes mild orange tones. Although I'm not sure why it looks so strong. Since the specular color is not set explicitly in the material, should the shader assume it is (1 1 1) ?

Looking at the material def, I think there is a bug with TWOSIDED_DECAL_MACRO.

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

11 hours ago, nbohr1more said:

Looking at the material def, I think there is a bug with TWOSIDED_DECAL_MACRO.

Perhaps it is time to fix it?

I have no idea what to do. Except that delete the specularmap line.

9 hours ago, duzenko said:

I just stumbled into this, and yes, this does not make sense

What does it mean BTW - zero timestamp in this context?

It is already fixed. Zero timestamp means that all files inside PK4 were last modified at the beginning of the epoch.

Even if you change a file inside and repack it, the game will still think it was modified at the beginning of the epoch and won't notice changes.

Link to comment
Share on other sites

I converted the specular to black and white with the "makeIntensity" keyword and it cured the flickering

but I'm afraid that workaround is only masking a general problem with specular decals.

I tried replacing the TWOSIDED_DECAL_MACRO with other decal attributes and still the colored specular decals flicker.

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

4 hours ago, stgatilov said:

Perhaps it is time to fix it?

I have no idea what to do. Except that delete the specularmap line.

Can I help somehow?

Quote

It is already fixed. Zero timestamp means that all files inside PK4 were last modified at the beginning of the epoch.

Even if you change a file inside and repack it, the game will still think it was modified at the beginning of the epoch and won't notice changes.

idDeclFile::Reload still checks for zero timestamps. That's what bothered me last night.

It reloads all packed materials, at least. Seemingly .def's and .prt's as well.

Link to comment
Share on other sites

On 3/11/2020 at 5:38 PM, nbohr1more said:

I found the first "color specular: bug (Tears of St Lucia basement):

 

stlucia_2020-03-11_11_35_53.thumb.jpg.100cdfa0ad967b5b3ed07fc8329145bf.jpg

 

The yellow patch on the ground flickers with r_testSpecularFix enabled. A few other places in this mission have these strange specular patches.

Probably attempts to make it look moist?

FWIW I can't repeat it on my side

image.png

Link to comment
Share on other sites

46 minutes ago, duzenko said:

FWIW I can't repeat it on my side

image.png

That is because I fixed the material.

 

tdm_decals_legacy.mtr

 

Broken:


 

textures/decals/stain01bwet
{
    TWOSIDED_DECAL_MACRO
    

    qer_editorimage textures/decals/stain01bwet.tga

    
     {
        blend    gl_dst_color,gl_zero
        map        textures/decals/stain01b.tga
     }

    specularmap   textures/decals/stain01b_s.tga
       
   
    
}

 

"Fixed" Rev 15923

 

textures/decals/stain01bwet
{
    TWOSIDED_DECAL_MACRO
    

    qer_editorimage textures/decals/stain01bwet.tga

    
     {
        blend    gl_dst_color,gl_zero
        map        textures/decals/stain01b.tga
     }

    {
       blend specularmap    
       map  makeIntensity(textures/decals/stain01b_s.tga)
       
    }
    
}

 

The issue is that this "fix" is probably hiding a general issue with this scenario.

If another mapper tries to create a decal with colored specular they will see the bug.

  • Like 1

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

15 hours ago, nbohr1more said:

That is because I fixed the material.

 

tdm_decals_legacy.mtr

 

Broken:


 


textures/decals/stain01bwet
{
    TWOSIDED_DECAL_MACRO
    

    qer_editorimage textures/decals/stain01bwet.tga

    
     {
        blend    gl_dst_color,gl_zero
        map        textures/decals/stain01b.tga
     }

    specularmap   textures/decals/stain01b_s.tga
       
   
    
}

 

"Fixed" Rev 15923

 


textures/decals/stain01bwet
{
    TWOSIDED_DECAL_MACRO
    

    qer_editorimage textures/decals/stain01bwet.tga

    
     {
        blend    gl_dst_color,gl_zero
        map        textures/decals/stain01b.tga
     }

    {
       blend specularmap    
       map  makeIntensity(textures/decals/stain01b_s.tga)
       
    }
    
}

 

The issue is that this "fix" is probably hiding a general issue with this scenario.

If another mapper tries to create a decal with colored specular they will see the bug.

Can you guess what they tried to achieve here?

I suspect blending with gl_dst_color is what adds the orange tone since the torch light is yellow

Link to comment
Share on other sites

  • 1 year later...

Missing Texture Uncompressed Specular File "stain01b_s.tga"

This concerns 2.08, 2.09, and 2.10 dev, and relates to @nbohr1more's May 7, 2020 post in this thread. The "stain01bwet" shader is defined in tdm_textures_base01.pk4/tdm_decals_dirt.mtr as:

textures/darkmod/decals/dirt/stain01bwet
{
    DECAL_MACRO
    translucent
    twosided
    noimpact
    qer_editorimage    textures/decals/stain01b
    {
        blend gl_dst_color,gl_zero
        map textures/decals/stain01b.tga
    }    
    {
       blend specularmap    
       map makeIntensity(textures/decals/stain01b_s.tga)
    }
}

Unfortunately, the file stain01b_s.tga is not included in any of these releases, only stain01b_s.dds, which makeIntensity(...) does not look for (nor should it). So a console complaint. Perhaps someone assumed that the .tga was unneeded, given the .dds, and so it was purged from the distribution.

If anyone could provide me with the missing file, I think I can work around the problem for my FM. (The original source, from @SeriousToni in 2008, no longer has a valid link.)

And of course a more permanent fix within 2.10 would be great.

  • Like 2
Link to comment
Share on other sites

stain01b_s.tga

1 hour ago, Geep said:

Missing Texture Uncompressed Specular File "stain01b_s.tga"

This concerns 2.08, 2.09, and 2.10 dev, and relates to @nbohr1more's May 7, 2020 post in this thread. The "stain01bwet" shader is defined in tdm_textures_base01.pk4/tdm_decals_dirt.mtr as:

textures/darkmod/decals/dirt/stain01bwet
{
    DECAL_MACRO
    translucent
    twosided
    noimpact
    qer_editorimage    textures/decals/stain01b
    {
        blend gl_dst_color,gl_zero
        map textures/decals/stain01b.tga
    }    
    {
       blend specularmap    
       map makeIntensity(textures/decals/stain01b_s.tga)
    }
}

Unfortunately, the file stain01b_s.tga is not included in any of these releases, only stain01b_s.dds, which makeIntensity(...) does not look for (nor should it). So a console complaint. Perhaps someone assumed that the .tga was unneeded, given the .dds, and so it was purged from the distribution.

If anyone could provide me with the missing file, I think I can work around the problem for my FM. (The original source, from @SeriousToni in 2008, no longer has a valid link.)

And of course a more permanent fix within 2.10 would be great.

Both of these are Doom 3 textures from pak004.pk4

I don't see any SVN history where we committed a TGA version only the DDS version.

I guess we can convert it to TGA and upscale it a little.

Here is a converted file:

stain01b_s.tga

Heh! That would explain why makeIntensity would cure the flicker. It just kills the specular texture.

  • Like 1
  • Thanks 1

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

18 hours ago, nbohr1more said:

Both of these are Doom 3 textures from pak004.pk4

That's a potential copyright issue, isn't it? Or were there particular textures included with Doom 3 which were released under an open license when the D3 engine itself became open source?

Link to comment
Share on other sites

In the "be careful what you wish for" category, I added that file to my FM's /textures/decals/, and now I've got the flickering on my bar top (of a tavern_bar01 model). Sigh

I'm guessing that when the DDS is created it munges the surface normals, and they remain munged when converted backto TGA. Although I guess there's also a 3 color issue, which is why MakeIntensity had to be used.

Edited by Geep
Link to comment
Share on other sites

23 minutes ago, OrbWeaver said:

That's a potential copyright issue, isn't it? Or were there particular textures included with Doom 3 which were released under an open license when the D3 engine itself became open source?

The DDS uses an alternate image that does not exactly match the Doom 3 original.

I guess the only concern might be the name of the texture but it is so generic that I somehow doubt we would be in trouble?

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

BTW, the post between SeriousToni and @Springheel was from 2013, not 2008. Here:

As I said above, the dropbox links are no longer good. But there is a reference to FM "Chalice of Kings", so maybe better (non-infringing, non-flickering) versions of these 2 variant files (diffuse & specular) could be had from there?

EDIT: No custom textures in TD2:Chalice of Kings. 🙁

Edited by Geep
Link to comment
Share on other sites

Hmm, when I said above, "I'm guessing that when the DDS is created it munges the surface normals, and they remain munged when converted backto TGA", I was confused. That doesn't apply to a specular map, only to a normal/bump map (which is not used in this shader).

Link to comment
Share on other sites

I tried converting the tga to b&w with lens blur and adjustments to brightness/contrast. Probably too bright, so it became like a sheet of glass in an experimental FM. But then it immediately became obvious that the "flickering" was just plain old z-fighting. I'm seeing some evidence that the tavern_bar01 model (even if not custom scaled) incorporated instances of this stain decal in the same plane as the wood bar top surface. Maybe at one time this was ok to do, but not now?

So if you wanted to use specular as intended here, only correcting the model (e.g., in blender), to put space between the wood surface and stain, would do it. Sorry, no can do myself.

(Or give up on specular & return to leaving out the .tga file)

Link to comment
Share on other sites

Yes, it seems that either specular of itself or in combination with surface normals is changed enough since 2.05 that this texture is very prone to z-fighting. It should be possible to fix with a high polygonOffset or privatePolygonOffset value but it doesn't seem to work in my tests. Perhaps these keywords require a dmap? (Not eager to do a bunch of dmap iterations to find out.)

Hmm... maybe I need to disable bindless textures...

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

I'm currently really busy so I'm not sure if I understood correctly what you discussed: Do you need the textures from the dropbox links still? I can have a look in my backup files then. Just ping me here again if that is the case.

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

I moved this discussion out of the 2.08 Beta thread

Related bug trackers:

https://bugs.thedarkmod.com/view.php?id=5044

https://bugs.thedarkmod.com/view.php?id=5325

  • Thanks 1

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

      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
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...