Jump to content

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


Recommended Posts

I see, no worries. Now I know what the -p option does. I probably should have already read up on patch if I'm going to make use of it.

The compilation completed. When I load a map I get the following messages.

ERROR: Failed to compile shader 'shaders/glsl/model_common.fs':
0(205) : error C7505: OpenGL does not allow swizzles on scalar expressions

ERROR: Failed to compile shader 'shaders/glsl/model_common.fs':
0(205) : error C7505: OpenGL does not allow swizzles on scalar expressions

Link to comment
Share on other sites

I see, no worries. Now I know what the -p option does. I probably should have already read up on patch if I'm going to make use of it.

The compilation completed. When I load a map I get the following messages.

I thought I'd fixed that. Oh well, just remove the ".x" on line 205 of that file.

Edit: Modified patch is attached below for anyone else who wants to test.

modelmapping-final3.diff.zip

Edited by myconid
Link to comment
Share on other sites

Thanks, that fixed it.

I've noticed one small issue with the windy trees. You can see this on the Deep Forest random map, take a look at the body of the Pine trees (the green-blue coloured ones). They deform too strongly, almost as though they are pulsating. Do the Pine tree model/s require more verticies?

Link to comment
Share on other sites

I have tried the latest version of the patch, which compiled fine. In practice there is noticeable flickering, between the good look and the thing shown below:

post-14722-0-08820000-1343505311_thumb.j

Moving the camera, its rotation, or its angle can solve the issue. The flickering is also shown on the reflections of land area on a water surface.

The console is bombarded with error messages (all similar, so I won't repeat it here):


GAME STARTED, ALL INIT COMPLETE
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 50331648
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorRangeCheck: CGSDispatchDatagramsFromStream : Preposterous datagram length 926941440
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 83886080
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type -1600876732
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 968884736
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 1080298820
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type -253748968
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 994050304
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 859832576
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 876609792
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 692060416
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 725614848
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 742392064
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 1698693376
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 704643328

The system is a MacBook Pro, mid 2007 model, 2.2 GHz Core 2 Duo, 4 Gb, Nvideo 8600 GM 128Mb; running OS X 10.6.8. Especially where it concerns the graphics card it's not a fancy system, so perhaps I should try to disable a few things to see if matters improve?

Edit: the same map in Atlas does not show the same flickering, until I start the simulation. Then the situation is similar.

Edited by dvangennip
Link to comment
Share on other sites

Thanks, that fixed it.

I've noticed one small issue with the windy trees. You can see this on the Deep Forest random map, take a look at the body of the Pine trees (the green-blue coloured ones). They deform too strongly, almost as though they are pulsating. Do the Pine tree model/s require more verticies?

Well spotted, didn't see that!

Technically, it is pulsating, that's how the effect works. I make two general assumptions:

  1. The trunk sways back and forth in the direction of the wind, and vertices higher up sway more (ie tree sways in the wind, but root is stable)
  2. Vertices further out from the trunk move in "waves", and vertices further away from the trunk move more (ie longer branches sway more)

It looks like this particular model's "root" point is not set correctly in the model, so (2) looks wrong. The model needs to be corrected (it's probably the only one).

Link to comment
Share on other sites

I have tried the latest version of the patch, which compiled fine. In practice there is noticeable flickering, between the good look and the thing shown below:

Moving the camera, its rotation, or its angle can solve the issue. The flickering is also shown on the reflections of land area on a water surface.

The console is bombarded with error messages (all similar, so I won't repeat it here):


GAME STARTED, ALL INIT COMPLETE
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 50331648
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorRangeCheck: CGSDispatchDatagramsFromStream : Preposterous datagram length 926941440
Sat Jul 28 21:42:43 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 83886080
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type -1600876732
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 968884736
Sat Jul 28 21:42:44 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 1080298820
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type -253748968
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 994050304
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 859832576
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 876609792
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 692060416
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 725614848
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 742392064
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 1698693376
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorIllegalArgument: CGSGetPortStreamData
Sat Jul 28 21:42:45 s030454t.local pyrogenesis[36019] <Error>: kCGErrorTypeCheck: CGSDispatchDatagramsFromStream : Bad datagram type 704643328

The system is a MacBook Pro, mid 2007 model, 2.2 GHz Core 2 Duo, 4 Gb, Nvideo 8600 GM 128Mb; running OS X 10.6.8. Especially where it concerns the graphics card it's not a fancy system, so perhaps I should try to disable a few things to see if matters improve?

The flickering is a known issue with the shadowmap, not caused by my changes. It can be ignored for now.

As for the errors, a search shows they're Mac-specific, though there's absolutely no info to go on (none!). Can you at least check if these were caused by my changes? You'll need to compile the vanilla code and make sure that preferGLSL is true in the config (even if they were caused by my changes, there might be nothing we can do about them). They aren't fatal, though, which is good.

Edit: Ok, it looks like these errors have something to do with the Mac's window manager. Loads of applications have them, but there's no documentation and nobody has any solutions for them. FWIW, I found an old forum comment that suggested that changing resolutions sometimes helps (you can hit Alt+Enter in-game to switch from fullscreen to windowed in 0ad), though that's hardly a solution. I think this can go down as another driver/OS bug...

Link to comment
Share on other sites

Well spotted, didn't see that!

Technically, it is pulsating, that's how the effect works. I make two general assumptions:

  1. The trunk sways back and forth in the direction of the wind, and vertices higher up sway more (ie tree sways in the wind, but root is stable)
  2. Vertices further out from the trunk move in "waves", and vertices further away from the trunk move more (ie longer branches sway more)

It looks like this particular model's "root" point is not set correctly in the model, so (2) looks wrong. The model needs to be corrected (it's probably the only one).

