Jump to content

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


Recommended Posts

That's fairly weird... Looks like some problem with the eyedir or the move parameters. I'll see if I can reproduce.

BTW, I'd recommend using this texture for the normal: it has no black pixels (the alpha channel is [1-255], as having alpha = 0 means a black pixel), so the lighting is less weird and the parallax too on the rooftiles (see Myconid screenshot for weird lighting).

Edit: yeah, I'm getting the slanting too... Even when I use the loops and stuffs, so it must be somewhere in the calculations.

post-9128-0-48747200-1341654884_thumb.pn

Edited by wraitii
Link to comment
Share on other sites

Got it, I was normalizing the EyeDir vector too soon (in the vertex program) and it resulted in the slanting. I commited the changes.

I've also changed the shader slightly to use only 7 texCoord and not 8 (changes nothing for most people, I guess).

Edited by wraitii
Link to comment
Share on other sites

Nah, I actually called "sundir", and I had forgot to initialize this variable, so the sun direction never changed and was completely buggy. It's fixed.

I've committed an update to the waterShader branch: the size of waves is now scaling with the waviness parameter, so with low waviness you'll get an even better feeling of "little wind".

Edited by wraitii
Link to comment
Share on other sites

I've committed an update to the waterShader branch: the size of waves is now scaling with the waviness parameter, so with low waviness you'll get an even better feeling of "little wind".

I'm getting:

ERROR: Failed to compile fragment program 'shaders/arb/water_high.fp' (line 47): line 46, char 1: error: syntax error, unexpected BIN_OP, expecting ';'
ERROR: CRenderer::EndFrame: GL errors occurred

Link to comment
Share on other sites

I forgot a ";" on the line before.

That worked, but there seems to be an issue with the water shader and the SoD:

S16Tql.jpg

When I enable the water shader under 'Settings', water is rendered even in the areas that are supposed to be covered by SoD.

Link to comment
Share on other sites

When I enable the water shader under 'Settings', water is rendered even in the areas that are supposed to be covered by SoD.

wraitii has fixed this in the latest commit:

aV4Ovs.jpg

While on the topic of the water shader, does any of you know if we could reduce tiling artifacts by adding some Perlin noise?

tQUSSl.jpg

Link to comment
Share on other sites

Probably an easier way would be to use 256x256 textures instead of the 128x128 the game is using now. The scaling issue is actually mainly visible in huge zones of open sea with little waviness in the latest version, because in this case I repeat the texture more so the waves appear smaller.

Link to comment
Share on other sites

I got the grass effect to work, myconid... Looks really nice (though of course lighting is still not really supported). I think you could try to use less layers if you simulated rotating each grass layer to face the camera (in the fragment shader).

Link to comment
Share on other sites

Probably an easier way would be to use 256x256 textures instead of the 128x128 the game is using now. The scaling issue is actually mainly visible in huge zones of open sea with little waviness in the latest version, because in this case I repeat the texture more so the waves appear smaller.

It's less apparent on small bodies of water, but I'd say there is still a subtle repetitiveness that makes it feel more artificial than it has to be.

Link to comment
Share on other sites

@myconid Been tracking the changes in your Github. Nice progress. Any change you could have a branch which merges all the work together? It's nicer to try all the things together.

Ok.

While on the topic of the water shader, does any of you know if we could reduce tiling artifacts by adding some Perlin noise?

Best way to do it is to overlay two different layers of the water texture, one with a slightly scaled UV mapping (e.g. 1.3x the normal one). Should be pretty easy, if you'd like to give it a try.

I think you could try to use less layers if you simulated rotating each grass layer to face the camera (in the fragment shader).

Not sure how that could work...

Link to comment
Share on other sites

Best way to do it is to overlay two different layers of the water texture, one with a slightly scaled UV mapping (e.g. 1.3x the normal one). Should be pretty easy, if you'd like to give it a try.

Yeah, that could probably work too. Can you give me some pointers to how to do that? Would it be similar to the layers you did for the grass?

Edited by zoot
Link to comment
Share on other sites

Yeah, that could probably work too. Can you give me some pointers to how to do that? Would it be similar to the layers you did for the grass?

Nope, it can be done straight from the water shader. Just access the water texture twice, multiplying the UVs with the scaling factor the second time, and then add or multiply the two values together before doing anything else. Or "mix" them:


mix(col1, col2, amount);

amount = 0.5 mixes them equally.

Edited by myconid
Link to comment
Share on other sites

Is it useful to debug on this branch? I get this:

GbcpYl.jpg

And the following errors:

ERROR: CCacheLoader failed to find archived or source file for: ""
ERROR: CCacheLoader failed to find archived or source file for: ""

I've tried resetting the cache, but the issue persists.

This is the commit I am using:

$ git log | head
commit 9f80921728f89c15673b89575cd92a1fa0338470
Author: myconid <christofi.cos@gmail.com>
Date: Sun Jul 8 15:11:07 2012 +0300

merged & ready

Link to comment
Share on other sites

@Myconid: I mean stretching the texture sampling (of the grass) in a perpendicular direction to the eyeDir... I'm not sure how to calculate that, but it could perhaps be done.

BTW... I still get the normal problem with this code:

	vec3 normal = mat3(instancingTransform) * a_normal;

#if (USE_NORMAL_MAP || USE_PARALLAX_MAP)
vec4 tangent = vec4(mat3(instancingTransform) * a_tangent.xyz, a_tangent.w);

And not using this code:

	vec3 normal = (instancingTransform * vec4(a_normal,0.0) ).rgb;

#if (USE_NORMAL_MAP || USE_PARALLAX_MAP)
vec4 tangent = vec4( (instancingTransform * vec4(a_tangent.xyz,0.0)).rgb, a_tangent.w);

Both should work the same, but it appears "mat3" doesn't work properly on my computer.

I can confirm the "bi" water sampling, but I've found it to look slightly weird as the two move at different speeds.

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