Jump to content

Post-processing effects test (SSAO/HDR/Bloom)


Recommended Posts

I got some weird artifacts playing on the Iberian CC and Scout tower after adding parallex:

That happens on (some?) smoothed surfaces when using parallax. There was some discussion about it on pages 51/52.

Enrique says it only happens on polygons that were set to smoothed but are flat, and suggested a way to fix it. I'm not entirely convinced the parallax effect can play nice with smoothed surfaces at all, but it's worth trying what he suggested (and let us know if it helps!).

Link to comment
Share on other sites

Maybe it has something to do with the seams?

You mean the ones used for UV unwrapping? No, don't think so.

I'll try to explain what is going wrong.

The way parallax works, it expects the normal to be constant across the polygon (i.e. that the surface is flat). In the case of smoothed surfaces like in the Iberian buildings, the normal is different at each vertex, so the surface is "curved" and parallax doesn't have the information to deal with that in the shader.

To visualise this, consider that the parallax effect moves the surface inwards in varying degrees to create a 3d effect. Where the surface has been pushed in, it reveals what lies behind it, so to find that the effect raytraces in the heightmap along the view direction until it hits something else. The raytracing step assumes that the surface is flat, and the position of the object behind is assumed to have the same normal as the position in front - which are false when the surface is curved! Hence the visual distortion.

Hope that makes sense.

Anyway, the technical solutions to this problem that I can think of would be to either calculate and pass the curvature information to the shader, or to add a second set of flat normals for use with parallax (while smoothed normals are used for regular shading).

Both of these sound crazy wasteful to me, so I'd recommend to just not use parallax on smoothed surfaces. It's better to disable it completely on buildings with too many smoothed surfaces, and where the smoothed surfaces aren't visible (like that Roman camp model) just get rid of the smoothing on the entire model. Normal and specular mapping will still work correctly, so hopefully you can get good results by making the most of those (hint: use a normalmap generated with a Sobel or Prewitt operator to get a more powerful effect).

(To disable the parallax, choose or create a material that doesn't use the effect. It doesn't matter if the texture has a heightmap in it for use with other buildings that don't have this problem, as when parallax isn't used it will simply be ignored)

Link to comment
Share on other sites

historic, when exactly did the water go black? Can you find a way to reproduce the problem?

All I can say is it happened to both Zaggy and I in the same game, on Aegean Sea. It wasn't instant as soon as the game started, he noticed it first, then maybe 10-15 minutes later, I did. Here's how the map was situated near the end of the game, not sure if it provides any helpful info: http://i.minus.com/iDzkS1FexsrKJ.png

Relevant info: both Zaggy and I have Radeon HDs, both on Windows 7 64-bit. We have different drivers though, he's on 8.92 and I'm using 8.98. I know there is a driver update available but I tend to not update due to potential breakage :P Also this bug is relatively rare so upgrading drivers might not make a noticeable difference.

Link to comment
Share on other sites

This feels like an engine bug, not a driver issue. My instinct tells me this has something to do with GL_BLEND or GL_DEPTH_TEST or similar, though it's not immediately obvious where to look for the problem and there's not enough info to take a guess from.

I think I'll just do a thorough cleanup session and hopefully this won't resurface again.

Link to comment
Share on other sites

This feels like an engine bug, not a driver issue. (...)

I have noticed the same black health bars and black minimap a few days ago. Moving the view usually did away with the effects, unless I moved back to the old position. I did not check the water, as far as I noticed it didn't occur on the water (or this was not in view when things went black). I used a Macbook Pro 15" from 2007, so a quite different system (Nvidia 7800GM GPU), so it is indeed probably not a driver issue. This was with preferglsl=true, as well as the other relevant settings set to true.

Link to comment
Share on other sites

I have noticed the same black health bars and black minimap a few days ago. Moving the view usually did away with the effects, unless I moved back to the old position. I did not check the water, as far as I noticed it didn't occur on the water (or this was not in view when things went black). I used a Macbook Pro 15" from 2007, so a quite different system (Nvidia 7800GM GPU), so it is indeed probably not a driver issue. This was with preferglsl=true, as well as the other relevant settings set to true.

That's a very useful datapoint, dvangennip! Btw, would you be able to recreate the problem for testing purposes?

When any of you experience these 'black' issues, can you please try disabling and enabling shadows (from "MENU -> Settings") and see if it makes any difference? It sounds a lot like issues I've had with the minimap when shadows are enabled.

I haven't forgotten about that. It might be related, though I kind of think the minimap thing you experienced is a separate engine bug. Will try to track that down too, as I'd like to have that fixed.

I get a strange shimmering artifact on the base of this metal mine rock:

Hmm.. That's probably the old specularity. I wonder if there's a material missing the "specularPower" line or something. See if you can find which actor that is.

Link to comment
Share on other sites

Hmm.. That's probably the old specularity. I wonder if there's a material missing the "specularPower" line or something. See if you can find which actor that is.

It's on all the actors named *_slabs.xml in art/actors/geology. They use the basic_spec.xml material.

Link to comment
Share on other sites

It's on all the actors named *_slabs.xml in art/actors/geology. They use the basic_spec.xml material.

They look fine here... :unknw:

Anyway, I've figured out historic/zaggy's problem with the water. The minimap, health bars and sky have one thing in common: they are all drawn with ancient OpenGL 1.2-era commands. For some reason, they don't like the more modern shader stuff.

To reproduce the bug, I added the Roman barracks at an empty location on Oasis 10. I zoomed in completely (until inside the building, so it's the only thing being drawn besides terrain) and then out, and boom there it is. The sky becomes really dark (hence the water problem), while the minimap and health bars become black.

So far, I've started giving the sky renderer a little face-lift. That works like a charm now, but it's not ready for commit just yet.

Link to comment
Share on other sites

Just committed a fix for that weird bug. The sky, minimap and healthbars are now rendered with shaders, except when using the fixed renderpath.

I'd like to ask people to test this ASAP and report anything strange. Alpha 11 is just around the corner and I don't want to add any new bugs...

Link to comment
Share on other sites

Just committed a fix for that weird bug. The sky, minimap and healthbars are now rendered with shaders, except when using the fixed renderpath.

I'd like to ask people to test this ASAP and report anything strange. Alpha 11 is just around the corner and I don't want to add any new bugs...

I get:

ERROR: Failed to compile shader 'shaders/glsl/minimap.vs':
0:22(8): error: type mismatch

ERROR: Failed to compile shader 'shaders/glsl/minimap.vs':
0:22(8): error: type mismatch

Link to comment
Share on other sites

I get an error similar to the one by zoot above with the current SVN version:


ERROR: Failed to compile shader 'shaders/glsl/sky.vs':
ERROR: 0:10: 'assign' : cannot convert from 'attribute 4-component vector of float' to 'varying 2-component vector of float'

If I try to view the sky (with alt+Z) it turns out completely white. Also, now the blackness that should cover everything I have not yet explored is not completely black, but rather 10% transparent or so. I can thus see the features of the terrain (but not any building or other entities). Upon launching it is ok, but when I reveal the map (with the developer panel) and then turn it off, it never goes back to completely black. This was not the case last time I used it (not too long ago).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...