Okay, thank you for the explaination ^^

In Atlas, the problem tree seems to be "gaia/flora_tree_pine_animated", which according to the "pine_animated.xml" file in art/actors/flora/trees/, uses the mesh "tree_pine_01.dae" in art/meshes/gaia/.

What defines the root point, is it the object's origin or something else?

Edited by halcyonXIII
  • Like 1
Link to comment
Share on other sites

Okay, thank you for the explaination ^^

In Atlas, the problem tree seems to be "gaia/flora_tree_pine_animated", which according to the "pine_animated.xml" file in art/actors/flora/trees/, uses the mesh "tree_pine_01.dae" in art/meshes/gaia/.

What defines the root point, is it the object's origin or something else?

Ah, I see now (my guess was wrong^). I'm looking at the model and it seems the root point is set correctly (it's set as a "point" in Blender, look at the outliner window).

The problem is that this particular tree is animated. That is, someone added bones to it and animated it manually. It looks wrong in the game because it has two wind animations overlapping each other and doing weird things.

Basically, the solution is not to use this model in the game OR remove the manual animation OR switch its material to the static "basic_trans.xml" material.

Link to comment
Share on other sites

Alright then, so the "Deep Forest" random map uses the "flora_tree_pine_animated" actor, which isn't supposed to be used.

The rmgen Javascript needs to be changed to use a different actor. That doesn't fit in these patches, but it's still a (minor) bug.

Thanks for reporting your findings, halcyonXIII!

Link to comment
Share on other sites

The flickering is a known issue with the shadowmap, not caused by my changes. It can be ignored for now.

As for the errors, a search shows they're Mac-specific, though there's absolutely no info to go on (none!). Can you at least check if these were caused by my changes? You'll need to compile the vanilla code and make sure that preferGLSL is true in the config (even if they were caused by my changes, there might be nothing we can do about them). They aren't fatal, though, which is good.

Ah, I checked the vanilla code and you are correct: the flickering is simply the result of a preference for GLSL. It is present in the regular code as well. I must have missed the earlier discussion on that.

Edit: Ok, it looks like these errors have something to do with the Mac's window manager. Loads of applications have them, but there's no documentation and nobody has any solutions for them. FWIW, I found an old forum comment that suggested that changing resolutions sometimes helps (you can hit Alt+Enter in-game to switch from fullscreen to windowed in 0ad), though that's hardly a solution. I think this can go down as another driver/OS bug...

Now, this one is interesting. Alt+Enter does not work on my Mac :confused: So windowing the application cannot be done. Going off-topic for a bit: selecting only military units does not work by bandboxing (left click + dragging the mouse) + holding Alt, if I start with pressing Alt. If I drag first, then press Alt, then let go of the mouse button, it works. Pressing Alt first, then dragging, results in panning the view. Although it is completely unrelated to the discussion here, I wonder if this is the correct/desired behaviour or that a ticket must be filed?

Back on topic. Apart from the issues with the shadowmap and errors everything else looks fine, very fine :)

Edited by dvangennip
Link to comment
Share on other sites

Ah, I checked the vanilla code and you are correct: the flickering is simply the result of a preference for GLSL. It is present in the regular code as well. I must have missed the earlier discussion on that.

Do you get the errors on the vanilla build and preferglsl=true also, though?

Link to comment
Share on other sites

Now, this one is interesting. Alt+Enter does not work on my Mac :confused: So windowing the application cannot be done. Going off-topic for a bit: selecting only military units does not work by bandboxing (left click + dragging the mouse) + holding Alt, if I start with pressing Alt. If I drag first, then press Alt, then let go of the mouse button, it works. Pressing Alt first, then dragging, results in panning the view. Although it is completely unrelated to the discussion here, I wonder if this is the correct/desired behaviour or that a ticket must be filed?

