Jump to content

Recommended Posts

Hi gang,
one of the reasons I sort of stopped caring for the series couple of years back and went my way of not flying combat flight sims was plethora of controversial movements by TK around 2010-2013 period -followed by lack of QOL updates and Thirdwire's focus on mobile market that followed;
one of these design decisions was locking clouds altitudes at unrealistic and immersion killing levels of over 14-16k feet ASL which made game less of a fun or challenge
turns out solution was very simple hack of vertex shader in ENVCLOUDS.FX which you will find attached in this post, just drop it into your mod's Flight folder, overwrite if asked
tested with stock clouds, SARCASM 1.5 and excellent Menrva's realSKY Environment -which I am looking at modding a bit on my end

technical blurb:
this is simple vertex shader hack that pushes the vertices of clouds plane meshes downwards in world space by user-configurable value:
const float4 P = mul(float4(input.pos.x,input.pos.y,input.pos.z - 1900, 1.0), g_mMeshToWorld);    // position, world-space

where 1900 is world-space units (= meters), all the hack does is feeds the shader skewed z (z being height in SF series, as things should be) value

of course there are some issues with intersecting with close range terrain meshes (near_scene) so visual glitches might ensue at times but that was the reason TK pushed them up in the first place
Also, if this or other method was posted earlier apologies, haven't looked around much the forums.

Cheers,
Stary

ENVCLOUDS.FX

img00128.jpg

img00107.jpg

img00123.jpg

  • Like 7
  • Thanks 7

Share this post


Link to post
Share on other sites

Posted (edited)
28 minutes ago, Stary said:

Hi gang,
one of the reasons I sort of stopped caring for the series couple of years back and went my way of not flying combat flight sims was plethora of controversial movements by TK around 2010-2013 period -followed by lack of QOL updates and Thirdwire's focus on mobile market that followed;
one of these design decisions was locking clouds altitudes at unrealistic and immersion killing levels of over 14-16k feet ASL which made game less of a fun or challenge
turns out solution was very simple hack of vertex shader in ENVCLOUDS.FX which you will find attached in this post, just drop it into your mod's Flight folder, overwrite if asked

I'm so thrilled to see you, Stary! Thank you so much for this fix, indeed something can be accomplished by editing shaders; I made a slightly modified shader for changing in-game text color which is hardcoded for subtitles, it's included in ODS 30AE.

28 minutes ago, Stary said:

excellent Menrva's realSKY Environment -which I am looking at modding a bit on my end

Thanks! I do plan on updating it in the future, so if you wish to contribute some tweaks to it or have any suggestions about it, feel free to PM me.

Welcome back! :drinks:

PS: Admins, please pin this topic! This should be pretty useful!

Edited by Menrva
  • Like 3

Share this post


Link to post
Share on other sites

Hello Menrva!

yes I seen the new fitting color in ODS 30, splendid job all the team!

as for clouds I don't see much that can be done apart from extending their draw ranges and minimizing flicker/disappearances out of camera frustrum, which I have looked into and might have some tweaks -with the sacrifice of number or size of the individual clouds, sadly, but that is something I might look into in my limited spare hobby time.

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

@Stary Just FYI, someone was working on PBR shaders for Strike Fighters 2. They seem promising, but no updates since last year and so far they break some things. Worth having a look at though: GitHub - Zackin5/StrikeFighters2-PbrShaders: Experimental PBR shaders for Strike Fighters 2

Edited by Menrva

Share this post


Link to post
Share on other sites

looking at his repo, seems intriguing

what would improve the sim big time is going from stencil shadows to soft shadowmaps, man I need to hack in different flagging for inside views classes (cockpits) to cast shadows

  • Like 2

Share this post


Link to post
Share on other sites
7 hours ago, Stary said:

looking at his repo, seems intriguing

what would improve the sim big time is going from stencil shadows to soft shadowmaps, man I need to hack in different flagging for inside views classes (cockpits) to cast shadows

Yes!  This is something SF2 can really need!  That would be awesome to see!

 

and like the community said, it is great to see you back here, sir!  I also thank you for the support with my mod projects too.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites

Just tested this in a couple of missions in the stock Europe terrain, and it is working well, no glitches so far. Thanks Stary !:good:

Share this post


Link to post
Share on other sites

Well on my end clouds disappear at times near borders but it's standard bug related to calculating what camera can see, nothing to do with this hack. Sadly only TK could fix some things...

Share this post


Link to post
Share on other sites
19 hours ago, Menrva said:

PS: Admins, please pin this topic! This should be pretty useful!

Done, keep up the good work!

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
5 hours ago, Stratos said:

Done, keep up the good work!

Thank you

Share this post


Link to post
Share on other sites
On 23/5/2022 at 5:44 AM, Eagle114th said:

Yes!  This is something SF2 can really need!  That would be awesome to see!

 

and like the community said, it is great to see you back here, sir!  I also thank you for the support with my mod projects too.

I second this wholeheartedly .. shadows in the cockpit would be a dream come true!!!  Glad to see you posting again Stary:good:

Share this post


Link to post
Share on other sites
Posted (edited)

This is an excellent mod for scattered and broken conditions. However result is unchanged in overcast and inclement conditions vs default .Fx file. Am I missing something?

Great mod though, thanks!

Edited by stuntman

Share this post


Link to post
Share on other sites
Posted (edited)
6 hours ago, stuntman said:

This is an excellent mod for scattered and broken conditions. However result is unchanged in overcast and inclement conditions vs default .Fx file. Am I missing something?

