Skip to content

Shadows on water surfaces#1965

Draft
AdamTadeusz wants to merge 5 commits into
NeotokyoRebuild:masterfrom
AdamTadeusz:361_waterfogshadowsonsurface
Draft

Shadows on water surfaces#1965
AdamTadeusz wants to merge 5 commits into
NeotokyoRebuild:masterfrom
AdamTadeusz:361_waterfogshadowsonsurface

Conversation

@AdamTadeusz
Copy link
Copy Markdown
Contributor

Description

Adds support for the $lightmapwaterfog water texture param used in games post l4d2. I wasn't able to get the scale to which the shadow is applied to the fog colour, so I made it depend on the alpha value of the water fog colour.

Keep in mind, water with this parameter needs to have a lightmap. Depending on the bsp compiler used, setting $lightmapwaterfog before compiling may be enough, or you may have to add a compiler flag like "%compileKeepLight". You can check if a water surface has a lightmap with the mat_luxels 1 command. If the surface is entirely filled in in blue, there is no lightmap. If instead you can see a square grid pattern corresponding to the lightmap resolution, the water has a lightmap.

Some example images
$lightmapwaterfog 0
image

$lightmapwaterfog 1 $fogcolor" "{52 49 44 0}
image

$lightmapwaterfog 1 $fogcolor" "{52 49 44 1}
image

Toolchain

  • Windows MSVC VS2022

@AdamTadeusz AdamTadeusz changed the title Shadows on water surface Shadows on water surfaces May 17, 2026
@AdamTadeusz AdamTadeusz marked this pull request as draft May 17, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant