Jump to content

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


Recommended Posts

While I was fiddling with the shaders, I noticed that the Roman civil center didn't have parallax on the front bit, so I tried adding it by setting the material to "player_trans_parallax_spec.xml", and it gave an error, so I looked at the file and found that out that it had what seems to be an old version of the parallax material setting, so I had to copy the parallax setting from "player_trans_ao_parallax_spec.xml" to the it. It worked after that, but it seems like setting the quality in local.cfg doesn't disable the parallax on the front bit, only the main model. Any ideas why that might be, myconid?

Btw, I'm actually the one who made the roman_struct2 normal/spec maps. If you notice anything that looks wrong, then you should tell me, preferably on IRC since I don't check the forums that much.

Edit: Also, does anyone know how to bake ambient occlusion with a transparent-textured object on top of the AO object? The way it's doing it for me, it acts like the transparent polygons are opaque.

One more thing... is it impossible to have parallax on terrain?

Link to comment
Share on other sites

I have tweaked the parallax shaders a bit. I managed to fairly successfully remove the stepping artefacts, but the aliasing artefacts due to the step size still remain.

A before/after comparison is http://imgur.com/a/5ivAp . It is pretty cheap which is nice. I had a go at trying to remove the aliasing artefacts but wasn't very successful.


@@ -121,11 +124,14 @@
#endif

s = 1.0 / iter;
+ float t = s;
move = vec2(-eyeDir.x, eyeDir.y) * scale / (eyeDir.z * iter);
vec2 nil = vec2(0.0);
+ float height2 = 1.0 + s;

#define PARALLAX_ITER {\
- height -= s;\
+ height -= t;\
+ t = (h < height) ? s : 0.0;\
vec2 temp = (h < height) ? move : nil;\
coord += temp;\
h = texture2D(normTex, coord).a;\
@@ -162,11 +168,15 @@
PARALLAX_ITER
PARALLAX_ITER
#endif
#endif
+
+ float hp = texture2D(normTex, coord - move).a;
+ coord -= move * ((h - height) / (s + h - hp));

Link to comment
Share on other sites

While I was fiddling with the shaders, I noticed that the Roman civil center didn't have parallax on the front bit, so I tried adding it by setting the material to "player_trans_parallax_spec.xml", and it gave an error, so I looked at the file and found that out that it had what seems to be an old version of the parallax material setting, so I had to copy the parallax setting from "player_trans_ao_parallax_spec.xml" to the it. It worked after that, but it seems like setting the quality in local.cfg doesn't disable the parallax on the front bit, only the main model. Any ideas why that might be, myconid?

You need to have an "alternative" entry that points to a material. There was some discussion about that in this thread.

Btw, I'm actually the one who made the roman_struct2 normal/spec maps. If you notice anything that looks wrong, then you should tell me, preferably on IRC since I don't check the forums that much.

Oops, sorry. I thought it was Wijitmaker.

Edit: Also, does anyone know how to bake ambient occlusion with a transparent-textured object on top of the AO object? The way it's doing it for me, it acts like the transparent polygons are opaque.

Hmm, it shouldn't matter (much), I think. The shader applies the transparency from the diffuse texture to the AO as well.

One more thing... is it impossible to have parallax on terrain?

No. The terrain blending wasn't playing nice with it, so I removed it. Maybe at some point I'll have a random flash of genius and return to it.

I have tweaked the parallax shaders a bit. I managed to fairly successfully remove the stepping artefacts, but the aliasing artefacts due to the step size still remain.

A before/after comparison is http://imgur.com/a/5ivAp . It is pretty cheap which is nice. I had a go at trying to remove the aliasing artefacts but wasn't very successful.

Works for me. Go ahead and commit it, if you haven't already.

Link to comment
Share on other sites

You need to have an "alternative" entry that points to a material. There was some discussion about that in this thread.

Ahhh, I was wondering what that was supposed to be for.

Hmm, it shouldn't matter (much), I think. The shader applies the transparency from the diffuse texture to the AO as well.

