Radial fog and HUD models

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Radial fog and HUD models

Post by Enjay »

Tested with official build and the Git build from 14 July.

Sorry, I am having difficulty replicating this in a map of sane size for posting an example. If I manage, I will but, just in case there is enough here to go on...

Sometimes, in some places, HUD models can look wrong - all one colour like they are in stencil mode.

Image

It should look like...

Image

There is a dynamic light nearby (like the streetlamp in the image) and moving away from it cancels the effect. This is the only location that I have noticed the effect. Standing next to a light does not reliably cause the problem. Interestingly, disabling dynamic lights does not fix the problem but using a map editor to delete the item with the light attached does.

It is also worth noting that the entire area is using coloured lighting (coloured with Sector_SetColor in a script). However, removing this does not fix the problem.

I have gone through the various OpenGL options and the only ones that seem to affect this are sector lighting mode and fog mode. I suspect that fog mode is the critical one. The effect only happens when fog mode is set to radial. The other modes look fine (which is how I got the good screenshot).

I mentioned that sector lighting mode makes a difference, but it's an odd one. Most of the modes do not seem to make a difference but if the mode is set to "Legacy" then the effect is still there but it is not as severe.

Image

I'm going to guess that Legacy mode does something slightly different with fog compared to the other modes.

HUD sprites are not affected and I have not been able to get an "in world" map object model to show the effect either. I don't know if this is simply because I haven't managed to get one in the critical location or because it only affects HUD models.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Radial fog and HUD models

Post by Graf Zahl »

Aha, so the code was indeed not correct. I already was suspecting it but with nothing to test I couldn't verify.
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Re: Radial fog and HUD models

Post by Enjay »

Does that mean you have an idea where to look? I've tried and tried to get a sensible test map working but the issue seems very sensitive and so far I have been unable to make a test map where this happens. In fact, even in the area where I took the above screenshots, after working on part of the map not particularly close to that area, I can no longer get the effect to happen. (I have backups of older versions and should still be able to test though.)

Interestingly, although the effect has stopped happening in the above area, it has started appearing elsewhere in the map. In this new area, it is also affected by the opening and closing of a door. When you stand behind the closed door, the HUD models look fine but when you open the door, they go like the above. There are a number of dynamic lights in the room beyond the door. Intriguingly, the direction that you are looking can also affect it. If I stand with the door open looking straight into the newly revealed room, the HUD models are messed up. If I turn to about 45 degrees to either the right or the left (while standing in the same spot) the effect vanishes. Perhaps something to do with the lights being in my field of view or not? As before, turning off radial fog clears up the problem.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Radial fog and HUD models

Post by Graf Zahl »

The problem seems to be that the render state is not fully reset when rendering a HUD model. As a result fog is on when it shouldn't be with some variables holding undefined values. But without a working test case I can't do much.
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Re: Radial fog and HUD models

Post by Enjay »

Hmmm, that's awkward then. Changing apparently entirely unrelated areas of the map is enough to alter where the effect happens and how severe the effect is, or if it even happens at all. It seems quite random.

I've tried and tried but creating a reliable test map has not so far been possible. Uploading the entire thing as it is right now is impractical. :?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Radial fog and HUD models

Post by Graf Zahl »

Can't you leave out the sprites and textures? I think the issue will show itself with the placeholder texture, too. So send me the naked map with a setup that enables the HUD model. I think that should be enough, along with some info where to warp.
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Re: Radial fog and HUD models

Post by Enjay »

I had already tried that but for some reason it didn't work. However, I have now done it again and I think this still shows the problem. It happens in a different area of the map which is less reliant on custom DECORATE items so, perhaps, that's why removing all my stuff allows the effect to still happen. I have replaced all the custom textures with DeePsea's defaults but left everything else in the map alone.

The only thing is, the effect is not so strong here: it looks more like the Legacy mode shot.

Image

This area seems to be quite sensitive to the effect. This is where I was talking about in my previous post. That picture is taken in front of an open door (and under a 3D floor - though the previous shots were nowhere near a 3D floor). When the door closes, the effect vanishes. If you move or turn a bit, the effect vanishes. That may, or may not, be useful to you.

Door closed:
Image

Player looking a slightly different way (but not actually moved):
Image


Anyway, I have included a savegame to ensure that you start in exactly the right spot. FWiW, those screenshots were taken using your benchmark build from the ZDoom thread.

I just remembered that I didn't include the map scripts in the WAD but I don't *think* they will be relevant. If you need them let me know.

I'll PM a link to the map. [edit] Done [/edit]
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Radial fog and HUD models

Post by Graf Zahl »

Ok, thanks. As expected the fog was accidentally left on for the HUD model and since it created a completely new view transformation matrix the camera position used for calculating radial fog made absolutely no sense when drawing the model - and on top of that it used the most recently used fog color which of course is dependent on the drawn scene, that's why this was so erratic.

(BTW, the fix was to move one line of code to a different place...)
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Re: Radial fog and HUD models

Post by Enjay »

Good to know that you found the problem and that the fix was an easy one. :)
Locked

Return to “Closed Bugs”