Nope, overcast and inclement are 2D cloud layers, totally unrelated, they use a different rendering and shader, so all is fine. I wouldn't lower those if we could, because unfortunately the game is hardcoded to make terrain rendering invisible when above those 2D cloud layers. What this means is that on terrains spanning from sea level up to 5km or more of elevation, you'd get invisible mountains when flying over the layer, hence you can crash into or even spawn above invisible terrain. One of TK's weird (or cheap) design decisions; of course, this doesn't happen on stock terrains which hardly reach a safe value of 4km of elevation.

Edited by Menrva
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Uh OK, thanks for the explanation. The way you guys know all the technical details of this sim always amazes me. 

In any case, this is an excellent mod and a must have for anyone still playing sf2

Edited by stuntman

Share this post


Link to post
Share on other sites
Posted (edited)
On 23/5/2022 at 2:48 PM, Stary said:

Well on my end clouds disappear at times near borders but it's standard bug related to calculating what camera can see, nothing to do with this hack. Sadly only TK could fix some things...

Well, on a careful look, editing the z value on the shader as you've shown makes this issue apparent especially on the top border of the camera. Without the altitude tweak, clouds on the top border of the camera/screen no longer disappear abruptly, so this is an issue of the altitude hack. I've been experimenting and looking for a solution, but nothing positive so far. Multiplication values cause no issues, in fact I even added those to x and y properties of input.pos, and they can bring some interesting results.

 

This is a test package I made for use on realSKY, after I experimented a little with values: realSKY_clouds_test.zip

For each type of weather there is a different EnvClouds shader, so the look of clouds in each weather type can be customized separately via their own shaders. On Overcast and Inclement, clouds have been (unrealistically) added close to the 2d cloud layer (whose altitude and gameplay effect is terribly hardcoded), giving it a puffier 3d look as you approach it. Below shots show it clearly.

img00001.thumb.JPG.384ce30fc03f5f1794fb7c1d549009c0.JPG

img00003.thumb.JPG.077f4307fa333d9bf3308a9901952f8a.JPG

img00004.thumb.JPG.4258a2c18fd35ac86c50223aa98c934d.JPG

img00007.thumb.JPG.75ef2c2aeb5467594cce537462c86250.JPG

 

img00011.thumb.JPG.f871fc0512e6bc8e5bcf104fa305b26d.JPG

img00010.thumb.JPG.af8862e7da32b543414490b7e897a7e0.JPG

Unless the bug with clouds disappearing abruptly is solved, this will remain a test package only. It's a pity, clouds look much better at realistic altitudes, but TK made it harder (if not impossible) for us modders to bring positive and bug-free changes, so "thank" him for that.

Edited by Menrva
  • Like 2

Share this post


Link to post
Share on other sites

interesting, will take a look, busy IRL ATM

Share this post


Link to post
Share on other sites
Posted (edited)
On 26.05.2022 at 1:30 AM, Menrva said:

 One of TK's weird (or cheap) design decisions; of course, this doesn't happen on stock terrains which hardly reach a safe value of 4km of elevation.

this is most likely cheap 2002 era solution, puzzling given EAW had transparent see-through clouds layers (but not on overcast)

Edited by Stary
typo

Share this post


Link to post
Share on other sites
19 hours ago, Stary said:

interesting, will take a look, busy IRL ATM

Hope you could find some time to hack other parts of the game like avionics...

Share this post


Link to post
Share on other sites
On 28.05.2022 at 2:37 PM, Stratos said:

Hope you could find some time to hack other parts of the game like avionics...

well this is very crude shader tweak, messing with avionics -without even saying what specifically?- is different level and frankly out of scope of my interest

Share this post


Link to post
Share on other sites

Understood, maybe TK should start dong some FC3 level birds for DCS, lol.

Share this post


Link to post
Share on other sites
Posted (edited)

@Stratos No offense, but maybe you should remove these posts starting from your question (and including this post I wrote), as they are not pertinent to the topic which is about clouds. Like Stary said, this is a crude shader tweak and it comes with rendering issues. Avionics are a totally different matter, we cannot create new functions for them from scratch. We have no source code and reverse engineering the avionics DLL library files is not feasible. Besides, during the development of ODS 30AE I tried my best to see if we could reproduce IR images for the DTV screen filter via shader. I discovered that TK did NOT implement some DirectX 10 blending operations which would be needed for that. Point being, we've beaten this horse already. Only TK can change things for good, and he won't.

Edited by Menrva
  • Like 1

Share this post


Link to post
Share on other sites

No offense, but I will not remove them. Thanks.

Share this post


Link to post
Share on other sites
Posted (edited)
19 minutes ago, Stratos said:

No offense, but I will not remove them. Thanks.

Alright, whatever suits you. It's just that this is a pinned topic on a specific matter but now it's cluttered with something else. You could have sent Stary a PM instead. Thanks anyway.

Edited by Menrva
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

@Stary Yesterday I graduated and the IT engineer in me has been thinking about the rendering issues of your shader hack. I think they cannot be solved for good without some major hex-editing (no idea where). I'll try to explain what might be happening: your shader hack successfully moves the rendering of clouds to a lower Z value, but clouds as an entity/object are still thought by the game to be in the original, hardcoded altitude. This is why they disappear abruptly from the top border of the camera; on stock altitude values, clouds beyond the top border of the camera disappear without us players noticing. By moving the rendering of clouds to a lower altitude, we see this clearly because the disappearance behavior is still triggered by the hardcoded value TK has put. I cannot claim this is exactly what is happening in the game code, but given how it happens it makes sense to me.

Needless to say, I'd love to be proven wrong, or that we manage to find that one hardcoded value that needs to be changed.

Edited by Menrva

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..