V 3.0: Volumetric light & fog, lens flares & dirt, visor reflections / water droplets, god rays, depth of field, night & thermal vision scopes, dynamic wet surfaces with reflections, rainbows and many other effects.

Report RSS Dynamic Shaders 2.0 announcement

After extensive work including various code rebuilds I've come to the decision to start version 2.0 instead of continuing with 1.2.

Posted by on

Modding friends as well as frequent visitors of my moddb site certainly have noticed that my recent development is going to become much more than a simple "minor release" as intended with the version number "1.2".

While raising the shaders' complexity inevitably by extending the feature set significantly with the latest (striking) new possibilities such as reflective wet surfaces, sun shafts, visor reflections, and general lighting improvements (among other things), I have spent vast amounts of time in improving, or at least maintaining, both compile time and runtime performance, what led to many overall changes and tweaks I had to deal with. Nothing extremely serious, but at least certainly more than just noticeable. And absolutely required to get those new features running on the majority of user systems.

Since I've already done so much work on the planned version 1.2 while still being in the middle of the development cycle without seeing yet any light at the end of the tunnel, I have come to a point where I had to make a decision on how to move on. After what has been said above, I came to the conclusion that it makes much more sense and is more appropriate for the project's future to start a new major version instead of continuing with the next "minor" release.

This said, there will not be a version 1.2 - all things that you have seen since release 1.1 will flow into Dynamic Shaders 2.0 which will be the next official release of my shader pack.

More information will follow soon. Please stay connected :-)

Detailed Information about the mod (moved from summary page)

Compatibility with other mods:

  • Tested with patches 1.0004, 1.0005, and 1.0006; works only with dynamic lighting / r2 render mode
  • Should work (besides shader mods) that with any other mod; however merging of the bind_stalker.script file might be required.

    Tested with the following mods:
    - STALKER Map Pack by Kostya (incl. all extensions, total of 41 maps)
    - Priboi Story
    - Clear Sky Faction Mod
    - OGSE
    - Stalkersoup (with some limitations)
    - Automn Aurora
    - Particle Paradise
    - Twilight Ket
    - Stalker Weather Total Conversion, Dynamic Weather, Stalkerskies


  • Please backup your user.ltx file prior to installing the mod because it will be modified (affects only r2_aa settings).
  • To take full advantage of the zoom DOF effect I recommend the use of the Gnomus Scopes mod.

General merging procedure (if you have installed other mods):

  1. Copy the "shaders" folder of this mod into your "gamedata" folder. If there was already such a folder, you might want to backup it prior to replacing with mine.
  2. Copy the "shader_control.script\" file into the "gamedata/scripts" directory.
  3. Open your "bind_stalker.script\" file in the "gamedata/scripts" directory, and within the function "actor_binder:update(delta)" add a new line with "shader_control.Update()". If no "bind_stalker.script\" file is present, simply copy mine.

Usage & Credits:

You may use, modify, and deploy this mod as long as you are giving credit to the authors:

  • Kingo64 for the compliation "STALKER Shaders MAX" (which in turn is based on the work of Sky4ce and other authors; see there)
  • Meltac for the dynamic depth of field, dynamic nightvision, and dynamic wet surfaces/reflections shader additions, and for implementing the new sunshafts.
  • Ket for the conceptual support, ideas, testing, and implementation advises, especially with the new sunshafts.
  • BAC9-FLCL and Sky4ce for the lighting model fix (optimized light reflections).

In case you are experiencing issues:

In order to help me optimize this mod, please report any issues to me along with the following context information:

- your entire shaders/r2/ShaderSettings.txt
- your entire user.ltx

- First of all: Have you properly installed (or merged) all files of the mod, including scripts?
- type of your graphic adapter / GPU
- Do you run any FOV (field of view) switcher mod or tool, such as macron's FOV switcher?
- what other mod(s) are being used at the same time?
- are you using some anti-aliasing feature, and if so, where do you configure it?
- What part of the screen is affected by the issue (e.g. trees only, entire periphery, everything in the distance, entire screen etc.)
- Is the issue occuring while zooming your weapon, or in normal view mode?

Furthermore, providing some in-game video might help as well to locate the issue.

Please send these infos/files by eMail or upload or post it here.

If you are getting an error message saying you'd need support for pixel shaders v1.1 upon game startup:

First check everything said in the previous section.

In many cases the problem is not that pixel shaders v1.1 itself wasn't supported, so that error message is very misleading. Instead, there are several causes for this issue (first 2 come from Kingo64)

  1. You installed over the top and it somehow bugged out instead of deleting the exist shaders folder and placing mine in.
  2. You did not configure ShaderSettings.txt properly and caused a syntax error.
  3. You have edited and broken a shader file.
  4. Your GPU has a hardware failure, such as overheating or some manufacture error.
  5. Your GPU does not support one or more graphical feature(s) of this mod.
    Some GPUs - even new ones - appear to have troubles with some specific shader settings, first of all SSAO. Disabling that/those feature(s) in ShaderSettings.txt solves the issue in most cases. See also this thread on GSC Forums (for CS, but is also true in ShoC) .

