Jump to content

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


Recommended Posts

Github is the ideal solution if you want feedback on your code so you can clean it up prior to it being submitted to Trac. They have many good tutorials themselves, starting here. You will want to fork myconid's repo once you're set up. It should all be quite simple and even enjoyable once you get started.

Edited by zoot
Link to comment
Share on other sites

Assuming you want to remove the messy bits, first go to github and find my repo, fork it and pull the modelmapping branch, copy over the files you are sure you want to change from whatever you are currently using, stage them, commit, push them to github and then initiate a pull request. This will let me merge them with my modelmapping branch.

You may want to keep the water-related and model-related code changes separate, so see if you can create a new branch (from the master branch) for the water.

Edited by myconid
Link to comment
Share on other sites

You may want to keep the water-related and model-related code changes separate, so see if you can create a new branch (from the master branch) for the water.

And if you don't know how to do branches just yet, I can even do them for you. Such is the glory of Git. Main thing is that you get the code up so we can begin tinkering with it.

Link to comment
Share on other sites

It's quite allright ;).

The water shader should be available here. I changed the GLSL script to give the same result as the ARB shader, but I'm not sure I haven't forgotten something so if the GLSL shader acts weirdly, report.

I'll look into the modelmapping issue now.

Link to comment
Share on other sites

It's quite allright ;).

The water shader should be available here. I changed the GLSL script to give the same result as the ARB shader, but I'm not sure I haven't forgotten something so if the GLSL shader acts weirdly, report.

I'll look into the modelmapping issue now.

Woah, careful. Why is your diff looking like this? Did you mangle the line endings?

Link to comment
Share on other sites

Woah, careful. Why is your diff looking like this? Did you mangle the line endings?

Seems like it:


$ file source/renderer/TerrainRenderer.cpp
source/renderer/TerrainRenderer.cpp: ASCII English text, with CRLF line terminators

historic_bruno seemed to have issues with this too - maybe he can chime in with a solution...

Link to comment
Share on other sites

Seems like a definite improvement, well done! I'll test it when I get home.

Haven't checked, but I would guess no. That would require to handle the shadow matrix differently, I think, which I have not done/changed.

wraitii, technically that's a feature request, not a bugfix. ;)

None of the shadowmapping-related stuff is passed into the water shader right now. If you want to try that, you first need to change the terrain renderer code to pass in the shadowmap and shadow transform, and then you need to add code to the shader to actually calculate the shadows. You can have a shot at it, or I might try it later.

I like the shadow on the bottom of the water. Can we have both simultaneously?

Yes.

Link to comment
Share on other sites

Okay, I've pushed the changes to the Modelmapping Branch. I've tried cleaning things up as most as I could, it should work still, but again, I'm not 100% sure. You will need to set "calculateTangents" to true in the game's config file (I haven't changed the warning set by Myconid, but it should now work).

Specular and diffuse normal mapping should be visible on the model Rome_Temple_Mars 2, not yet on terrain.

@Myconid: seeing how much trouble I've had with the two (in the end, fairly basic) patches, I'll try to give a look but I wouldn't swear I can do that.

Edit: water patch doesn't seem to fix #966, sadly.

Edit2: there may be hope for parallax mapping if the computer supports the GL extension "GL_NV_fragment_program2", which came out in 2004

(and which my computer supports, so that's nice).

Edited by wraitii
Link to comment
Share on other sites

Specular and diffuse normal mapping should be visible on the model Rome_Temple_Mars 2, not yet on terrain.

The terrain shaders/renderer aren't finalised yet, so maybe you want to hold off on the terrain shader conversion (I'm hoping to get it done over the weekend).

@Myconid: seeing how much trouble I've had with the two (in the end, fairly basic) patches, I'll try to give a look but I wouldn't swear I can do that.

Okay, let me know if you need any help. :)

Edit: water patch doesn't seem to fix #966, sadly.

Sounds like a regression bug in Alpha 7. Maybe we could see what changed... This reminds me, some people are still having issues with the blinking shadowmap.

Edit2: there may be hope for parallax mapping if the computer supports the GL extension "GL_NV_fragment_program2", which came out in 2004

(and which my computer supports, so that's nice).

I'd advise against that, as that's an Nvidia-only extension! Imho, loop unrolling is the safest way to do it, and maybe we can add preprocessor macros to scale the parallax quality...

wraitii, you still have a problem with GLSL, don't you? We should really figure out what's causing it.

Edited by myconid
Link to comment
Share on other sites

By the way, does anyone know of a way to ascertain that I am using the ARB shader?

If preferGLSL is false and you're using the Shader path, you're definitely using ARB shaders. Mess up the GLSL shaders, run the game, if you don't get an error...

Link to comment
Share on other sites

If preferGLSL is false and you're using the Shader path, you're definitely using ARB shaders. Mess up the GLSL shaders, run the game, if you don't get an error...

Ah, yes. I deleted shaders/glsl. The result is the same.

Also, I get this error:

ERROR: Failed to compile fragment program 'shaders/arb/water_high.fp' (line 82): line 76, char 25: error: expected scalar suffix
ERROR: CRenderer::EndFrame: GL errors occurred

Link to comment
Share on other sites

That's strange... There is no reason for it to crash at this particular point. You're sure you haven't changed anything?

Does it work it you replace the line 76 with something like:

POW fresnel, 0.5, 0.8;

(I mean: no error. The result should be slightly messed up).

@myconid: given that you're using a "while" loop, I have no idea how much I'd need to roll... And anyway the basic ARB shader also hasn't have an "IF" statement. I'll try with the extension and we'll see.

Link to comment
Share on other sites

That's strange... There is no reason for it to crash at this particular point. You're sure you haven't changed anything?

I'm positive. I even did a 'git reset' and recompiled to be certain.

Does it work it you replace the line 76 with something like:

POW fresnel, 0.5, 0.8;

If I do that, the error 'moves' to char 14:

ERROR: Failed to compile fragment program 'shaders/arb/water_high.fp' (line 82): line 76, char 14: error: expected scalar suffix
ERROR: CRenderer::EndFrame: GL errors occurred

Edited by zoot
Link to comment
Share on other sites

According to this spec, the POW instruction takes 2 inputs while you seem to give it 3:


Instruction Inputs Output Description
----------- ------ ------ --------------------------------
POW s,s ssss exponentiate

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