Jump to content

A "psychic" shader mod; development begins...


DanW58
 Share

Recommended Posts

On 27/02/2021 at 7:50 AM, DanW58 said:

If there's any problems, shader not compiling, whatever, please report it to this thread.  You may need to turn all the graphics options to maximum;  I haven't even tested it non-maxed-out.

I get this error on the map "oceanside":

image.png.299766459df1137f5a488c27ddeea32e.png

screenshot0109.thumb.png.74f5d556030691a9456116889ea8a24d.png

This is with GLSL disabled:

screenshot0111.thumb.png.de026c0b6117e443dace926d0d12098f.png

Did I do something wrong? Apart from that, thanks, everything else is looking really nice:)

Link to comment
Share on other sites

4 minutes ago, DanW58 said:

Thanks;  I think I can fix that;  give me half hour or so.

Nice, just found out that it's working with my other graphic card, but not with the onboard graphic, idk if that's helpful

but then I get this with my the other with my external gpu:

screenshot0112.thumb.png.62b8067722506346c9323a0f271fa412.png

Link to comment
Share on other sites

No, it's my bug.  There's swizzling operators, in glsl, like for 2, 3, 4-component vectors, you can write

A = B.rgba or A= B.xyzw or A = B.stpg,

for color, dimension or texture coordinates respectively.  They all mean the same thing, but you cannot mix them, by the strict rules of glsl language, thus  A = B.rgzw is illegal, but not every vendor enforces the rule.

 

Link to comment
Share on other sites

@nifa

Okay, here's the metal shader set version 0.1.1:  (fingers crossed)

Unfortunately, I don't get the problem so I can't tell if it is solved until you tell me.

The "out of memory" error is worrisome...  Not sure what that's about.

And the second problem I don't understand.

metal_shader_set_v1.1.pyromod

Edited by DanW58
Link to comment
Share on other sites

Thank you for your fast reply, the water is back:) but there now is quite a different between with and without GLSL, is that how it should be?

Spoiler

screenshot0116.thumb.png.86e0176526beab68455926fdbdfb97cf.pngscreenshot0117.thumb.png.393204092a4ab0433ac749c22d5743c6.png

 

Spoiler

screenshot0119.thumb.png.134220e55642078ff25d94006eaf0f10.pngscreenshot0118.thumb.png.f078bb2e2642c18977877559ab995a81.png

 

Quote

Sorry, when I said all graphics maxed out I wasn't thinking about FSAA and sharpening.  I have sharpening disabled, and MSAA at (4x).

(FSAA 16x may have been the cause of the out of memory)

Yes, I think so too, especially in combination with high quality shadows

Edited by nifa
Link to comment
Share on other sites

1 hour ago, nifa said:

Thank you for your fast reply, the water is back:) but there now is quite a different between with and without GLSL, is that how it should be?

I have no idea what it looks like without glsl, and frankly ...  I mean, the old OpenGL pipeline all it can do for water as far as I know is alpha-blend.

Anyways,  I just implemented the true Fresnel formula from Wikipedia, and got rid of Schlick's approximation, so it looks different yet again, but better.  Now I have new bugs with my coastal wet look darkening hack;  doesn't want to work anymore.  I will post a new pyromod when I get it to work.

Link to comment
Share on other sites

DONE!

The water shader now uses TRUE fresnel for reflection and refraction coefficients.  This is the Fresnel formula from Wikipedia;  no approximations;  no hacks.  And it works!  :banana:

Updated also the Phabricator water_patch:

https://code.wildfiregames.com/D3603

 

realfresnelwater.jpg

realfresnelwater2.jpg

realfresnelwater3.jpg

metal_shader_set_v1.2.pyromod

Edited by DanW58
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Did you also take look at how the refractions are calculated? Given that the fesenel effect has a connection with the snelius law it could be an opportunity have thta effect also physically correct (if they aren't already).

Big kuddos on the results!

Link to comment
Share on other sites

ROTFLMAO!

That is EXACTLY what I just finished doing.  I found that the original shader had no light computations onto the ocean bottom, or floor under the water.  It is as if it was emissive.  Needless to say the light was not modulated by the fresnel refraction factor.  So I put that in, but then I forgot that on coming out of the water, there's another fresnel refraction factor to account for.  I just added it.

However, the two are not the same:  One is calculated on the light vector angle to the water;  the other is calculated on the view angle to the water.  Right now I have the same fresnel refraction factor used twice.  Have to fix that.

And I also have an idea that might improve my wet coasts algorithm;  a crazy idea, have to try it.  So expect a version 1.3 by tomorrow morning.

Edited by DanW58
  • Like 1
Link to comment
Share on other sites

Coming soon;  next half hour;  but the difference is very subtle.  I notice because I know what to look for.  Bottoms of water bodies were getting too much sunlight for sun positions close to the horizon.  Water's fresnel reflectivity is high at shallow angles, and so sunlight should not be able to penetrate as much as it did.  Now the amount of light the bottoms get is exactly right.  I'll post soon;  like 15 minutes.

Link to comment
Share on other sites

Version 1.3 is here.

Fixes issues with Fresnel refraction factors with light going into the water, and with light coming out:  e.g., when the Sun is low, very little sunlight should be able to enter the water, most of it reflecting back up instead;  therefore bottoms of water bodies should darken faster than by mere ray-dot-normal.  The light reflecting off the bottom and coming back out again is modulated by fresnel refraction, except in this case it is calculated by eye-view vector angle, rather than the Sun's angle.  Particularly noticeable in the second picture below:  The shadows of the floating leaves are not too dark.  Why?  Because sunlight is attenuated by Fresnel, and so most of the light the bottom gets, with the Sun so low near the horizon, is bluish light from the sky, rather.

The wet coast hack looks a bit better now.  Modulating water's specularity linearly over a couple of yards is a noticeable artifact, really.  I now modulate water's index of refraction, instead, as I fade in bottom darkness.  The way it works is it darkens the bottom early (as if we are walking towards the water), but water's reflectivity (and foam) fade in more slowly.

If you have any problems with the mod, try maxing out settings like "number of shaders" and most graphics quality options, EXCEPT sharpening and MSAA.  I keep MSAA at (4x);  good enough for me.  And be sure to report here.  And if you have nice screenshots to share, don't hesitate.

 

realfresnelwater5.jpg

realfresnelwater6.jpg

realfresnelwater7.jpg

realfresnelwater8.jpg

realfresnelwater9.jpg

realfresnelwater10.jpg

realfresnelwater11.jpg

realfresnelwater12.jpg

 

metal_shader_set_v1.3.pyromod

Edited by DanW58
  • Like 3
  • Thanks 2
Link to comment
Share on other sites

@gameboy Maybe I will do better;  but it's no reason to wait. Enjoy the present moment. :D

I got disconnected from the Internet last night;  something to do with an unpaid bill ...  Unbelievable how obsessed with money most vendors are ...  :rolleyes:

There may yet be a version 1.4;  I'm not sure.  I want to get rid of white skins.  No, I'm not into white-bashing;  I'm white myself;  I mean completely white (or very nearly completely white) color in diffuse to try and represent human skin.  Some civs have good looking skins, like Ptolemies for example;  but many are so white they look like porcelain;  like the blood has been sucked out of them.

The problem is that my skin-detection hack is too encompassing, and lots of things detect as skin that shouldn't, including wheat fields, roofs and walls.  So the problem is not fixing zombie skin;  the problem is seeing zombies everywhere ...

Edited by DanW58
Link to comment
Share on other sites

I just checked the video stats in Youtube;  13 views so far;  average view time 2 minutes and 3 seconds.

That's less than half the video.

So most people click away before getting to half of the video.

I frankly don't understand this community.

This is a waste of my time like no other.

Edited by DanW58
  • Haha 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...