ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
[REL] Dynamic Shaders

« Previous 10 events | 1 2 3 4 5 6 7 ... 32 | Next 10 events »
Posted by/on
Question/AnswerMake Oldest Up Sort by Ascending
  10:53:43  12 May 2014
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
Messages: 1519

---QUOTATION---
The "deal breaker" for myself with the current sun shafts is the fact that they disappear if you face away from them. Looking at the code, the "artificial sun position" which I assume is the calculation of the theoretical sun position once it has left screen space in order to continue rendering the shafts. This code seems to need some work, however without knowing the engine variables that relate to this, and what values they contain I can't do much. I would just start looking through the SDK, but that will take too much time, which I don't have spare.
---END QUOTATION---



You are right about it being weird to have the shafts disappear when not facing the sun. Whether that could be fixed with the given approach I cannot say, mainly because the algorithmic approach does not come from my own feather, but if you'd manage to change this behavior that would certainly be a very helpful contribution to the mod.

As for the engine variables there is actually not too much explanation possible here. First of all there is to my knowledge no API documentation or wiki (at least no non-russian one ), and there are not many (again, non-russian) modders having deep knowledge about that part of X-Ray. I had to learn most of these things by deep-diving into the existing shader files and simply try-and-error'ing things, what as you say can be quite time-consuming. What I can is that there are only very few engine variables being used in that file, basically only the world sun direction. All the rest are local variables. And note that the artificial sun position is not what you are assuming, it's actually not even used anymore and can be considered a code artifact.
  01:42:26  12 May 2014
profilee-mailreply Message URLTo the Top
templargfx
(Novice)
 
On forum: 05/08/2014
Messages: 28

---QUOTATION---
Hi again templargfx! Thanks for your testing and reporting feedback.

The behavior you describe is well known. Do you by chance have background knowledge on how those sun shafts are being created? They are purely a screen-space effect and therefore not caused by volumetric light as it is the case in more recent engines and games. Basically you can consider them a fake effect for something that would be extremely hard to achieve in a well-performing way on the given engine (without modifying the engine binaries themselves).

For being a pure screen-space effect (post-process) it's impossible for those shafts to behave absolutely realistic. Unintended side-effects as those you are describing are expectable artifacts of faking real volumetric light. Basically the way the sun shafts are implemented they will never look absolutely realistic, that's the cost of making them working at all on this fairly dated engine.

Nonetheless improvements are still possible with with the given approach. I've incorporated already a few additions making the overall result look both nicer and more authentic. If you figure out further refinements or algorithmic tweaks I'd be eager to hear them
---END QUOTATION---



The "deal breaker" for myself with the current sun shafts is the fact that they disappear if you face away from them. Looking at the code, the "artificial sun position" which I assume is the calculation of the theoretical sun position once it has left screen space in order to continue rendering the shafts. This code seems to need some work, however without knowing the engine variables that relate to this, and what values they contain I can't do much. I would just start looking through the SDK, but that will take too much time, which I don't have spare.
  22:42:26  11 May 2014
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
05/11/2014 22:43:44
Messages: 1519
Hi again templargfx! Thanks for your testing and reporting feedback.

The behavior you describe is well known. Do you by chance have background knowledge on how those sun shafts are being created? They are purely a screen-space effect and therefore not caused by volumetric light as it is the case in more recent engines and games. Basically you can consider them a fake effect for something that would be extremely hard to achieve in a well-performing way on the given engine (without modifying the engine binaries themselves).

For being a pure screen-space effect (post-process) it's impossible for those shafts to behave absolutely realistic. Unintended side-effects as those you are describing are expectable artifacts of faking real volumetric light. Basically the way the sun shafts are implemented they will never look absolutely realistic, that's the cost of making them working at all on this fairly dated engine.

Nonetheless improvements are still possible with with the given approach. I've incorporated already a few additions making the overall result look both nicer and more authentic. If you figure out further refinements or algorithmic tweaks I'd be eager to hear them
  06:07:54  11 May 2014
profilee-mailreply Message URLTo the Top
templargfx
(Novice)
 
On forum: 05/08/2014
Messages: 28
Hi Meltac,

So I have been messing with your shaders, and it looks like there may be a mathmatical error in the sun position calculation for Sun Shafts when the sun is off screen. It works really well with the sun on screen, but as soon as the sun leaves the screen space, things go a little wonky :

World objects intersecting with the screen edge block sun shafts, when normally they would not
Sun Shafts stop rendering all together when the sun is behind you (may be an engine limitation? Culling?)
When the sun is just off screen space, but still rendering shafts, things go particularly haywire, with shafts either "shattering" (no longer uniform) or covering the entire screen. Slightest of viewing angle changes in this situation causes massive changes to the sun shafts.