If you are getting weird-looking shadows:

That's not a bug of this mod but a well-known issue in ShoC whose effect be increased with these shaders. To fix it open up your console in-game with ~ and type

r2_sun_near_border 1.0

and hit enter (alternatively you can change that value directly in your user.ltx).
Thanks Loner1 for pointing this out.


Epic news meltac! Glad with this! :)

Reply Good karma Bad karma+4 votes

Yay goodluck man

Reply Good karma Bad karma+2 votes

im wondering if these would work with lurk or smp

Reply Good karma Bad karma+2 votes

Thanks for the update; makes total sense. Good luck!

Reply Good karma Bad karma+2 votes
Meltac Author

Thanks guys, I'll keep you informed ;-)

Reply Good karma+2 votes

Great stuff, and thanks.

Bugs I noticed:

1) Shadow maps above 2048 have no effect, or actually make shadows look worse. Since the default is 4096, I thought you should know. Same thing happens with the Shaders Max mod. Engine limitation? Dunno.

2) Sun shafts play with the shadow edge boundary (the distance at which shadows are created -- determined by the r2_sun_near setting. Mine is 40.) in a bad way. When you look at the spot on the ground where the the shadows start to draw, it causes extremely noticeable darkening.

Feature requests:

1) Film grain filter.
2) Vignette filter.
3) FXAA filter.

Anyways, great work. I have everything turned on and tweaked, and it looks great... excepting when sun shafts screw up, which is often... but, whatever. Still looks great.

I'll see if I can push the shadow draw distance further back, but I spent a lot of time tweaking settings to make shadows look good at a distance of 40... If I could increase the shadow map texture size to something over 2048 (and make it work), then I know that would help.

Reply Good karma Bad karma+2 votes

Hey, so I made a quick fix for #2.

Replace accum_sun_far.ps with this modified version:

And add the following line somewhere in shadersettings.txt:

Solved it for me. YMMV. Here's my complete shadersettings file incase it helps any:

Reply Good karma Bad karma+2 votes

Updated versions:

accum_sun_far.ps: Dl.dropbox.com
accum_sun_near.ps: Dl.dropbox.com
shadersettings.txt: Dl.dropbox.com
and my user.ltx just in case: Dl.dropbox.com

I split the existing ss_contrast into two seperate settings:

... so I have more control over the brightness in those two ranges. It's important as SS_INTENSITY increases.

I may add fxaa soon, just for the lols.

Reply Good karma Bad karma+2 votes

made some more tweaks... jitter and shadow sampling options.

shadow.h: Dl.dropbox.com

Previous links updated.

Reply Good karma Bad karma+2 votes

Made some more tweaks... this time for SSAO.

12 samples (when quality was set to 2), looked like crap for me... and quality set to 3 would crash my card after a little while. So, I changed your algorithm somewhat... unrolled the loop... removed the branch...

I can run with 36 samples now... 42 still overheats my gpu shaders after a while. ;)

common.h: Dl.dropbox.com

combine_1.ps: Dl.dropbox.com

Game looks great. I think I'm done tweaking these shaders. Thanks again!

Reply Good karma Bad karma+2 votes

> Shadow maps above 2048 have no effect

Thought I should add that increasing the shadowmap setting does reduce shadow blur... but the resolution of the actual shadowmap does not actually increase.

Perhaps this is just the way it's supposed to be, and it is what it is. If that's the case, I've found that 2048 looks best -- the shadows are more defined, yet are still soft.

Reply Good karma Bad karma+2 votes

Upon further investigation, your shader code is doing everything it should. It's just that my game refuses to accept any changes to the smap size. Even the -smapxxxx switch has no effect whatsoever. Dunno why. Oh well.

Reply Good karma Bad karma+2 votes
Meltac Author

Hey Daemonjax, thanks for your investigations. I will have a look at the files you posted as soon as I get a chance to. Meanwhile some comments:

1. Smap size. Never played with that nor noticed any glitches. But good to know those caveats. Maybe it'd be best to make 2048 the default.

2. Sunshafts. As you may have seen I'm making a completely new sunshafts implementation for V2.0 which has nothing to do with those in V1.1. The old implementation was very glitchy and I think best for most people would be to have either turned it off completely, or least least toned it down to a minimum. The new sunshafts won't fix everything and they'll have their own downsides, but at least the look quite cool under most conditions.

3. Film grain and Vignette filter. Not a big deal to do that. But: In what situations should they come into play? And considering the built-in ppe effectors already provide a quite good film grain effect, isn't that one sufficient for your needs?

4. FXAA. Not an issue of my shaders. There exists some injection tool you can easily use in Shoc - with or without my shaders.

Reply Good karma+2 votes

>1. Smap size...

Yeah, it's weird. Dunno why I can't actually change it. I have mine set to 1024 (the default) now, since that works correctly for all the calculations.

>2. Sunshafts... new...

Cool, looking forward to them!

>3. Film grain and Vignette filter.

Ahh well... if you're not too excited about them, then don't bother. :P

>4. FXAA...

