DX 11 Volumetric Clouds Demo
Results 1 to 19 of 19

Thread: DX 11 Volumetric Clouds Demo

  1. #1

    DX 11 Volumetric Clouds Demo

    So... This is absolutely work in progress full of glitches, incomplete and unoptimized, but I want to share it.

    https://1drv.ms/u/s!AvmtwF9vPtwVgbogLoFWr9zLLTr8xQ

    (about 8MB, unusually big because it includes volumetric cloud "texture")

    Unzip to CFS3 folder, run cfs3config, don't forget to set the display resolution. And maybe it will work.
    Requires at least Win7 SP1 with Platform Update, but should work better on Windows 10. And absolutely needs a powerful GPU.

    Cloud placement is based on CFS3 weather system so you can try different weathers. However it seems after a few mission restarts the code may glitch and not render all clouds, and you will need to restart the game. The drawback of CFS3 clouds and consequently my ones is that they don't move. Not sure if I can do anything about it.

    Anyway I'm not asking to look for bugs, there are too many of them, but I'm still curious to see your opinions
    Attached Thumbnails Attached Thumbnails clouds-dawn.jpg  

  2. #2
    SOH-CM-2023 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we?
    Age
    79
    Posts
    3,554
    I can't launch the CFS3,cfg as it's asking for DirectX 8

    It's the dll which seems to be the issue.

    OS: Win10 Professional 64 bit
    Intel(R) Core(TM) 17-2600 CPU 2 3.40GHz 3.70GHz
    RAM 16Gb DDD3 (2 X 8Gb)
    MB: Asus M4N68T-MV2
    Vid Card: NVidia Gforce GTX 970
    C Drive: Samsung SSD 850 EVO 1Tb
    D Drive: Samsung SSD 850 EVO 500Gb
    E Drive ITB Samsung HD103SJ 32M 7K OEM
    F Drive: 2 x Seagate BarracudaGreen 2TB Hds in RAID
    Power: PSU Seasonic X750 Gold 750W
    Monitor: 46” Samsung 630 LED LCD + 2 27"Acer Monitors
    Track IR5.






    OS: Win10 Professional 64 bit
    CPU: Intel i7 – 2600K @3.40GHz 3.70GHz
    RAM 16Gb DDD3 (2 X 8Gb)
    MB: Asus M4N68T-MV2
    Vid Cards: 2 x Sapphire Radeon HD 6850 1 GB GDDR5 VGA/DL-DVI-I/SL-DVI-D/HDMI/Display Port PCI-Express Video Card 100315L
    C Drive: Crucial CT128M4SSD2 128 GB Internal Solid State Drive


    D Drive ITB Samsung HD103SJ 32M 7K OEM
    E Drive: 2 x Seagate BarracudaGreen 2TB Hds in RAID
    Power: PSU Seasonic X750 Gold 750W
    Monitor: 46” Samsung 630 LED LCD
    Last edited by mongoose; June 9th, 2019 at 15:45.

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  3. #3
    SOH-CM-2023 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we?
    Age
    79
    Posts
    3,554
    I already had what this Dutch guy suggests. So I already have Direct Plav check marked!

    https://www.youtube.com/watch?v=rOmyxrCTYKg

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  4. #4
    SOH-CM-2020
    Join Date
    Jun 2005
    Location
    Aotearoa, New Zealand
    Age
    63
    Posts
    2,896
    Thank you, Ankor! Have downloaded, when report back once I get a chance to install it. My take a day or two.

    D

  5. #5
    Quote Originally Posted by mongoose View Post
    I can't launch the CFS3,cfg as it's asking for DirectX 8

    It's the dll which seems to be the issue.
    Sometimes it happens with this dll for some reason, I can't figure out why yet. I just try to launch it again and and after a few tries it usually works.

    Actually, if config absolutely refuses to work you can try the dll from DX9 shaders with FakeDriverVersion=1 in the ini (which I think you already have, as it removes the need to run config on GPU driver update) to run cfs3config, set the resolution and then just swap to the dll and run the game.

    The config is only important to set the exact display resolution, for some reason using "default resolution" doesn't work in DX11.

    GTX 970 should be good enough, although it depends on resolution.

    Daiwilletti, thanks. Hope it works

  6. #6
    SOH-CM-2023 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we?
    Age
    79
    Posts
    3,554
    Well I've tried with 2 different ETO installs and CTD each time. As soon as I put back the original dll, no problem, but I assume I need the new one for the clouds.

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  7. #7
    On my GTX980 system at 3440 x 1440 my FPS dropped from my normal 70-90 to 10-30 using these. The lowest FPS was when I was very close to the volumetric clouds. The FPS went back up once inside the cloud and everything went evenly grey.

    The clouds looked quite different than your example picture. They were quite psychedelic, with flickering bands of swirling, glowing highlights. I suspect this had something to do with the cloud image / alpha layer formats.

    US Army, Major, Ret.

    Service To The Line,
    On The Line,
    On Time

    US Army Ordnance Corps.

  8. #8
    mongoose, then perhaps something in my DX11 code is not compatible with your installs. Anyway, you don't miss much, this demo is not very playable and doesn't worth trying to figure out why it crashes.


    MajorMagee,
    Yes, the FPS are the worst near the clouds and really sensitive to screen resolution. FullHD with GTX970 is playable, but drops to 20 near clouds. It is possible to optimize, but before that I need to get rid of flickering as you noticed.

    Clouds are rendered using ray tracing so there's no textures in the usual sense. This demo uses clouds placement and sizes provided by the game, but doesn't use cloud textures.
    The problem with ray tracing is that it has to take large steps to be able to cover the huge view distance. In this demo clouds are rendered up to 64km away, which BTW is a step up from the stock CFS3 which only had 32km max distance for clouds. The steps are increased for distant clouds, but even near the camera they are several meters.
    Now imagine the step is 10m and you have a small cloud puff 120m away, so it is perfectly aligned and rendered at 12 iteration. But for the next frame the aircraft moved 5m forward, now the "cloud" is 115m away and the ray tracing will just step over it it and will not render anything.
    There are solutions for this, similar to texture mipmaps: if taking 10m steps the smallest cloud puff should be made 10m as well, so it is never overshoot, but these solutions are difficult to implement.

    Swirls are exaggerated in this demo, didn't have time to make them better, but without them clouds generally look worse.

    Brightness is off as well. I'm trying to use HDR rendering for DX11 but I also didn't have time to balance the brightness of different parts of the scene.

    Anyway, DX11 is not a priority to me, I just like to get back to it occasionally to try something. Technically DX11 version is many times better piece of code than what I wrote for DX9, but even though DX9 version is held together by a mile of duct tape, it just works and looks nice. Good news is that I plan to add a couple of cool things to DX9 soon.

  9. #9

    Great stuff Ankor...always exploring and pushing the boundaries......the only way to improve things.

    Might not work at the moment, but some time in the future....

    Thanks for all your CFS3 efforts.

    Cheers

    Shessi

  10. #10
    It appears that there's a lot that goes into doing the well. I found this presentation enlightening.

    http://advances.realtimerendering.co...20-%20ARTR.pdf
    US Army, Major, Ret.

    Service To The Line,
    On The Line,
    On Time

    US Army Ordnance Corps.

  11. #11
    Shessi, thanks!

    MajorMagee, this Horizon Zero Dawn presentation is exactly what I used for the inspiration!
    I implemented a lot of their ideas, though the big difference is that in their game the movement is relatively slow and clouds are always far away, while in a flight sim you move really fast and clouds are nearby. So not everything is suitable.
    Additionally I rely on so called distance field to easily tell the distance to the nearest cloud which helps a lot to skip empty sky, but not so much when you are looking at an edge of a cloud. This is relatively new technology used in modern game engines.

    And since I mentioned distance fields, here is something I came across while researching this stuff. Not really related to games, but very impressive: https://iquilezles.org/www/articles/...marchingdf.htm
    The scenes there are created with math without using models and with only a little bit of textures.

  12. #12
    SOH-CM-2023 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we?
    Age
    79
    Posts
    3,554
    @ Ankor

    Well that would be a pity. Are you talking about my DX installs, which I have at least from 9 to the latest; but maybe not 11? ( I take it these are the C++ installs?)
    EDIT: Dxdiag seems to say I have 12.1 all the way to 9.1.

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  13. #13
    Quote Originally Posted by mongoose View Post
    @ Ankor

    Well that would be a pity. Are you talking about my DX installs, which I have at least from 9 to the latest; but maybe not 11? ( I take it these are the C++ installs?)
    EDIT: Dxdiag seems to say I have 12.1 all the way to 9.1.
    You have all needed DX versions, and I don't think anything is wrong with your system. Most likely my DX11 code just does something wrong and it may fail on some installs. Really hard to tell.
    I will PM you my email address. Try running the game with DX11 dll and then send me d3d8.log file. Or just post its contents here if it is easier for you.
    However it is unlikely I will be able to suggest anything, but at least I can give it a try.

  14. #14
    I was able to try this out today. Had no issue on install, but when reverting back to the regular DX9 shaders it took several attempts before the config tool would run. In game, the new clouds are quite impressive! Mine look more like Andy's pic than yours, but I'm quite impressed with the potential! Frame rates were initially low - about 30-40 fps (my normal is 45-60), especially when panning around, but afterwards I had panned around a bit it fluctuated between 200 and 50 fps. I love the increased draw distance too!

  15. #15
    SOH-CM-2023 mongoose's Avatar
    Join Date
    Jun 2005
    Location
    Navigator, where are we?
    Age
    79
    Posts
    3,554
    Quote Originally Posted by gecko View Post
    I was able to try this out today. Had no issue on install, but when reverting back to the regular DX9 shaders it took several attempts before the config tool would run. In game, the new clouds are quite impressive! Mine look more like Andy's pic than yours, but I'm quite impressed with the potential! Frame rates were initially low - about 30-40 fps (my normal is 45-60), especially when panning around, but afterwards I had panned around a bit it fluctuated between 200 and 50 fps. I love the increased draw distance too!
    I got it working after Ankor fiddled with the dll but I also had to redo the cfg file after I went back to the old dll. Frame rates also 30+-100+ depending. In coulds was higher.

    Cato said "Carthaginem esse delendam"
    I say "Carthago iam diu deleta,sed enim Bellum Alium adhuc aedificandum est"

  16. #16
    SOH-CM-2020
    Join Date
    Jun 2005
    Location
    Aotearoa, New Zealand
    Age
    63
    Posts
    2,896

    Draw Distance

    Is the draw distance able to be increased in DX9, or is this only possible with later versions?

  17. #17
    Terrain draw distance is the same in DX9 and DX11, it is just usually covered in fog in DX9 while I pushed the fog quite far back in DX11. There's probably a built-in way to adjust fog distance in weather settings, but I don't know it.
    You can also edit shaders30\Fog.fx and change 7th line from this:
    return saturate((depth - vFogDistance.x)/vFogDistance.y);
    to something like this:
    return saturate((depth - vFogDistance.x * 1.5)/vFogDistance.y);
    This will increase fog start distance by 50%.

    Cloud draw distance depends on two factors.
    First there's hardcoded limit of 32km in stock CFS3, but I found a way to patch it as I do with many other things already. It seems to affect performance and stability so I'm not sure what happens if I include it in DX9 version.
    There's also CloudRadius="NNN" settings in weather xml files which limit the draw distance for specific layers. My DX11 shaders simply ignore it because they skip built-in cloud rendering, but something has to be done to increase this limit in DX9 version.

  18. #18
    Like everything else in CFS3 they made decisions in the coding to limit the impact they would have on computer systems envisioned for 2002 and a few years after. From the behaviours I've observed while trying to push things farther out with compositescenerybudgets.xml, you usually reach a point where the underlying code can't properly manage the scope of the memory required, and it either slows to a crawl, hitches badly, or crashes. This happens in cases where hardware monitoring shows that a modern high end system is not even close to reaching it's processing and memory limits.

    For years I've chased after eliminating a repeating stutter with hardware improvements. I eventually attributed the issue to the code needing to flush a fixed memory buffer on a regular basis, and no amount of hardware was going to change that. Only limiting the amount of what was being pushed through that bottleneck could make the hitch happen less frequently.

    p.s. It seems to be related to blitting because the speed and direction the screen is scrolling has an effect, with pure left to right at high speed at low altitude (more visible scenery objects to calculate) being the worst.
    US Army, Major, Ret.

    Service To The Line,
    On The Line,
    On Time

    US Army Ordnance Corps.

  19. #19
    SOH-CM-2020
    Join Date
    Jun 2005
    Location
    Aotearoa, New Zealand
    Age
    63
    Posts
    2,896
    @ Ankor, Majormagee - thanks for the info, really gets the old grey matter working .....

Members who have read this thread: 2

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •