
Hey, everyone! As you have surely noticed, SEUS PTGI has thus far been hideous in underwater scenes. I figured it's quite time to change that (especially now that Minecraft 1.13 compatibility is here), so this is mostly what I've been focusing on for E8
In the past, I've just relied on a thick application of fog for underwater rendering, since I could never really get clear water looking right. Since I wanted to match vanilla Minecraft's (1.13+) underwater visibility this time, there was no more avoiding it, so I decided to do some research.
Watching videos of people diving in clear waters, I was amazed at just how much water absorbs longer wavelengths of light (giving anything but shallow, close-up surfaces a blue/cyan tint). I mean sure, I was aware of it before, but I definitely underestimated it. Previously I used hand-picked absorption values, but this time I've decided to use physically accurate values.


Here, you can see the effects of the physically-based light absorption in water.
And of course, what is an underwater scene without caustics? I experimented with several approaches, but with so little resources left to work with (since PTGI is so complex already), I couldn't use several shader stages with intermediate textures to render caustics dynamically like I have with previous versions of SEUS. Plus, if I came up with a really cheap method, it would allow for volumetric caustic light shafts (god rays) under water, which I really wanted.
So, I've decided to use a pre-rendered caustics animation texture for caustics. I wrote a custom tool to render this texture for me that ensures it tiles and loops seamlessly. I also made sure to use the same water height function so that the rendered caustics match the look of the surface of the water.
Caustics appear differently at different water depths, which I considered important enough to include as a feature as well. So, the rendered caustics texture has 4 separate layers (packed in RGBA channels) for varying depth ranges, from shallow to deep. Then, in the shader, I simply crossfade between these layers based on water depth.
To keep it relatively lightweight yet still crisp, the texture has a one second loop, is 60 frames per second, and tiles across a width of 2 blocks. Unfortunately, the tiling is definitely noticeable, but is less apparent when blending between the 4 depth layers.


Here, you can see the difference between only having one depth layer for caustics (top), and having four (bottom).
Now that caustics were in, it was time to do volumetric light shafts from caustics! This part was pretty easy to get working, since I've done stuff like this in the past (though, caustics never contributed before).


Without (top) and with (bottom) volumetric light shafts from caustics
This is all still a work-in-progress of course! Unfortunately, I had to use a feature of OptiFine that was introduced in 1.13 to get the caustics working, and it totally breaks in Minecraft 1.12.2. I'm not really sure what to do about this. Perhaps the developer of OptiFine can port this feature back for 1.12.2.
UPDATE: The developer of OptiFine has informed me that this feature and others will indeed be backported to 1.12.2.
Murakuumoo
2020-05-23 20:51:12 +0000 UTCRealDheejae Delos Santos
2019-09-17 00:15:40 +0000 UTCAshton Erlandson
2019-09-14 11:40:29 +0000 UTCBongo
2019-09-08 05:28:44 +0000 UTCMatthew
2019-09-02 12:21:29 +0000 UTCMatthew
2019-08-14 15:06:09 +0000 UTCSun
2019-07-13 18:01:43 +0000 UTCbenjamin høegh
2019-07-12 12:00:20 +0000 UTCThe Basskitty
2019-07-08 18:16:35 +0000 UTCAshton Erlandson
2019-07-06 02:21:51 +0000 UTCEmeraldCrafts
2019-07-05 18:03:44 +0000 UTCLucas
2019-07-04 18:03:24 +0000 UTCLucas
2019-07-04 18:03:03 +0000 UTCLucas
2019-07-02 04:55:31 +0000 UTCAshton Erlandson
2019-07-01 00:41:17 +0000 UTCAshton Erlandson
2019-06-30 09:19:02 +0000 UTCAshton Erlandson
2019-06-30 09:18:09 +0000 UTCAshton Erlandson
2019-06-30 05:26:47 +0000 UTCTom Smith
2019-06-28 19:47:30 +0000 UTCThomas
2019-06-26 05:38:26 +0000 UTCSun
2019-06-25 16:33:15 +0000 UTCRyan Samuels
2019-06-25 06:08:47 +0000 UTCTD
2019-06-24 02:20:24 +0000 UTCdiddy45
2019-06-23 16:42:48 +0000 UTCSlayerDan216
2019-06-23 01:45:47 +0000 UTCAlexRice
2019-06-22 05:47:24 +0000 UTCBloxyway
2019-06-21 21:52:33 +0000 UTCHana
2019-06-20 23:35:55 +0000 UTCIce2670
2019-06-20 17:25:09 +0000 UTCSerge-Antoine Côté
2019-06-20 12:09:07 +0000 UTCCyro
2019-06-20 05:14:23 +0000 UTCDan Fiscus
2019-06-19 21:46:12 +0000 UTCShampooh
2019-06-19 17:52:30 +0000 UTCUltimate Immersion
2019-06-19 17:01:29 +0000 UTCKayzerG
2019-06-19 16:53:02 +0000 UTCKayzerG
2019-06-19 16:52:12 +0000 UTCKayzerG
2019-06-19 16:50:51 +0000 UTC喆楠 張
2019-06-19 16:50:46 +0000 UTCSonic Ether
2019-06-19 16:42:58 +0000 UTCGareth Welch
2019-06-19 16:40:08 +0000 UTCKenzie
2019-06-19 16:34:08 +0000 UTCZephyr Arcturus
2019-06-19 16:31:24 +0000 UTCumsoea
2019-06-19 16:28:40 +0000 UTCValerie
2019-06-19 16:26:43 +0000 UTCAlpha
2019-06-19 16:24:15 +0000 UTC