I'm sorry but I've run out of patience. Your idiotic spiel is poisonous to the community.
Your so-called analysis is flawed, and the difference in Geralt's shadow and the near shadows is because of two things:
1. Geralt's position changes each time you load the same save
2. The building shadows are a couple of frames ahead or behind the other, because I have to spam the Select button to enter the menu as fast as possible upon save load.
How can I fail to see something when that's
exactly what I was showing it for? Maybe you failed to read.
CHANGING CASCADE 2 FROM "1.5" TO "4" DOES EXACTLY WHAT I SAID IT WOULD! THAT SHADOW THAT GETS BLURRY? GUESS WHAT. IT'S CASCADE 2. OBVIOUSLY CHANGING CASCADE 2 FROM 1.5 TO 4 WILL MAKE IT BLURRY. It is doing so because it's spreading Cascade 2 over a larger distance. And yet you keep refuting this point.
And, AS I CORRECTLY PREDICTED, going from 1/1/4/4 to 1/4/4/4 extends shadow cascade 1 to cover the building which is why the shadow goes from blurry to sharp again:
1/1/4/4
1/4/4/4
Because Cascade 1, which is always rendered at a FIXED RESOLUTION (based on the max size you have set in the INI), and is much higher resolution than cascade 2, is stretched to cover the building when you change Cascade 1 from 1 to 4.
And do you know how I know the building is covered by cascade 2 in the first image?? Because if you change it to 0, the building shadow will disappear:
1/1/0/0
So please tell me how one can be wrong when they predict something will do exactly as they said it would. Let's take a minute to point out something you said in your post:
Immediately proved to me that you have no understanding of the system.
Since your entire predication is that since I changed Cascade 2 scale, that this made Cascade 1 blurry. Well that house shadow is Cascade 2, and I made Cascade 2 blurry because I increased the distance it covers in game. How are you not understanding this?
If you change cascade 1 to 0, you will see just how small cascade 1 is (compare to 1/1/0/0 image):
1/0/0/0
So, you somehow keep refuting the idea that increasing the cascade scale stretches out the cascade over a larger distance, let's show that's incorrect:
2/0/0/0
4/0/0/0
You can see that 1/1/0/0 is roughly the same as 4/0/0/0 ... Why is that? Because it would appear that Cascade 1 is about 3x the size of Cascade 0. So, 1 * 1 + 3 * 1 = 4 vs 4 * 1 + 0 * 1 = 4.
I'd honestly like to see you try at this point. I cannot believe someone can be so RUDE, while being so incredibly wrong about everything they are saying. You are abrasive, self-aggrandizing, and you are not helpful to this community.
Because like I said, all of your predicating points were incorrect. So how could I trust the rest of the post which these predications were based on? You said very basic statements that proved you don't have an understanding of the cascade system in this game. So what sense is there in looking at all of your pointless math?
Honestly, I'm detecting a language barrier here. Everything I've said so far has been correct, yet you are managing to somehow avoid the important details that show that nothing I've said is wrong. But also I think you started out with the idea that you are correct in everything you do, so it doesn't compute with you. I'd almost tend to think we're arguing over nothing and that we both have an understanding of how the system works, yet you don't know English well enough to understand the words I'm writing down. On the reverse side, literally nothing you said made sense to me even though I have a deep understanding of how the system works (sorry for not showing 3000 pictures showing every single thing I understand by the way. You keep telling me I don't know things because I didn't show them which is a logical fallacy). So it's difficult to explain away how you have said things that are simply not true.
-----
Anyway, I've run out of energy arguing with you. You're rude and abrasive and clearly incapable of any kind of intelligible debate.
I wonder, since when "we are not rivals, we are partners here, lets not fight become RUDE and things like you said ""stopped reading at ... Your idiotic spiel" and rest of your insulting tone stopped to be rude? Did someone swapped definition of word rude once i was busy and have not visisited forums?
Your behavior and tone is what really poisonous here.
Anyway, not like you im not going to waste my time on personal atacks, lets talk business, and dont waste energy, im imune to your poison.
After that i have checked everything, and im sorry but i have to dissapoint you again! None of us was completely right and non of us was completely wrong.
I know pretty well how cascade shadow works, but like i said many times, each implementation is different, so i relied on observation of how shadows behaved in my game, rather than how generic implementation of cascade shadows works.
My observations was mostly correct (NOTE - OBSERVATION is not equal to technology), i even recorded video for you to prove you wrong, but then when i prepare my edge mod for release i notticed cause of such a weird shadow behavior... it was a bug in my mod, when i copy pasted line with of code with one cascade to make slider for 4 of them i simply messed up suffixes with numbers in the end of cvars, so it happened that cascade 0 value was affected by cascade 1+ sliders, and this is what i observed which made me believe that all cascades packed in single shadow map with split space.
I was wrong about it, fixed that bug and started to observe correct.
But i still was right about settings i recommended and you recommendation was wrong. ALso you was wrong about distance "cascades" kicks in. I was right about distance but only for cascade 0, i was wrong about other cascades distance scaling, i just assumed they all use same scaling and behavior while in fact they all behave very different and behavior of each cascade happened to be inconsistent;
So cascade scaling is no really about distance of how further shadows will cast, and cascades does not kick in at some fixed distance as you assumed.
Scaling is seems to be a scale of invisible square - a shadow occluder that stands between camera or geralt and sun or moon.
Each of cascades (except for 3 but i need to re-chck, that was 2 weeks ago last time i test it) kicks in at same distance - center of player position.
You can turn of cascade 0, 1, and left only 2 and you will still see shadows covering everything, just a low res, i disable each cascade and that is 100% correct this time. So scaled does not afffect where it scarts like was thinking, it only affects where it ends.
It seems like cascade occluders aligned at fixed distance relative to each other, and they aligned in line like this
Sun > 3 > 2 > 1 > 0 > Player
Since 3 closer to sun and 0 farer, even when you set every of them to equal values such as 1 or 2 or 4 or 10, which means square size is same, sloses to sun cast shadows to bigger area, and far one to little area.
Cascade shape and is fully sun position based and does not take camera rotation to account t, a vector between sun and player used to aliign shadow direction, so at 12:00 you will have sun right above you and cascade would be square enoguh, and at 18 at dusk square turns into long shadow. In other games, for example GTA, cascade shape is always fixed and aligned to camera pow,
This is the best place to spot occluder and how it affects shadow (only cascade 0 is enabled here):
And these are cascades 0, 1, 2 enabled 1 after another (dont remember exact value, i think i used 1 or even 0.5)
0
1
2
You can notice here that shadow of ship casted beyond cascade square on ground, since this object stand on a way between ground and occluder square.
Scaling of each cascade does same thing, you can see how square of occluder grows, so it dont think it really sets the distance, and depending on angle of sun distance may go higher and lower.
Average distance for cascade 0 was almost correct last time i spoke about it, now i know that its variable so its not exact value, Cascade0 value of 1 is close to 10 in game steps (you know steps that shown near minimap, i used it as ruler for distance measurement), for cascade 1+ its harder to tell,
Inner cascade always beats outer cascade if they cover same area.
As for size, im not really convinced by your assumptions that each next cascade used half resolution of previous, you still failed to prove that fact, and that would make much less sense that packing all shadows to one atlas as i assumed (and to clarify things, when you said "it makes no sense" you was wrong, Crytek has different opinion
http://www.realtimeshadows.com/sites/default/files/Playing with Real-Time Shadows_0.pdf they say packing all shadows to same texture is good idea to avoid memory fragmentation, and to increase render speed by making less of draw calls by using single texture, this article explains well benefits of texture atlases
http://blog.wolfire.com/2010/03/Using-texture-atlases , also look at page 63, this is how good cascade shadows should work and this is not exactly how they work in witcher 3), and judging by how i can clearly see shape of trees at Kaer Morhem intro at far distance, i suppose that each cascade has same resolution, since cascade needs to cover bigger area and each object will already start to cast less detailed shadows making resolution of cascade lower will totally destroy distant shadows and will turm them into blury mess. This is where we both was wrong - my idea of using space of same texture and your idea of using half res both are flawed, our ideas both totally destroys shadows at distance, while same high resolution for shadows will compensate large scale.
Now I really think that resolution you set for cascade shadows is used for each cascade, at least this is looks like that when you disable cascade 0 and 2 and look at 1 which seems not such a less detailed comparing ot 0.
As for performance, the only think that really affects performance is resolution of cascade, i played with values of cascade 0 between 1 and 20, and have not seen any major difference in FPS (usual fluctation in a range of 1-2 fps, im not even sure its related to shadows), same goes to cascade 1 2 and 3.
I can 100% asure you that CHANGE OF SHADOW CASCADE SCALE DOES NOT AFFECT PERFORMANCE!
Its pretty much SAFE TO SET CASCADE SCALE AS HIGH AS ANYONE WANTS until resolution of shadow remains the same.
The only thing that really affected by cascade shadow scale is quality of shadow, so if you want shadows to render far more, you always trade off their quallity, and once you do that, you have to compensate by setting higher resolution.
Shadow resolution of 4096 is not perfromance hit, actually its good compromise between quality and distance. i play with it on my GTX 680 with 30-45 fps and everything but grass set on ultra (plus even further tweaks for quality). 8192 is not overkill like you tend to say, but its starting to hit performance a little, but 4096 is safe minimum everyone (with more or less modern and not low budget PC ofcourse) should stick to.
My old recommended settings remains the same.
All small details of objects cast shadows only at cascade 0, if you will not set cascade 0 high enough, you will see a lot of annoying shadow pop-ins at close distance.
You say 8 is maximum (well at least you accepted my value and gone from that low reanges of 2-4) i say its a minimum to eliminate shadow pop-ins and make small objects cast shadow at reasonable distance. Setting 10, 12 and maybe 16 (about 160 in-game steps) is good idea to make small shadows disappear at distance where we cant see them and to get rid of visible seams between cascades. But setting it higher as 8-10 will make resolution of 4096 not enough to sustain good level of details so for 16 its really a good idea to set something higher like 8196 and reduce by 256-512 each step until good balance in case of performance.
So, this is still the best preset for best shadows in a game:
Code:
CascadeShadowDistanceScale0=16
CascadeShadowDistanceScale1=8
CascadeShadowDistanceScale2=4
CascadeShadowDistanceScale3=2
CascadeShadowmapSize=8192
And this is sitll good balance between performance and quality.
Code:
CascadeShadowDistanceScale0=8
CascadeShadowDistanceScale1=6
CascadeShadowDistanceScale2=4
CascadeShadowDistanceScale3=2
CascadeShadowmapSize=4096
I will repeat again - scaling is cheap for performance, people should not be afraid to set it high, your suggestions are incorrect, you afraid to rise values like your
computer will explode and with your scare you scaring people and making them afraid of setting higher values, now this is really poisonous.
Shadow resolution give some performance hit, but not as much as you think, 4096 is pretty cheap for any PC with CPU and GPU of high class released in last 4 years (basically anything better than xbox one hardware for which game was axed and set up), going higher by 256-512 step up to 8192 until performance hit will start to be notticable is best practice to achieve really good looking shadows.
As for VRAM shadow takes, 1024x1024 shadow map takes exactly 4 mb (dont trust me? ask Crytek in PDF i posted above)
1024*1024=1*048*576 pixels takes 4 mb
1*048*576 pixels /4 m=262*144 pixels take 1 mb
now if we want to calculate how much of vram 4096 shadow map will take - 4096*4096=16 777 216 pixels
16 777 216/262*144=64 mb not much, in case we have full resolution of each cascade it would tak 64*4=256 mb of VRAM.
Now lets do same thing for 8192*8192=67*108*864
67*108*864/262 144=256 for single cascade and 1024 for them all (yet again in case they use full resolution, we dont have any prove if they are half sized for each cascade as you think, my mistake about scaling was at least caused by bug in mod, your mistake just a blind guess)
Formula is Memory in MB = (X-Resolution * Y-Resolution * Bits-Per-Pixel) / (8 * 1024*1024), and i assume 32 bit shadow buffer, it could be 16, in this case everything will be just twice lower.
Yep, i admit my mistake that was caused by same cvar for all 4 cascade in my mod, but after i fixed it i have observed how it really works and key point (values for good shadows), does not change, and now i corrected mistakes of both of us. I wonder if you can admit your mistakes after this.
And just to put the end to dispute i illustrated (picture is not precise, just a quick scetch), how exactly cascade shadows projected in Witcher 3.
Scematic:
More like it looks in game (had no time to draw 4 of them, just 2 will)
At this example cascade 0 with scale 1.5 is equal to cascade 1 with 1 scale. ITs possible that cascade occluders are of differen base size and aligned at same distance, so whats shown here as cascade 1 scale 1 is actually a cascade 0 scale 1, and cascade 1 scale 2 is actually cascade 1 scale 1, both ways are possible, becaure results are equal as example showsm but i think they use version same scale at different distances, anway method is not importand since results are same, Its not 100% clear is cascade scale controls size of cascade occluder or distance between player model'sun and occluder, but yet again its not important since you can ged same results by moving square of same size or by scaling its size.
Technique they use not optimal, the most ugly thing about it are how square occluder cast long shadows at certain angles, and how inconsistent shape of shadow and area its cover , but at least it proves that cascade scale does not affect distance direcly and that distance different for different situations (which is why, in addition to my mod bug we observed different behavior). Also it causing bad effect of narrow fixed cascade which does not cover area you see when you turn, since cascade does not turn and align for camera (and i saw many games when it was done like that, actually any Cry engine powered game uses such correction and you dont see fixed narrow shape of cascades there.
This sceme shows problem with inconsistem cascade shape and distance
You turn camera 90 degrees and boom, distance of cascade suddenly appears to be way shorter and you can clearly see direction of sun light by looking at cascade edges.
And yet again, to compensate this ugly effect you have to set cascade 0 high enough so that ugly edge would be as far from your eyes as possible, and distance of about 40 steps which is value of 4 is not enough to cover this edge, distance of 80 which is 8 is good enough to make it almost invisible, and distance like 100-120-160 10-12-16 is almost perfect.
Btw, illustration above shows that you can actually set cascade 0 to cover are higher than cascade 1 and next (except for 3, its behavior is different) so this means cascade 1 and 2 not very important, you can set high cascade 0, low 1 and 2, and mid cascade 3, so that cascade 0 may happen to transit directly to cascade 3 and disallowing cascade 1 and 2 to show up, which in case of high shadow resolution could give better looking distant shadows with all the little details rendered (which are ignored at cascade 1 and 2) far enough to eliminate shadow detail pop-ins and skipped shadows of some elements of world.
Seriously, dont argue, just set cascade0 to 8-16 until it will be rendered up to 100-150 meters, set shadow resolution 4096-8192set each of following cascades twice lower than previos (except for last, never set anything lower than 2 for cascade 3). and see how many shadow details will appear in world that you and anybody who listened your suggestions missed, and also see how that does not affectt performance as mush as you was afraid it would do.
And dont forget to set cascade quallity to 1+ to improve filtering..
The only thing i still did not figured out is treshold, in theory it should give better results with values lower than 1, and worse results with values higher than 1, i but still dont get what exactly it does, it could be something related to fade out effects of edges of each cascade, but im not really sure about that, so i keep it at default 1.0, since cascade 0 with 8+ value is high enough to make this transition so distant so you would not care about it.
Upd: wow, i just re-read my post, so many typos, sorry i was really sleepy when wrote this at night.