Sign in to follow this  
Overload

Cleaning shaders - should I be doing it?

Recommended Posts

Something I've never done in FSX or P3D, just in case I mess up - But is it important every now and again?

Eugene

Share this post


Link to post
Help AVSIM continue to serve you!
Please donate today!

I usually remove the shaders folder when I've installed a new version of my display driver, but that's it.

Share this post


Link to post

I do it when I change sceneries, display drivers or driver settings. Only one mouse click with "Simstarter".

Share this post


Link to post

I use the Prepar3D recommended method:
 
 
Tuning Guide
 

[GRAPHICS]
 

SHADER_CACHE_VERSION=1

 

Non-Default entry. This entry will not exist in your Prepar3D.cfg file by default and must be added to the file.
Performance Tuning Tip:
Using this rebuilds your shader cache by incrementing the number each time you make a change to the Prepar3D.cfg.

 


 
Cheers

Share this post


Link to post

The shader cache version work fine only if you make a change to the cfg file. It does not do anything if you do not change the file.

 

Other than the time it takes to rebuild the shaders, there is no harm in deleting them. Anytime I make any sort of change in P3D, I delete the shaders. Add aircraft, scenery, any graphics driver settings,. NVI changes, etc.

 

Vic

Share this post


Link to post

The shaders only need rebuilding after any shader code has changed. So we make a change in the shader code and we delete the shaders and they are remade from the new code when the sim next runs and finds they are missing. The cfg setting saves shader coders the hassle of deleting the shader folder each visit.

Share this post


Link to post

Interesting, Thanks.

It's a new P3D 3.1 install, so far I've added FTX Global, SoCal and England, and a couple of Capt Sim retro jets - sounds like I should be re spawning the shaders?

The cfg mod looks like the easiest/safest way for a non techy,

 

  "[GRAPHICS]

SHADER_CACHE_VERSION=1

 

It needs another cfg mod to get it to kick in, but if I did something innocuous like changing VSYNC=1 to VSYNC=0, or vice versa, would that do the trick?

Just to complete my understanding - is this to make it look better, or increase FPS or both?

Thanks

Eugene 

Share this post


Link to post

None of. It's for when code in the folder "C:\Program Files (x86)\Lockheed Martin\Prepar3D v3\ShadersHLSL" is changed.

 

The shaders only need rebuilding after any shader code has changed. So we make a change in the shader code and we delete the shaders and they are remade from the new code when the sim next runs and finds they are missing. The cfg setting saves shader coders the hassle of deleting the shader folder each visit.

Share this post


Link to post

Not discussing the "when" but the "how"

 

You can create a bat file this way (replace YOURNAMEHERE with your username)

 

Placed anywhere, it will delete the content of your shader folder in one click.

 

 

del /f /q "C:\Users\YOURNAMEHERE\AppData\Local\Lockheed Martin\Prepar3D v3\Shaders\*.*"

Share this post


Link to post

None of. It's for when code in the folder "C:\Program Files (x86)\Lockheed Martin\Prepar3D v3\ShadersHLSL" is changed.

 

 

OK,Thanks - How would I know this has happened?

Eugene

Share this post


Link to post

I also have set up a batch file which deletes the shaders folder and also starts ASN and P3D, all in a row. The batch file itself is started by the simstarter tool, just had to point to it in simstarter's "start definition". So one cklick does it all. And so my shaders folder gets deleted everytime i start the sim.

 

Simon

Share this post


Link to post

Everytime...? Seriously? Isn't that a bit too much? Those shaders are saved for a reason, why would you delete them everytime?! I only delete them whenever I installed new scenery or (totally) change my settings. Doing this everytime is a bit counterproductive. I personally don't want to wait every single time for that black screen to disappear. It also hurts performance in the beginning. Certainly not something I would advice everyone to do.

  • Upvote 2

Share this post


Link to post

OK,Thanks - How would I know this has happened?

Eugene

When you get an update from 3.1 to 3.2 look in the files in the .zip, if there are any for \ShadersHLSL, then they changed and you need to delete the old shaders.

Share this post


Link to post

Those aren't the same shaders Steve. The ones the OP asked about are in:

C:\Users\xxx\AppData\Local\Lockheed Martin\Prepar3D v3\Shaders

 

The shadersHLSL are not rebuilt using the shader_cache_version.

 

The shadersHLSL should NOT be touched unless one really knows what they are doing.

 

Vic

Share this post


Link to post

When you get an update from 3.1 to 3.2 look in the files in the .zip, if there are any for \ShadersHLSL, then they changed and you need to delete the old shaders.

 

EDIT

Vic typed quicker.

 

EDIT

Or no, I had the window opened too long before I answered. :wink: Anyway, I already wondered what Steve was talking about. And anyway 2: I find the method to change the number in the cfg to delete the shaders a bit cumbersome: it's easier to simply do it manually whenever you think it is needed.

Share this post


Link to post

Hi Jeroen,

maybe I should try without deleting the shaders folder, but yes, sometimes I do start the sim by just hitting the P3D.exe, for checking this or that without the simstarter options. But I think I don't remember any difference or black screen... I have this set up a long time. I was reading somewhere it doesn't harm to start with an empty shaders folder? And as I'm a tweeaker like many of us and new P3Dv3 installers, new things you don't need but have to try [ ] pop up everywhere, I was just keeping my start routine. But okay, I may take my stop watch and count the seconds when starting the sim. Maybe you're right? Simming time is expensive if you have a 10 months old son like I have...

 

Cheers,

Simon

Share this post


Link to post

Those aren't the same shaders Steve. The ones the OP asked about are in:

 

C:\Users\xxx\AppData\Local\Lockheed Martin\Prepar3D v3\Shaders

 

The shadersHLSL are not rebuilt using the shader_cache_version.

 

The shadersHLSL should NOT be touched unless one really knows what they are doing.

 

Vic

 

no vic that's the SHADER CODE I spoke of.

 

You see vic, as I was saying, when code in "C:\Program Files (x86)\Lockheed Martin\Prepar3D v3\ShadersHLSL" is changed, we delete the \Shaders folder (or the individual files we are concerned with) in the "C:\Users\[you]\AppData\Local\Lockheed Martin\Prepar3D v3\Shaders" folder, the new shaders with those changes are made when the sim starts. I do wish you could read my posts more carefully.

 

Perhaps vic, you didn't realise that code in the \ShadersHLSL folder is responsible for creating the shaders in the \Shaders folder. So if we get an update to P3D and we see we have files from \ShadersHLSL contained within the .zip, we therefor know the shaders in the \Shaders folder will need to be allowed to be recreated - so we delete those.

 

 

Shaders are what the GPU uses to draw graphic techniques for example, object surfaces. The shader code found in \ShadersHLSL creates the Shaders in the \Shaders folder. The question was asked, "when do we delete the shaders", answer "after the shader code has changed". So that new shaders are created from it.

 

Clear as mud?

Share this post


Link to post

No problem Steve -  I just felt that you confused the issue completely. The OP was asking about the shader cache folder NOT the ShadersHLSL. You are correct in that the cache needs to be rebuilt when HLSL code is changed but that is not the function of the Shader_Cache_Version_Entry - according to LM

Using this rebuilds your shader cache by incrementing the number each time you make a change to the Prepar3D.cfg.

 

Altho some changes to the P3D.cfg file *might* change the HLSL code all of them do not but any change in p3d.cfg will increment the SCV entry. Also it is recommended to rebuild the cache when you install a new graphics driver, and I don't believe that has any effect on the HLSL folder either

 

I just fear that someone will misunderstand and delete the HLSL shaders expecting them to be rebuilt.

 

Vic

Share this post


Link to post

I just felt that you confused the issue completely. The OP was asking about the shader cache folder NOT the ShadersHLSL. You are correct in that the cache needs to be rebuilt when HLSL code is changed but that is not the function of the Shader_Cache_Version_Entry - according to LM

Using this rebuilds your shader cache by incrementing the number each time you make a change to the Prepar3D.cfg.

You still failed to read my posts.

 

This is what I initially said, and I draw your attention to "The cfg setting saves shader coders the hassle of deleting the shader folder each visit."

 

 

The shaders only need rebuilding after any shader code has changed. So we make a change in the shader code and we delete the shaders and they are remade from the new code when the sim next runs and finds they are missing. The cfg setting saves shader coders the hassle of deleting the shader folder each visit.

Share this post


Link to post

Boy, we are talking round the same corner - I suggest you UNDERSTAND what I am typing rather than ASSUME what I mean.

 

I know what you are saying.

 

You are, of course, correct re shaders.

 

what I AM SAYING is that your answer, altho correct, misses the point of the OP and can lead to confusion.

 

Many people ask about why and when to DELETE the shaders. The suggested plan by LM and others is either add the SCV entry and have them rebuild when anything in the cfg file is changed and to manually rebuild when installing a new driver.

 

The relationship between HLSL and the cache is not relevant in THIS context and could confuse some. I've had more than one user get confused and delete the HLSL folder.

 

Vic

 

edit: maybe I'm just too sensitive to this issue - perhaps it is perfectly clear to all and I'm just overly cautious.

Share this post


Link to post

Boy vic, face it...

 

Eugene said "Just to complete my understanding - is this to make it look better, or increase FPS or both?"

 

I said "None of. It's for when code in the folder "C:\Program Files (x86)\Lockheed Martin\Prepar3D v3\ShadersHLSL" is changed."

 

Eugene said "OK, Thanks - How would I know this has happened?"

 

I said "When you get an update from 3.1 to 3.2 look in the files in the .zip, if there are any for \ShadersHLSL, then they changed and you need to delete the old shaders."

 

I just think you were not keeping up at the time, vic.

Share this post


Link to post

I said "None of. It's for when code in the folder "C:\Program Files (x86)\Lockheed Martin\Prepar3D v3\ShadersHLSL" is changed."

So you are saying that it is not necessary when changing drivers?

 

Vic

Share this post


Link to post

...and obviously, the concept of deleting the shaders, and where they are found, was well understood by that time in the discussion.

 

 

So you are saying that it is not necessary when changing drivers?

 

Vic

If the drivers changed substantially enough, there would be corresponding code changes in \ShadersHLSL. And so we come back to the situation I described, that is, if the code in \ShadersHLSL is changed then we delete the \Shaders folder.

Share this post


Link to post

OK, so you are saying that if there are no code changes in \ShadersHLSL there is no need to rebuild the cache at all. so to ask again the OP's follow up question -

 

Eugene said "OK, Thanks - How would I know this has happened?"

 

I have never seen ANY NVidia driver change ANY code in the HLSL folder - am I mistaken - and if it DOES - how would we know?

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this