Yeah, was just a suggestion... since there's already an AA option. I don't think it's an FXAA algorithm, though. I can do FXAA through dll injection... but then I lose vsync, since I have to us D3Doverrider for that. I can force MLAA through my drivers, but then I get a weird border around my screen. sux2bme I guess.

Reply Good karma Bad karma+2 votes
Meltac Author

Ok, thanks again for your tweaks! Downloaded everything you posted and will check as soon as I get a chance to (don't have plenty of time atm). If they work for me and others as well, they'd be some cool refinements for V2.0 I guess :-) Sure I'd add credits to you, of course.

>3 I'd be excited to make those filters if I had an idea in what situations to apply them ;-)

>4 Yeah I meant that FXAA dll injection thing. Works great for me, independently from my shaders. MLAA would be another option to apply as dll injection or something. the "integrated" AA option is purely fake and not FXAA or anything. Leave it disabled by default. It's the same as the r2_aa_ settings.

Reply Good karma+2 votes

Hey, I solved the custom shadow resolution problem.

I dare say, that no one has been using high resolution shadows... this bug goes back to the code in Shaders Max.

There's a hardcoded definition (KERNEL and XKERNEL) which must be increased as you increase the custom resolution shadowmap size. They were at .6 by default... which is fine for 1024x1024...

So, anyways... problem solved. I kinda lost track of which files were modified at this point, so here's my zipped up shader folder:


^ High res shadows working

I tweaked the SSAO algorithm, but I kinda gave up on it... it looks pretty awesome when at about 32+ samples (~5+ loop iterations... 8 is sweet!)... but it overheats the shader unit on my card eventually. I'll have to take my gpu apart to fix it (stupid stock cooling).

Regarding the filters I mentioned... Well, film grain would be on all the time ala Mass Effect. :D It's actually a poor man's substitute for AA, but I also happen to love the effect. It's just a noise filter.

Vignette... When? ALL THE TIME :D It just darkens the edges of the screen, so it looks more cinematic. It's a subtle effect. That should be pretty easy... I could do it myself (and I'm not a shader guru like you), so don't worry about it. If I want it bad enough, I'll just do it. ;)

SUGGESTION: Add a forum here for this mod. :P

Reply Good karma Bad karma+2 votes

Also... I have no idea why KERNEL should be .6 per 1024 res, or even that's the perfectly correct value... It could be 1 for all I know... or .68378. But, at least it's configurable in shadersettings.txt now.

BTW: Your jitter code in shadowtest_sun and shadowtest used a hardcoded magic number of 2.0 and 2.7 for it. ;) Made things particularly tricky for me to track down, heh. That was close to the 2.4 I think they should be at 4096 shadow res.

Reply Good karma Bad karma+2 votes

Also... haha I wish there was a forum...

I think farnearlerp was an attempt to correct the sunshafts problem at the far/near boundary. My fix just turns it off after that boundary line, and so you have to increase the contrast to hide the lack brightness added by ss_intensity. But it's just a hack.

I may take another look at it and get it working properly.

Reply Good karma Bad karma+2 votes
Meltac Author

I see you're still not done with my shaders ;-)

Cool you find so much tweaks to apply. I am NOT a shader guru, not at all. I'm just a little graphics addicted who tries to incorporate some new cool features into the existing shaders. Actually I wouldn't ever have found those tweaks you made. So I'm glad you provide some hand here.

As for your suggestion to have a forum here, that's the idea of the comments section on the main page (aka "Summary") of this moddb site, right? If not, we're still having the discussion thread on GSC forums which used to be very active at some times:


As for shadow jittering, that's not my code. It's already been part of Shaders MAX. To my knowledge it originally comes from LURK. I know it's buggy, that's why I always used to leave it disabled by default - although I wished to have some jittered shadows, of course! So if you can tweak that code a little to make it "useful" and working fluently in combination with the other features (which wasn't the case until now), that would be great!

Regarding filters, feel free to add your own stuff if you like and you know how to do it. Just make them configurable or at least allow to disable them. Come back to me if you'll get stuck, I may be able to do those filters if yours won't come to work properly (I have some experience with programming filters, actually most of my new features just are filters...).


Reply Good karma+2 votes

> I see you're still not done with my shaders ;-)

I can't seem to leave well enough alone. ;)

> As for shadow jittering, that's not my code. It's already been part of Shaders MAX. To my knowledge it originally comes from LURK. I know it's buggy, that's why I always used to leave it disabled by default...

Shadow jittering works perfectly now -- Especially at higher shadow res. Overall, it looks better than the tweak I made for 16 shadowing passes. Try it out! :D

> Regarding filters, feel free to add your own stuff...

I'll probably end up doing the Vignette and FXAA anti-aliasing. I have the code for it, I just need to stick it in there. ;)

Reply Good karma Bad karma+2 votes
Meltac Author

Ok, I'll check out the shadow jittering. And I'm looking forward to your upcoming tweaks ;-)

Reply Good karma+2 votes
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Report Profile
S.T.A.L.K.E.R. Shadow of Chernobyl
Send Message
Release date
Mod watch
Related Games
S.T.A.L.K.E.R. Shadow of Chernobyl
S.T.A.L.K.E.R. Shadow of Chernobyl First Person Shooter