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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • 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
×
×
  • Create New...