Looked it up. The Alt+Enter shortcut is inherited from SDL, and the problem is on their end (the fullscreen toggling is not implemented on Mac yet). As there's no way to change resolutions from inside the game, I guess we can leave this be. :unknw: (Maybe you can try different resolutions in the config, but that probably won't make any difference.)

Do you get the errors on the vanilla build and preferglsl=true also, though?

Yeah, I want to know about this too.

Link to comment
Share on other sites

@Myconid

1. Congratulations with your new banner ;)

2. Soon I'd love to post an overview with your spectacular work. Whenever you 'finish' something or work on a new feature, please make screenshots/video comparison of vanilla and your work. If this is too much work, I'll ask someone else or give it a go myself. I don't want you to get distracted, but the community would love to see your work in detail. :) Keep it up !

Link to comment
Share on other sites

Do you get the errors on the vanilla build and preferglsl=true also, though?

Yes, sorry if I wasn't clear on that. The flickering was there with the vanilla code and preferglsl=true. Actually, it is even worse as there is also white flickering on (bright?) parts, such as roofs and trees. See the screenshot below, taken from the same scenario with vanilla code and preferglsl=true.

post-14722-0-94334600-1343567996_thumb.j

This patch is thus not making matters worse in any way. The patch could be said to improve matters, even though the terrain (dark) flickering remains :)

P.S. Thanks for the info on the insubordinate Alt key.

Link to comment
Share on other sites

Yes, sorry if I wasn't clear on that. The flickering was there with the vanilla code and preferglsl=true. Actually, it is even worse as there is also white flickering on (bright?) parts, such as roofs and trees. See the screenshot below, taken from the same scenario with vanilla code and preferglsl=true.

I suspect we are talking about different 'errors' :) The flickering is a known issue that can be attributed to existing code in the engine. The odd error messages you got ("preposterous datagram length" and all that), however, is not. So we are curious to know if these error messages happens with the vanilla GLSL renderer or only after you have applied myconid's changes.

Link to comment
Share on other sites

I'm pretty sure this is the problem we discussed, myconid, with the instancing transform.

It is, he's telling us that's fixed. :)

The second screenshot he posted is of the unmodified game, and it has the problem we fixed. The first screenshot only has the shadowmapping problem, which is unrelated.

Link to comment
Share on other sites

@Myconid

1. Congratulations with your new banner ;)

2. Soon I'd love to post an overview with your spectacular work. Whenever you 'finish' something or work on a new feature, please make screenshots/video comparison of vanilla and your work. If this is too much work, I'll ask someone else or give it a go myself. I don't want you to get distracted, but the community would love to see your work in detail. :) Keep it up !

Thanks! :)

At the rate we're going we'll probably have these in by Alpha 11! If not, I'll provide some screenshots. My laptop really sucks at video capture, though (if only I had an SSD!). Or, do you need these before Alpha 11 is released?

Na. hadn't noticed that. Isn't there also a matrix multiplication for the shadows, though?

Yes, but the problem wasn't with matrix multiplications, it was with truncating mat4 into mat3 using the matrix constructors.

Link to comment
Share on other sites

@Myconid

It would be nice if I could post a preview of your work (a special feature report instead of the 'normal' weekly report). But I'll discuss this first with feneur or Jeru. It wouldn't hurt making some screenshots of your progress ( if it is convenient for you) but forget about video capture :)

Link to comment
Share on other sites

Now, this one is interesting. Alt+Enter does not work on my Mac :confused: So windowing the application cannot be done. Going off-topic for a bit: selecting only military units does not work by bandboxing (left click + dragging the mouse) + holding Alt, if I start with pressing Alt. If I drag first, then press Alt, then let go of the mouse button, it works. Pressing Alt first, then dragging, results in panning the view. Although it is completely unrelated to the discussion here, I wonder if this is the correct/desired behaviour or that a ticket must be filed?

Myconid explained the Alt+Enter issue, as for Alt dragging, perhaps the OS is using that keyboard combination? (I think at least some Linux window managers use that combination for moving the window or something, so it's at least a possibility) If that's the case you can always set the keyboard combination to something else, but if it's not it sounds like an actual bug which should be solved.

Link to comment
Share on other sites

Looked it up. The Alt+Enter shortcut is inherited from SDL, and the problem is on their end (the fullscreen toggling is not implemented on Mac yet). As there's no way to change resolutions from inside the game, I guess we can leave this be. :unknw: (Maybe you can try different resolutions in the config, but that probably won't make any difference.)

Just to clarify, Alt+Enter was intentionally disabled on our end because changing resolution or toggling fullscreen on OS X destroys the GL context and we have no way to reload it yet (similar problem on Windows if we used the real libSDL instead of our own emulation). SDL 2 might work around that, but as long as we have to use SDL 1.2 in the foreseeable future, if we want window resizing on OS X, we'll have to figure out reloading the GL context :(http://trac.wildfiregames.com/ticket/741

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...