Jump to content
The Dark Mod Forums

Render bug, large black box occluding screen


V-Man339

Recommended Posts

3 minutes ago, nbohr1more said:

Hmmm... glsl offers "isnan" and "isinf" (infinity) operations

It is all messing with symptoms.

It is much better to find the exact place where NaN or Inf appears and put a fix just before that. That's guaranteed to work, since it does not allow NaN to appear.

Link to comment
Share on other sites

Sure.

Just for reference, this does compile:

 if ( isnan(totalColor.r) || isnan(totalColor.g) || isnan(totalColor.b) ) {
    return vec3(0);
    }
    else {
    return totalColor;
    }

 

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

10 hours ago, stgatilov said:

Maybe something is bad with your driver or GPU?

 

This is an AMD card, so more than likely it's a performance hack or AMD doing something stupid with OpenGL.

Is there a reason that we couldn't just provide a simple small black dds specular texture on startup for any shader missing it?

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

9 minutes ago, AluminumHaste said:

Nevermind, found another driver and copied it, TDM tries to use it and crashes.

I wonder what does it mean "copied driver" ?
I hope you don't just copy some files of the driver around your OS?

Also, using drivers which came out before Windows 11 is probably a bad idea for you.

Link to comment
Share on other sites

Ok, so I cleaned out the drivers and installed the old Win 11 drivers, OpenGL version

OpenGL vendor: ATI Technologies Inc.                                           
OpenGL renderer: AMD Radeon RX 5700 XT                                         
OpenGL version: 3.3.13570 Core Profile Forward-Compatible Context 19.8.1       
26.20.13001.29010 core                 
                                        
Checking required OpenGL features...                                           
v - using GL_VERSION_3_3                                                       
v - using GL_EXT_texture_compression_s3tc                                      
v - using WGL_VERSION_1_0                                                      
v - using WGL_ARB_pixel_format                                                 
Checking optional OpenGL extensions...                                         
v - using GL_EXT_texture_filter_anisotropic                                    
    maxTextureAnisotropy: 16.000000                                            
v - using GL_ARB_stencil_texturing                                             
v - using GL_EXT_depth_bounds_test                                             
v - using GL_ARB_buffer_storage                                                
v - using GL_ARB_texture_storage                                               
v - using GL_ARB_multi_draw_indirect                                           
v - using GL_ARB_vertex_attrib_binding                                         
v - using GL_ARB_bindless_texture                                              
X - GL_ARB_compatibility not found                                             
v - using GL_KHR_debug                                                         
v - using WGL_EXT_swap_control                                                 
Max active texture units in fragment shader: 32                                
Max combined texture units: 160                                                
Max anti-aliasing samples: 8                                                   
Max geometry output vertices: 1023                                             
Max geometry output components: 4095                                           
Max vertex attribs: 29     

And the problem doesn't happen in TDM. So it's a driver bug, typical AMD bullshit.

  • Like 1
  • Sad 1

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

39 minutes ago, stgatilov said:

I wonder what does it mean "copied driver" ?
I hope you don't just copy some files of the driver around your OS?

Also, using drivers which came out before Windows 11 is probably a bad idea for you.

Most games and apps will look for a driver located locally in the same directory. Games are common in this regard. You can quickly and easily test different drivers by copying them from a driver package, into your game directory. Instead of uninstalling, cleaning, rebooting, installing different driver package, restarting again then testing.

I just copied the wrong opengl driver, that's why TDM crashed.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

4 minutes ago, AluminumHaste said:

Most games and apps will look for a driver located locally in the same directory. Games are common in this regard. You can quickly and easily test different drivers by copying them from a driver package, into your game directory. Instead of uninstalling, cleaning, rebooting, installing different driver package, restarting again then testing.

I just copied the wrong opengl driver, that's why TDM crashed.

And which file do you think contains OpenGL driver? 😀

Link to comment
Share on other sites

Yes, a long time thing for ATI \ AMD was extracting the OpenGL dll(s) and placing them in the directory next to the executable. It would allow you to have the latest drivers but also play games where the latest driver broke something in an older game. Not sure how well that works now but it seems that AH has done this and it still works?

I would still like to know if we can workaround the driver bug by forcing a NaN check though...

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 tried it but it didn't work, TDM tried to use it but failed.

I ended up removing and cleaning then installed the 2019 Win 11 driver.

Could we just supply a small black specularmap texture for the driver to use since that seems to get around the problem in the first place?

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

I'm pretty sure that opengl32.dll does not contain GPU driver.

Imagine you have two monitors, with AMD GPU connected to the first one, and NVIDIA GPU connected to the second one. When you start game, OS chooses the driver depending on which monitor it was started at. If there is only one opengl32.dll in C:\Windows\System32 and application loads it statically (that's the usual case), then how can OS choose between drivers?

With OpenCL, you can explicitly choose vendor and device to use, which is yet another reason why the DLL which application uses cannot contains the actual driver. Then typical thing is to have single opencl.dll which redirects API calls to whatever vendor driver being used right now (vendor drivers are called "Installable Client Driver"-s). I even built such a redirecting OpenCL library myself, and it was deployed locally with an application, in order to make sure it can boot even if there is no GPU driver installed in OS.

GPU driver is usually located in entirely different file, like nvoglv32.dll for NVIDIA. Moreover, you cannot be sure that this is the only file.
Recently one guy here tried to replace the Intel GPU driver manually, and got some error like "failed integrity check", meaning that the vendor or the OS itself probably checks if the driver code was not messed with.

Better stop messing with drivers!

Link to comment
Share on other sites

10 minutes ago, AluminumHaste said:

Could we just supply a small black specularmap texture for the driver to use since that seems to get around the problem in the first place?

I don't like it.
What about hundreds of other materials which have a stage of the same kind?
Why are you sure it actually helps universally, and it is not plain luck that it worked for you this time?

In fact, the C++ code already binds _black texture if specularmap is not specified.

Link to comment
Share on other sites

Right, got it.

The ATI/AMD opengl drivers are located in the driverstore folder, atioglxx.dll

rJdzKJH.png

You used to be able to copy that file to the exe location, rename it to opengl32.dll and the application would use that driver instead of the system installed one.

I used to have to do this for photoshop on my laptop as PS used to only see the intel iGPU. Copying the atioglxx.dll file to the photoshop directory and renaming it opengl32.dll would allow photoshop to see the AMD gpu for acceleration tasks.

  • Like 1

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Hmm, well a little more weirdness if this wasn't weird at all.

Removing the bumpmap stage ALSO gets rid of the blue fickering squares.

I thought maybe the normalmap had out of range values, so converted the TGA normalmap to DDS and normalized it, but still got the flickering after removing the TGA version.a

Getting rid of the bumpmap stage in the material definition fixes the issue also.

 

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

 

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Yep, in practical terms updating the material is a good workaround since there is no reason for an emissive texture to use normal maps or specular.

The current conversation is just academic regarding the risk of other shaders or materials possibly causing similar errors and how to (as best as possible) prevent that.

If checking for NaN at the end of the enhanced interaction solves the issue here, then chances are it will prevent other bad data scenarios from affecting the renderer. As I take it, stgatilov wants to go deeper into the render pipeline and see if any of our own logic could make these bad values under the right conditions. It's a cleaner approach and also saves a few shader operations. I just think that it might be a pretty hard thing to find in a reasonable amount of time and there is even the possibility that none of our code is broken and this is all due to driver issues. Given the latter possibility, if a NaN check works then it's a pretty small change and performance penalty to keep really buggy driver behavior away.

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

8 hours ago, AluminumHaste said:

Getting rid of the bumpmap stage in the material definition fixes the issue also.

8 hours ago, nbohr1more said:

Yep, in practical terms updating the material is a good workaround since there is no reason for an emissive texture to use normal maps or specular.

I don't mind commenting out bumpmap line.
At least this is not a hack.

Link to comment
Share on other sites

Well shit, I just loaded up Iris Beta 4 and I'm getting the blue boxes around the health potion.

models/darkmod/potions/health
{
	glass
	qer_editorimage models/darkmod/props/textures/health_ed

	{
		blend	diffusemap
		map	models/darkmod/props/textures/health
		scroll	time * 0.2 , time * 0	
	}
	{
	//	if ( parm11 >= 0.5 ) 
		blend	add
		map	models/darkmod/props/textures/health
		rgb	0.2
		scroll	time * 0 , time * 0.2	
		//scale	 2 , 1
	}
    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         models/darkmod/props/textures/health
        rgb         0.15 * parm11
    }



}

There's no bumpmap in this one. God damn it AMD!

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Well, either I get a graphics card like you have, or you become a programmer like I am 😀

Just looking at which objects have the problem will unlikely get us closer to understanding the problem (and inserting random mitigations probably won't help too).

BTW, I cannot reproduce the problem on my RTX 550. Maybe this issue happens on new GPUs only, maybe I have old (and thus "still" working driver), maybe this is Windows 11 only.
 

Link to comment
Share on other sites

8 minutes ago, stgatilov said:

Well, either I get a graphics card like you have, or you become a programmer like I am 😀

Just looking at which objects have the problem will unlikely get us closer to understanding the problem (and inserting random mitigations probably won't help too).

BTW, I cannot reproduce the problem on my RTX 550. Maybe this issue happens on new GPUs only, maybe I have old (and thus "still" working driver), maybe this is Windows 11 only.
 

Well, I can give you access to remote into my computer. I have the dev environment set up.

This is something I had to do with the developer of OBS. When their alpha vulkan capture branch was having issues, he used Visual Studio remotely on my computer to diagnose the issue within 20 minutes. Was pretty awesome actually watching him work.

EDIT: I'm currently transferring my Darkmod SVN directory from an SSD to my M.2 SSD. Is there a reason the TDM SVN is 42GBs? And can I shrink that down?

  • Like 1

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