I am trying to wrap my head around the code to work on it myself, but I am usure of the engine variables, and which are custom variables. Is there a wiki link to the "global" variables set by the engine. Especially in regards to sun position?
  11:04:52  9 May 2014
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
05/09/2014 11:05:19
Messages: 1519
Thanks - meanwhile I had found that download thread myself

I have just sent you an email regarding your improvements. Let me know.
  11:00:18  9 May 2014
profilee-mailreply Message URLTo the Top
templargfx
(Novice)
 
On forum: 05/08/2014
 

Message edited by:
templargfx
05/09/2014 11:01:12
Messages: 28

---QUOTATION---
Hi templargfx,

Thanks for the suggestions! I will have a look at them in detail when I have more time.

Could you please send me the files you changed by email or upload them somewhere? Thanks.
---END QUOTATION---



Hi Meltac!

Here you go :

https://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr&thm_page=1&thm_id=22802&sec_id=17

The files I modified are :

shader_control.script (to forcibly set r2_sun_lumscale settings)
shadersettings.txt (I added some comments and tweaked values all over the place)
combine_2_naa.ps (changed the myMaxnear assignment)
shadow.h (added variables in place of hardcoded scale for shadow_test() and shadow_test_sun() )
  10:08:03  9 May 2014
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
05/09/2014 10:08:34
Messages: 1519
Hi templargfx,

Thanks for the suggestions! I will have a look at them in detail when I have more time.

Could you please send me the files you changed by email or upload them somewhere? Thanks.
  04:23:33  9 May 2014
profilee-mailreply Message URLTo the Top
templargfx
(Novice)
 
On forum: 05/08/2014
 

Message edited by:
templargfx
05/09/2014 4:32:26
Messages: 28
Hi Meltac,

I have a suggestion for your shaders, in particular the DDOF setup in combine_2_naa.ps

Currently you have :

float myMAXNEAR = MAXNEAR;

MAXNEAR controls the blurring of the weapon and hands and effects the game even with DDOF turned off (its just constant). However if you use DDOF, you cannot increase this value any real amount as you get a doubling up of near DOF blurring. the constant blurring and the DDOF blurring ontop.

To resolve this, I changed it to use the DDOF_MAXBARRIER value which now allows me to set MAXNEAR to 0 (completely removing the non DDOF near blur) and allow DDOF to control the weapon blur by itself without interference from the non DDOF blur.


ALSO, with parallax mapping, I have found the following settings produce MUCH better looking mapping than those you include :

MAX_SAMPLES 30
MIN_SAMPLES 10
OFFSET 0.022
FINAL_INTERSECTION_LOOPS 10
Reducing the max samples lowered the amount of "prickles" while increasing intersection loops smoothed out the end result


BRIGHTNESS_COEF 0.43
Considering you are cutting everything off below 0.6 contrast value I equalized the map so that 128,128,128 grey is firmly between the two cut off values. this gives more detail to the mapping. This is standard practice when using displacement mapping (the heavy version of parallax mapping) in 3D rendering applications.
  00:19:59  9 May 2014
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
 

Message edited by:
Meltac
05/09/2014 0:22:10
Messages: 1519
No problem, and many thanks for the compliments.

(and yes, family days are important and should have higher priority than modding )

The error you are encountering can be caused by different things:

1. You have tried to merge or modify shaders and made an error.
2. The other mod uses a shaders.xr (or similar) file which is not compatible with DS.
3. You are running some modded binaries or DirectX files incompatible with DS.

In all those cases merging might be problematic and it might be much easier to leave the other mod's original shaders as a base and merge in only those specific features from DS that you most like.

Cheers
  18:31:12  8 May 2014
profilee-mailreply Message URLTo the Top
olivius74
Senior Resident
 

 
On forum: 11/19/2010
 

Message edited by:
olivius74
05/08/2014 19:45:19
Messages: 1975
Oh,thank you very much Meltac to take the time to answer me!
So great!


I just returned now (it was family day, today )

So I test tonight and tell you what happened.

Thank you for everything and for you help as always.

Best Regards Sir!


EDIT :

So,actually,error script was fixed ,many thank's!
Crash before was about level weather script ,because I don't know how the merge the file correctly.
So ,has you said me,I left the original file and tested the 4 others different scripts.

The game launches now , but stop at loading shaders

With the 4 scripts files, each time the same error :

Expression : An undetermined error occurred
Function : CResourceManager::_CreateVS
File : E:\stalker\sources\trunk\xr_3da\ResourceManager_Resources.cpp
Line : 232
Description : _hr

So now ,question script is ok ,think I need merge shaders for this mod
and it will another matter.
Remember using ShaderEditor and need many times!

I don't waste your time anymore,sincerely thanks for your awesome mod which as incredible news features!A must!
It's for that I want definitly use it in each mod I try!

And thank again infinitly for everything you do Meltac !
Fantastic work !
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2020 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.