Fog doesn't work with materials

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Fog doesn't work with materials

Re: Fog doesn't work with materials

by Graf Zahl » Sun Jul 15, 2018 2:06 am

Fog works fine in your map, it just looks like the material effects and the fog cancel each other out in some places.
Easily verified by setting gl_fogmode to 0. Try with colored fog if you are not convinced.

Re: Fog doesn't work with materials

by Indecom » Sun Jul 08, 2018 4:36 pm

in my experiences, I was getting no sort of effect from enabling or disabling fog when using the new material system. There wasn't any diminishing light off in the distance, nor was there any actual colored sector based fogging effect. So I made a small change in the main.fp and it started working, at least colored fog (which is what I was after) and with no hit to the frame rate. It sounds to me (a layman) like the effect was disabled or separated from the new material system. I'm not entirely sure if that's the case, as I said I'm a layman so I understood like 25% of what you said. Lol

Re: Fog doesn't work with materials

by Graf Zahl » Sun Jul 08, 2018 3:06 pm

The new material system separates fog as diminishing light from fog as real fog. You cannot test for the latter when the former gets calculated in the material system.

Re: Fog doesn't work with materials

by Indecom » Sun Jul 08, 2018 12:33 pm

My apologies. I was giving you the line while having forgotten that I agreed code above it. It's this segment right here.

Code: Select all

             //
			// colored fog
			//
			if (uFogEnabled < 0) 
			{
				frag = applyFog(frag, fogfactor);
			} 

Re: Fog doesn't work with materials

by _mental_ » Sun Jul 08, 2018 10:30 am

GZDoom 3.4.1 you mentioned has an empty comment in line 490 of main.fp file.
There is a reference to uFogEnabled variable in the next line although condition here is different.

What’s the version of GZDoom you are using?

Re: Fog doesn't work with materials

by Indecom » Sun Jul 08, 2018 10:16 am

I have, it's at line 490, not the line you have highlighted.

Re: Fog doesn't work with materials

by _mental_ » Sun Jul 08, 2018 8:26 am

I'm using your map.
Screenshot_Doom_20180708_172205.png
And you still didn't give the exact location of code the question.

Re: Fog doesn't work with materials

by Indecom » Sun Jul 08, 2018 8:13 am

Are you running a map with new materials and fog? Until I made that change fog literally refused to work.

Re: Fog doesn't work with materials

by _mental_ » Sun Jul 08, 2018 6:43 am

Do you mean this line? This change has no effect for me, the given map is rendered exactly the same.

Fog doesn't work with materials

by Indecom » Sat Jul 07, 2018 9:36 pm

Fog doesn't work with the new material system in place. This has been the case since it was introduced, and is still the case with 3.4.1. I managed to track down the offending line in the main.fp shader.

In main.fp at line 490

Code: Select all

if (uFogEnabled  >  0)
if you change this line to

Code: Select all

if (uFogEnabled != 0)
The fog will start working again.

Here's a pk3 that you can test this on.
http://www.mediafire.com/file/sdjcxg2we ... 1.pk3/file

Top