Jump to content


Photo

GLSL shader problems with latest ATI Radeon drivers

drivers shadows amd

  • Please log in to reply
126 replies to this topic

#1 Bluehawk

Bluehawk

    Member

  • Member
  • PipPip
  • 18 posts

Posted 29 January 2019 - 06:10 PM

Hello Dark Mod team and community, long time listener, first time caller here...

 

I recently ran into a problem with TDM 2.06 when I upgraded my Radeon drivers to 18.12.2. I can't remember what driver version I had before that (I don't upgrade too often) but I was able to run GLSL and soft shadows with the same hardware I have now, but the upgrade broke these shaders. Besides rolling back my drivers, I can work-around this problem by entering "r_useGLSL 0". I held off on reporting this problem because 19.1.1 was getting ready to release and I was hoping the new drivers would fix this, but sadly they have not.

 

The way the shaders glitch out is interesting, walls are only lit by half and usually along a diagonal line or a curve that doesn't match the light that should be cast by the source and meshes are sometimes cut into quarters or lit in . Sometimes things aren't lit at all despite being directly in view of a light source, and look like their normals have been flipped inside-out or something. Normal maps and speculars are also not working. Besides being ugly, you can't always see where pools of light are being cast until you step into them and your light gem tells you you're visible, which inhibits gameplay. In every other respect, the game seems normal, but broken lighting in a Thief game is a problem, so I'm playing 2.06 in "2.05 mode" for the moment.

 

Here are some examples:

Spoiler
 - from "Sir Talbot's Collateral" with GLSL on (broken) and same scene with GLSL off (old lighting working correctly)

 

Spoiler
- "Heart of Lone Salvation", GLSL on and GLSL off (please pardon the missing book on the table)

 

I'm using an AMD Radeon R9 390 Series, 8 gb of GDDR5 VRAM

Intel Core i7 2600K at 3.4 GHz

Windows 7 Home Premium 64 bit

16 GB of DDR3 physical memory

 

On the Dark Mod wiki there's mention of creating a game profile with Surface Format Optimization turned off, but that did not alleviate the problem.

 

Have you guys seen this before? I think the developer Stgatilov had a similar graphical problem and reported it here: http://forums.thedar...hics-on-nvidia/ But his problem was on 2.05 and with Nvidia hardware, not AMD/ATI.


  • Anderson likes this

#2 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 824 posts

Posted 29 January 2019 - 07:12 PM

I'm having a similar problem but on the 2.07 Beta, the last time I played the game ( a week ago ) everything worked fine, today after seeing this thread went to see if everything worked and to my surprise this is what it looks like!
 
https://drive.google...SkJ7tXBIRuCl8ZP

 

The most strange is that I didn't updated drivers so it worked before on the current drivers I have. 

 

GPU AMD RX 570 8GB on older 18.12.3



#3 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1934 posts

Posted 29 January 2019 - 07:26 PM

looks like the normal/bump map is not being shown



#4 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9508 posts

Posted 29 January 2019 - 08:17 PM

Please post your Darkmod.cfg
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#5 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 824 posts

Posted 29 January 2019 - 08:38 PM

Spoiler


Edited by HMart, 29 January 2019 - 08:40 PM.


#6 AluminumHaste

AluminumHaste

    Darkmod Contributor

  • Development Role
  • PipPipPipPipPip
  • 6306 posts

Posted 29 January 2019 - 08:50 PM

Disable AMD Shader Cache, also try removing your Darkmod.cfg file and let TDM make a new one.

 

DH-012-14.png


  • stgatilov likes this

I always assumed I'd taste like boot leather.

 

#7 Bluehawk

Bluehawk

    Member

  • Member
  • PipPip
  • 18 posts

Posted 29 January 2019 - 09:26 PM

I tried disabling the shader cache (both as a global setting and in my profile for TDM) and wiped the config, but the problem persists.



#8 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9508 posts

Posted 29 January 2019 - 10:01 PM

OK.

Let's see if we can get an error:

In GLSL mode, start a mission then:

1) Open the console ( CTRL + ALT + ~ )
2) Invoke reloadGLSLprograms
3) Invoke condump GLSL_ISSUE.txt

Then post the resulting text file.

Thanks.
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#9 Bluehawk

Bluehawk

    Member

  • Member
  • PipPip
  • 18 posts

Posted 29 January 2019 - 10:57 PM

The relevant lines at the end are:

 

]reloadGLSLprograms
---------- R_ReloadGLSLPrograms_f -----------
interaction VF
ambientInteraction VF
stencilShadow VF
shadowMap VGF
oldStage VF
depthAlpha VF
fog VF
blend VF
cubeMap VF
---------------------------------
]condump GLSL_ISSUE.txt
Dumped console text to GLSL_ISSUE.txt.
 
Full txt file attached.

Attached Files


Edited by Bluehawk, 29 January 2019 - 10:57 PM.


#10 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1722 posts

Posted 30 January 2019 - 07:51 AM

