Visual underwater effect Created 5 years ago2018-11-19 00:24:03 UTC by kazik kazik

Created 5 years ago2018-11-19 00:24:03 UTC by kazik kazik

Posted 5 years ago2018-11-19 00:24:03 UTC Post #341272
Hey,

I want to create a scene similar to this in a HL1 map:
User posted image
It should give the player the feeling of being underwater, but functionally shouldn't affect the movement or weapons.
To be clear, I don't want to make the player swim, I want to simulate the visual effect of being underwater while still retaining normal outside-of-water physics.

Visual power of suggestion is key here, i.e. adding underwater plants and some env_bubbles here and there and also simulating the water surface with a layer of transparent func_water at the top. All that is not a big issue.
But I'm having trouble simulating the the overall blue-ish tone and the limited depth of field / foggy effect that gradually limits your view on objects further away when you're in water.

Does anyone have an idea of how I could possibly achieve something like this?
Posted 5 years ago2018-11-24 06:26:29 UTC Post #341306
Looking at the code it might be possible to modify func_water - looks like pev->skin can be set to CONTENTS_WATER, CONTENTS_SLIME or CONTENTS_LAVA (at least as far as the .fgd is concerned) and I guess that somehow ends up in pev->watertype?
Maybe another CONTENTS_ constant will keep the fogginess but I'm guessing the engine probably only does that for CONTENTS_WATER, CONTENTS_SLIME and CONTENTS_LAVA. You can do client-side fog but I don't think it's as flexible as water textures.
You must be logged in to post a response.