Jump to content
Sign in to follow this  
Overload

Cleaning shaders - should I be doing it?

Recommended Posts

Guest

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?


Steve Waite: Engineer at codelegend.com

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


 

RIG#1 - 7700K 5.0g ROG X270F 3600 15-15-15 - EVGA RTX 3090 1000W PSU 1- 850G EVO SSD, 2-256G OCZ SSD, 1TB,HAF942-H100 Water W1064Pro
40" 4K Monitor 3840x2160 - AS16, ASCA, GEP3D, UTX, Toposim, ORBX Regions, TrackIR
RIG#2 - 3770K 4.7g Asus Z77 1600 7-8-7 GTX1080ti DH14 850W 2-1TB WD HDD,1tb VRap, Armor+ W10 Pro 2 - HannsG 28" Monitors
 

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.


Steve Waite: Engineer at codelegend.com

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.


 

RIG#1 - 7700K 5.0g ROG X270F 3600 15-15-15 - EVGA RTX 3090 1000W PSU 1- 850G EVO SSD, 2-256G OCZ SSD, 1TB,HAF942-H100 Water W1064Pro
40" 4K Monitor 3840x2160 - AS16, ASCA, GEP3D, UTX, Toposim, ORBX Regions, TrackIR
RIG#2 - 3770K 4.7g Asus Z77 1600 7-8-7 GTX1080ti DH14 850W 2-1TB WD HDD,1tb VRap, Armor+ W10 Pro 2 - HannsG 28" Monitors
 

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.


Steve Waite: Engineer at codelegend.com

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


 

RIG#1 - 7700K 5.0g ROG X270F 3600 15-15-15 - EVGA RTX 3090 1000W PSU 1- 850G EVO SSD, 2-256G OCZ SSD, 1TB,HAF942-H100 Water W1064Pro
40" 4K Monitor 3840x2160 - AS16, ASCA, GEP3D, UTX, Toposim, ORBX Regions, TrackIR
RIG#2 - 3770K 4.7g Asus Z77 1600 7-8-7 GTX1080ti DH14 850W 2-1TB WD HDD,1tb VRap, Armor+ W10 Pro 2 - HannsG 28" Monitors
 

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.


Steve Waite: Engineer at codelegend.com

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?


 

RIG#1 - 7700K 5.0g ROG X270F 3600 15-15-15 - EVGA RTX 3090 1000W PSU 1- 850G EVO SSD, 2-256G OCZ SSD, 1TB,HAF942-H100 Water W1064Pro
40" 4K Monitor 3840x2160 - AS16, ASCA, GEP3D, UTX, Toposim, ORBX Regions, TrackIR
RIG#2 - 3770K 4.7g Asus Z77 1600 7-8-7 GTX1080ti DH14 850W 2-1TB WD HDD,1tb VRap, Armor+ W10 Pro 2 - HannsG 28" Monitors
 

Share this post


Link to post

I have never seen ANY NVidia driver change ANY code in the HLSL folder

Just who suggested the NVidia driver changes code in the HLSL folder? Not me vic, you're not seeing straight.

 

I said "If the drivers changed substantially enough, there would be corresponding code changes in \ShadersHLSL."

 

Obviously we would get those new \ShadersHLSL files in an update as I said here:

 

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.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

The shaders we are discussing, are little programs that paint on objects in the sim, and operate on Direct 3D images in the process of being drawn. The hardware is abstracted, and we have commonly NVidia and AMD graphics cards. These cards use drivers that allow them to operate as a direct 3d device. If the cards implement a new "capability" through driver changes, this capability might be able to be utilised by the sim and an issue of new files in \ShadersHLSL will be required to go with your driver update. So we should referesh the shaders with a graphics card change, or any major hardware changes. There's no worries deleting the shaders at any time (not the shadersHLSL code). Since they can take several minutes to rebuild, it's possible with the sim hanging with some kind of addon fault during that process could leave something skewed, and so rebuilding the shaders when there are odd graphics problems can help in cases.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

 

..Oh yes, and since the shaders take 2 minutes or more to create new, after deleting the shaders, make sure the sim has been running for at least several minutes before comparing notes about graphics settings and CPU affinity etc. It'll be way off as you'll not be seeing the true performance of the sim while the shaders are being made.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Finally!  We are on the same page!

 

I'll quit on that.

 

:)

 

one thing tho   :smile:  I have the greatest respect for your knowledge and the help you provide here in the forum, as I have learned a lot from you but sometimes, when someone asks what time it is, they just want the time, not to learn how the clock works.

 

Peace

 

Vic


 

RIG#1 - 7700K 5.0g ROG X270F 3600 15-15-15 - EVGA RTX 3090 1000W PSU 1- 850G EVO SSD, 2-256G OCZ SSD, 1TB,HAF942-H100 Water W1064Pro
40" 4K Monitor 3840x2160 - AS16, ASCA, GEP3D, UTX, Toposim, ORBX Regions, TrackIR
RIG#2 - 3770K 4.7g Asus Z77 1600 7-8-7 GTX1080ti DH14 850W 2-1TB WD HDD,1tb VRap, Armor+ W10 Pro 2 - HannsG 28" Monitors
 

Share this post


Link to post

 

After deleting the shaders folder, you'll notice 2-300 files in there after a short flight. These will increase to several thousand during use of the sim. They all take time to create, over perhaps months of flying. So they need preserving, not deleting. If deleted, the sim spends all that time unnecessarily recreating them again, everywhere you fly.

 

Finally!  We are on the same page!

 

I'll quit on that.

 

:)

 

one thing tho   :smile:  I have the greatest respect for your knowledge and the help you provide here in the forum, as I have learned a lot from you but sometimes, when someone asks what time it is, they just want the time, not to learn how the clock works.

 

Peace

 

Vic

No problem. If I'm called out, I'll be defending myself. You'll find that I'm posting on a discussion because I feel something is missing or misunderstood.

 

Heh, vic since you added "when someone asks what time it is, they just want the time, not to learn how the clock works." To be fair, I've carefully reread the discussion, syntactically and semantically analysed it. I would say there are members asking "how to tell the time" so that they need not ask.

 

:P

 


Steve Waite: Engineer at codelegend.com

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...