Yes, Bluehawk's issue looks like the same as I had.

HMart's issue looks different.

 

Unfortunately, I cannot tell exactly what I did to make it work.

I updated drivers from NVIDIA site, rebooted machine a few times, probably removed darkmod.cfg a few times.

Also you can try to rerun updater to ensure that you have correct packages. Maybe even remove tdm_base01.pk4 before that (it contains shaders).

At some moment it has simply disappeared, and I had no idea what cause it and what fixed it.

You can also try to edit glprogs/interaction.fs inside tdm_base01.pk4 by changing something, do reloadGLSLPrograms, then return back and do it again.

 

The picture 1) has no bumpmapping, and 2) has wrong normals.

Probably it means that the contents of normal maps become wrong (e.g. filled with some constant color).

I thought maybe it is related to normal maps compression, but it seems to be disabled by default, and you said you deleted config file.



#11 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 824 posts

Posted 30 January 2019 - 08:00 AM

Disable AMD Shader Cache, also try removing your Darkmod.cfg file and let TDM make a new one.

 

DH-012-14.png

 

Disabling the shader cache and deleating the Darkmod.cfg improved things on my end but didn't solved all the problems, the light still behaves strangely.  See the image below. 

 

https://drive.google...opTH4GjAxUHO53n



#12 AluminumHaste

AluminumHaste

    Darkmod Contributor

  • Development Role
  • PipPipPipPipPip
  • 6306 posts

Posted 30 January 2019 - 08:14 AM

You still aren't getting bumpmapping properly, try typing r_skipbump 1 and r_skipspecular 1 in the console and then vid_restart.

Everything should be kinda dull and boring but surfaces should be lit properly.

I get this:

 

Attached File  stlucia_2019-01-30_08.12.31.jpg   524.81KB   0 downloads


I always assumed I'd taste like boot leather.

 

#13 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 824 posts

Posted 30 January 2019 - 08:17 AM

OK.

Let's see if we can get an error:

In GLSL mode, start a mission then:

1) Open the console ( CTRL + ALT + ~ )
2) Invoke reloadGLSLprograms
3) Invoke condump GLSL_ISSUE.txt

Then post the resulting text file.

Thanks.

 
Here is my GLSL_ISSUE
 

Spoiler



#14 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 824 posts

Posted 30 January 2019 - 08:41 AM

You still aren't getting bumpmapping properly, try typing r_skipbump 1 and r_skipspecular 1 in the console and then vid_restart.

Everything should be kinda dull and boring but surfaces should be lit properly.

I get this:

 

attachicon.gif stlucia_2019-01-30_08.12.31.jpg

 

Did that, the lighting is totally wrong on my side.

 

https://drive.google...ly1-Jig1XwjlhfD

 

ps. Doing vid_restart made the screen become gray and add to forcefully kill TDM as even the console didn't show after it. 


Edited by HMart, 30 January 2019 - 08:43 AM.


#15 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1722 posts

Posted 30 January 2019 - 08:52 AM

Better backup the whole tdm_base01.pk4 before changing it, and restore it after changes!

 

Please try to go to glprogs/intersection.fs inside tdm_base01.pk4.

Ensure that you have Stencil shadows enabled in TDM (r_shadows 1).

 

Now find the lines in the file:

vec3 RawN = u_RGTC == 1.
    ? vec3(bumpTexel.x, bumpTexel.y, sqrt(max(1.-bumpTexel.x*bumpTexel.x-bumpTexel.y*bumpTexel.y, 0)))
    : normalize( bumpTexel.wyz );

Replace these lines with one line of the following:

vec3 RawN = normalize( bumpTexel.wyz );
vec3 RawN = normalize( bumpTexel.xyz );
vec3 RawN = vec3(0, 0, 1);

After trying each of these three cases, perform reloadGLSLPrograms in the game.

Don't forget to pack the pk4 file back beforehand (in fact, it is easier to unpack it if you know how).

 

Report back how these three cases influence lighting.

Which make lighting good? Which retain it in the same buggy state?



#16 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 824 posts

Posted 30 January 2019 - 09:17 AM

vec3 RawN = normalize( bumpTexel.wyz );

 
Same bad lighting.
 

vec3 RawN = normalize( bumpTexel.xyz );


Better but still wrong
 

vec3 RawN = vec3(0, 0, 1);


I think this one solved it.

https://drive.google...0-BVs7E9jOkxDnB

 

p.s - normal maps and specular were disabled before by using r_skip and I also updated my drivers to the latest ones just to be sure but it didn't solve the problem, only those shader changes did. 


Edited by HMart, 30 January 2019 - 09:19 AM.


#17 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1722 posts

Posted 30 January 2019 - 10:13 AM

 I think this one solved it.
https://drive.google...0-BVs7E9jOkxDnB

p.s - normal maps and specular were disabled before by using r_skip and I also updated my drivers to the latest ones just to be sure but it didn't solve the problem, only those shader changes did. 

Yes, but the third way completely disables bumpmapping in the shader, you won't be able to enable it back even if you restore r_skipbump 0.

So this is not a complete solution yet.

 

Anyway, this gives some idea of what is going on.

It seems that fetching bumpmap texture yields trash.

Given that the objects look completely flat, I assume that it returns constant value (same for all fragments).

And given that it looks wrong, I suspect that it may be black color (which corresponds to weird (-1, -1, -1) normal).

And if this is true, then it means that bumpmap texture is not loaded properly into the GL pipeline. Or the textures are loaded from file wrongly, which is less likely.

 

Does release build/config show OpenGL errors in game console?

If not, we should enable it and see if there are errors.



#18 AluminumHaste

AluminumHaste

    Darkmod Contributor

  • Development Role
  • PipPipPipPipPip
  • 6306 posts

Posted 30 January 2019 - 10:22 AM

Seems kinda typical of AMD driver releases though.......


I always assumed I'd taste like boot leather.

 

#19 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9508 posts

Posted 30 January 2019 - 10:28 AM

Hmm, maybe bad S3TC support.

 

Try the new RGTC compression in 2.07 beta:

 

image_useNormalCompression 2

 

The downside is some ARB water\glass shaders wont look right.


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#20 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 824 posts

Posted 30 January 2019 - 08:10 PM

Sorry for the lack of reply but add to go out.  About the drivers i'm well aware that AMD support for OpenGL is not the best and OpenGL itself is a mess but this kind of serious problems is something I very rarely experience, don't take me wrong i'm not blaming stgatilov or anything but something most have changed on the engine side recently that exposed some driver bug, especially when it worked fine a week before on the same drivers. 

 

Btw you guys could contact AMD driver team "boss" directly here https://twitter.com/CatalystMaker and expose this problem, I know he is very active on twitter and imo it would not hurt to try talking to him. Perhaps you really found some driver bug that is exposed by this particular code and i'm sure they would like to know. 



#21 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 824 posts

Posted 30 January 2019 - 08:33 PM

Hmm, maybe bad S3TC support.

 

Try the new RGTC compression in 2.07 beta:

 

image_useNormalCompression 2

 

The downside is some ARB water\glass shaders wont look right.

 

Using the original interaction.fs with image_useNormalCompression 2 does improve things slightly but the lights still look wrong is as if they are cut off diagonally, normals are still missing tho.  I will take some screens. 

 

https://drive.google...7zvE_4H61nNXVsh

 

 

Btw how do I attach images into the forum? Is through the "My Media" option? If so how do I put images into it? 


Edited by HMart, 30 January 2019 - 08:43 PM.


#22 AluminumHaste

AluminumHaste

    Darkmod Contributor

  • Development Role
  • PipPipPipPipPip
  • 6306 posts

Posted 30 January 2019 - 09:14 PM

When you go to reply at the bottom of the page, you have to click on the button More Reply Options to get the full editor. There you can upload attachments, but the size limit is pretty low.


  • HMart likes this

I always assumed I'd taste like boot leather.

 

#23 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1722 posts

Posted 30 January 2019 - 11:04 PM

I don't believe there is any driver bug.

The S3TC support is known as "ubiquitous extension", meaning that everyone supports it for a long time without caveats.

I'm pretty sure there is some issue in the game which sometimes shows up.

 

Please try to set r_ignoreGLErrors 0 immediately after starting TDM and load mission again.

Or even better, start TDM with command line arguments: TheDarkModx64.exe +seta r_ignoreglerrors 0

After mission is loaded, save a condump and attach here.

Hopefully, it will show some OpenGL errors, although I'm not sure they will be descriptive.


  • AluminumHaste likes this

#24 Bluehawk

Bluehawk

    Member

  • Member
  • PipPip
  • 18 posts

Posted 31 January 2019 - 02:21 AM

I ran the updater and it downloaded a lot more files than I thought it would, considering I was working from a fresh install in the first place, using the 2.0 and patches from moddb, and I got a blue "error during initialization" console window. I ran the updater again and it downloaded 3 more files and resolved itself.  :huh:

At any rate, it didn't resolve the GLSL problems.

 

Running with "r_ignoreGLErrors 0", loading the training mission and con-dumping, here is the result.

Attached Files


Edited by Bluehawk, 31 January 2019 - 02:21 AM.


#25 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 824 posts

Posted 31 January 2019 - 09:42 AM

Please try to set r_ignoreGLErrors 0 immediately after starting TDM and load mission again.
Or even better, start TDM with command line arguments: TheDarkModx64.exe +seta r_ignoreglerrors 0
After mission is loaded, save a condump and attach here.
Hopefully, it will show some OpenGL errors, although I'm not sure they will be descriptive.

 
Here is mine console dump 

Attached Files


Edited by HMart, 31 January 2019 - 09:47 AM.






Also tagged with one or more of these keywords: drivers, shadows, amd

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users