No, what I mean is I'm trying to bake AO on an building that has a *prop* with transparency (the Roman corral, specifically, though there are others with the same vines on them). When I bake it, even if I set it to Z transparency or raytraced transparency on the prop, it still acts like the polygons are opaque.

Link to comment
Share on other sites

No, what I mean is I'm trying to bake AO on an building that has a *prop* with transparency (the Roman corral, specifically, though there are others with the same vines on them). When I bake it, even if I set it to Z transparency or raytraced transparency on the prop, it still acts like the polygons are opaque.

"Receive Transparent" option in Material/Shadow?

Link to comment
Share on other sites

Just had a chance to update SVN and try this out - here are the errors I'm getting on some older hardware:


ERROR: CRenderer::EndFrame: GL errors occurred
ERROR: Failed to link program 'shaders/glsl/model_common.vs'+'shaders/glsl/model_common.fs': Fragment info ------------- 0(61) : error C5041: cannot locate suitable resource to bind parameter "v_eyeVec"
ERROR: Failed to compile vertex program 'shaders/arb/overlayline.vp' (line 1):

Here are my old system specs:

OS : WinXP SP 3 (5.1.2600)

CPU : x86, AMD Athlon 64 FX-55 Processor (1x1x1), 2.61 GHz

Memory : 3072 MiB; 1765 MiB free

Graphics Card : NVIDIA GeForce 7950 GT;

OpenGL Drivers : 2.1.2; nvoglnt.dll (6.14.13.0124)

Video Mode : 1920x1080:32

Link to comment
Share on other sites

Wijit, that's similar to the problems we had with fabio's old card. There are too many "varying" interpolated variables for the hardware to handle.

We tried working around it at some point, even. While we did get it to work on his hardware initially, it completely broke shadows for me (yet another driver bug, I think), so I gave up on it in the end.

Link to comment
Share on other sites

Set materialmgr.quality to something like 5. If you're lucky, everything except parallax should work. You might still run into errors if people haven't been setting their "alternative"s up correctly, though nothing fatal.

Do you think it may be a driver issue? Would updating my driver perhaps help - I don't think I've done that in a while... and only one way to find out ;)

Link to comment
Share on other sites

Do you think it may be a driver issue? Would updating my driver perhaps help - I don't think I've done that in a while... and only one way to find out ;)

Doubtful. Might as well give it a shot, though.

I just figured out that only faces that are set smooth are showing the artifact (I made the sides of the Roman walls smooth while doing AO for them, and the artifact was quite obvious on the broad side of them).

That makes sense, actually, as I don't think parallax and smooth shading can mix very well... Where you use smooth shading you can try setting the heightmap values to white, to disable parallax.

Link to comment
Share on other sites

That makes sense, actually, as I don't think parallax and smooth shading can mix very well... Where you use smooth shading you can try setting the heightmap values to white, to disable parallax.

The textures are shared between too many buildings to remove the parallax from even a small section of the texture. Is there some way that you could make it disable smooth shading when parallax is turned on or something?

Link to comment
Share on other sites

Afraid not. Smooth shading uses a different normal for every vertex, whereas flat shading uses the same normal for all face vertices and these are generated in your 3d software, not in the engine. I could recalculate the normals when generating tangents, but that would force smooth shading off on everything.

The best solution is to separate the smooth surfaces from the main mesh, add them as a prop and use a different material that has no parallax...

Link to comment
Share on other sites

That makes sense, actually, as I don't think parallax and smooth shading can mix very well... Where you use smooth shading you can try setting the heightmap values to white, to disable parallax.

But there's already smooth faces showing parallax effect without artifacts. See i.e. red columns in roman CC. (I also tested to smooth columns in mars_temple2 to get rid of their columns blocky effect and no artifacts appeared (not commited btw)

Link to comment
Share on other sites

Okay, is there anything different about those models from the camp model that Zaggy has issues with?

The only thing I can think now is that those faces are perfectly flat, but are smoothed out. I'm going to check it and edit this post if confirmed.

EDIT:

Confirmed, flat faces with smooth shading may cause that problems. Can't commit now, I'm in a hurry, but if Zaggy reads this, he can make a list where he finds this artifacts to fix them setting the faces to "flat"

Edited by Enrique
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...