Jump to content
The Dark Mod Forums

Render bug, large black box occluding screen


V-Man339

Recommended Posts

Pretty strange.

I think non-lit textures are handled by the "old stage" part of the renderer. I believe @duzenko emulated that via a dedicated glprog... oldstage.fs \ vs

If I look at the code, there is an unprotected divide xy by w operation:

 

void main() {
    vec4 tex;
    if (u_screenTex == 1.0) {
        tex = var_TexCoord0;
        tex.xy /= tex.w;
        tex = tex * 0.5 + 0.5;
        tex = texture(u_tex0, tex.xy);
    } else
        tex = textureProj(u_tex0, var_TexCoord0);
    FragColor = tex*var_Color;

We can try:

void main() {
    vec4 tex;
    if (u_screenTex == 1.0) {
        tex = var_TexCoord0;
        tex.xy /= max(tex.w, 0.0000001);
        tex = tex * 0.5 + 0.5;
        tex = texture(u_tex0, tex.xy);
    } else
        tex = textureProj(u_tex0, var_TexCoord0);
    FragColor = tex*var_Color;

@stgatilov @cabalistic ?

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

@AluminumHaste try these clamped glprogs:

oldStage.fs

bloom_upsample.frag.glsl

bloom_downsample.frag.glsl

Note: Make sure to place them in glprogs after you compile since compiling will overwrite the contents of glprogs with the default versions

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

So the texture itself is flickering blue and this does not happen if it is "diffuse"?

What happens if you change the material to blend add:
 

{

blend add

map textures/darkmod/window/diamond_pattern02_moonlit

}

 

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

AFAIK The only other shader that can be involved is the fullscreen_tri.vert.glsl shader but clamping the first term in the coordinates results in the render occupying a quarter of the screen.

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

It doesn't seem to matter no. However, I can't get it to always stay in that flickering state. Most of the time it flickers as I move the mouse around.

It doesn't seem to be based entirely on view but also camera movement direction.

My work shift is done so I have to log off for now. If you have any other suggestions I'll try them tonight or tomorrow.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Nothing much more from me now.

Perhaps set tdm_lg_interleave_min to 1 so you can lower the FPS again and check the flicker pattern below the default 40FPS value?

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 guess I should unpack a little of the previous trouble-shooting:

1) If you remove my clamped glprogs, does the latest SVN still render those boxes ?

2) If so, can you cure the boxes with just the bloom upscale and bloom downscale glprogs ?

( I really don’t like guarding against divide by zero with an arbitrary high precision float, so I hope that only the max 0 fixes are beneficial. )

 

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

6 hours ago, AluminumHaste said:

Interesting, the flickering is per frame, it's not constant like it was before

That's because the issue in bloom implementation was fixed by added clears.
My hypothesis was true: that's the special floats (Inf or Nan) with unprotected blending that caused it to stick.

Now that we got rid of the sticking, the core problem of getting special values still persists. And it can be generated by absolutely anything in our shader park.

Link to comment
Share on other sites

14 minutes ago, nbohr1more said:

I guess I should unpack a little of the previous trouble-shooting:

1) If you remove my clamped glprogs, does the latest SVN still render those boxes ?

2) If so, can you cure the boxes with just the bloom upscale and bloom downscale glprogs ?

( I really don’t like guarding against divide by zero with an arbitrary high precision float, so I hope that only the max 0 fixes are beneficial. )

 

1) Yes it does.

2) The blue boxes around the windows goes away, but then the windows flicker blue every frame.

  • Like 1

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

20 minutes ago, AluminumHaste said:

1) Yes it does.

2) The blue boxes around the windows goes away, but then the windows flicker blue every frame.

Thanks. I'll commit those two to SVN tdm_src and hopefully we will track down whatever is causing the blue data elsewhere.

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

2 minutes ago, stgatilov said:

Ehm... and what is the fix exactly?

Both the bloom_downsample.frag.glsl and bloom_upsample.frag.glsl accumulate a "sum" variable.

Some of the operations done on the sum variable are subtractions.

My fix is to ensure that the minimum value for sum is 0

void main() {
    // query previous mipmap level by a full-pixel offset (corresponds to half-pixel in our output framebuffer)
    vec2 offset = vec2(1, 1) / textureSize(u_sourceTexture, 0);
    vec4 sum = sampleTexture(vec2(0, 0)) * 4;
    sum += sampleTexture(-offset);
    sum += sampleTexture(offset);
    sum += sampleTexture(vec2(offset.x, -offset.y));
    sum += sampleTexture(vec2(-offset.x, offset.y));
    FragColor = max(sum, 0) / 8;

 

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

Well.....I noticed that there's no specular map stage in the mat definition so added one.

specularmap textures/darkmod/window/diamond_pattern02_moonlit

problem gone....

 

Quote

textures/darkmod/window/diamond_pattern02/diamond_pattern02_moonlit
{
    glass
    noselfshadow
    noshadows
    qer_editorimage    textures/darkmod/window/diamond_pattern02_moonlit_ed
    {
        //blend add
        map    textures/darkmod/window/diamond_pattern02_moonlit
        rgb 1
    }
    specularmap textures/darkmod/window/diamond_pattern02_moonlit
    bumpmap textures/darkmod/window/diamond_pattern02_local
    {
        if ( parm11 > 0 )
        blend    gl_dst_color, gl_one
        map        _white
        rgb        0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend    add
        map        textures/darkmod/window/diamond_pattern02_moonlit
        rgb        0.15 * parm11
    }

 

}

 

  • Like 1

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Did the same for

textures/darkmod/window/diamond_pattern02/diamond_pattern02_moonlit_soft
{
    glass
    noselfshadow
    noshadows
    qer_editorimage    textures/darkmod/window/diamond_pattern02_moonlit_soft_ed
    {
        
        map    textures/darkmod/window/diamond_pattern02_moonlit
        rgb 0.6
    }
    specularmap textures/darkmod/window/diamond_pattern02_moonlit
    bumpmap textures/darkmod/window/diamond_pattern02_local
    {
        if ( parm11 > 0 )
        blend    gl_dst_color, gl_one
        map        _white
        rgb        0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend    add
        map        textures/darkmod/window/diamond_pattern02_moonlit
        rgb        0.15 * parm11
    }

 

}

 

And in Flakebridge the issue is gone also.

I always assumed I'd taste like boot leather.

 

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
       
      · 3 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...