How to setup fog inside a 3-d water?

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

How to setup fog inside a 3-d water?

Post by Nash »

I've got swimmable water setup using 3-d floors.

The problem is, using sector_setfade() on the model sector will fade the whole screen when I jump into the water.

I want that fullscreen fade, but I ALSO want an actual fog effect inside the water itself, so that the water appears to be murky. That's how the underwater areas look like in Half-Life (as an example).

How can I go about doing this?
User avatar
chopkinsca
Posts: 183
Joined: Thu Dec 29, 2005 8:09

Post by chopkinsca »

I've only been able to get this effect sort of from using setcolor and trying different light values and transparency levels for underwater. My guess is that the way setfade works, it can't be used for 3d floors.
User avatar
Eriance
Posts: 150
Joined: Wed Mar 29, 2006 19:36
Location: Everywhere and nowhere
Contact:

Post by Eriance »

Thats what I do. My map09 and map10 in the Demon Eclipse Wad uses this. Set the fadeand fog for the control sector or your 3D swimmable floor.
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Eriance - fade and fog ARE the same things. What are you talking about?
User avatar
Shinjanji
Posts: 198
Joined: Sun Nov 06, 2005 16:45
Location: Pennsylvania, USA

Post by Shinjanji »

Yah, it seems that the fade in a 3D floor will only change when you're inside of it.

My suggestion otherwise would be to just use a few semi-transparent layers near the surface to mimic the murky effect when seen from outside the water bounds.
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

No, that's not what I want.

I want the distant fog UNDER the water. That is, when I am submerged, the view fades into whatever colour I specified.

Currently, when fog is applied to the control sector, the whole screen is faded to that colour.

The effect works with Transfer_Heights, but I don't wanna use that anymore because it's so 1998. Plus I can't make the water translucent if I use Transfer_Heights.
User avatar
Zeg-Vok
Posts: 233
Joined: Wed Sep 21, 2005 18:04
Location: Up the creek without a paddle
Contact:

Post by Zeg-Vok »

So . . . what you are looking for, is an effect other than Sector_SetFade?
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

I want the same effect as attached file (which is a really old file made for software ZDoom).
Attachments
deepwater.zip
(911 Bytes) Downloaded 88 times
User avatar
Shinjanji
Posts: 198
Joined: Sun Nov 06, 2005 16:45
Location: Pennsylvania, USA

Post by Shinjanji »

Like this?
Attachments
GlubGlub.zip
Take a swim!
(859 Bytes) Downloaded 93 times
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Shin, nope. Check out my file and see the difference.

The 3-d water special is fading the whole screen with Sector_SetFade instead of applying an actual fog underwater.
User avatar
Shinjanji
Posts: 198
Joined: Sun Nov 06, 2005 16:45
Location: Pennsylvania, USA

Post by Shinjanji »

The example I posted uses both Sector_SetColor and Sector_SetFade on the 3D model sector.

Taking a look the example in the editor, it's using the WATERMAP function. Provided my memory hasn't failed me, WATERMAP is just an automatic SetColor with a predefined set of RGB values. I believe Graf has mentioned those RGB values somewhere before...
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

*sigh*

I don't think you get it.

The gradual fog effect does NOT happen when using 3-d floors. They work with Transfer_Heights.

I'm not talking about screen fades. I'm talking about gradual, distant fog...
User avatar
Zeg-Vok
Posts: 233
Joined: Wed Sep 21, 2005 18:04
Location: Up the creek without a paddle
Contact:

Post by Zeg-Vok »

WHat I would like to see is a transparent image overlayed on the screen when your under certain types of water or liquids, like burny stuff when your under lava, possibly some blue swirly stuff when your underwater . . .
User avatar
Shinjanji
Posts: 198
Joined: Sun Nov 06, 2005 16:45
Location: Pennsylvania, USA

Post by Shinjanji »

Nash wrote:I'm talking about gradual, distant fog...
...which is what the Sector_SetFade does. It defines the color that everything fades out to as it gets farther away. By default, it is black, but fog effects are made by setting it to lighter grays and white (see some maps in Hexen). To make a colorized fade seem thicker, lower the brightness of your target sector (be it model or normal sector)
User avatar
Phobus
Posts: 227
Joined: Sat Sep 03, 2005 11:48
Location: Orpington, Kent, England
Contact:

Post by Phobus »

Make the control sector lighter, and set the argument that tells the 3D floor whether it should affect the light of the sector it appears in appropriately.
Locked

Return to “GZDoom”