Topic: Postprocessing inside the engine?

Hey community!

Since I have postprocessing using GLSL shaders up and running inside my game plugin I would like to integrate this functionality into the Maratis main engine so everyone can use it without messing with an external plugin.
You could simply use it from within your LUA scripts without a major hassle.

Anael: Would you accept such a big patch?

Sponk

Re: Postprocessing inside the engine?

Sponk wrote:

Hey community!

Since I have postprocessing using GLSL shaders up and running inside my game plugin I would like to integrate this functionality into the Maratis main engine so everyone can use it without messing with an external plugin.
You could simply use it from within your LUA scripts without a major hassle.

Anael: Would you accept such a big patch?

Sponk

What would this allow? What does it mean? You can adjust materials without Blender after the fact?

Re: Postprocessing inside the engine?

No, you would have access to postprocessing effects like HDR rendering, radial blur, depth of field etc. via GLSL shaders.

http://en.wikipedia.org/wiki/Video_post-processing ==> Further information

Sponk

Re: Postprocessing inside the engine?

Sponk wrote:

No, you would have access to postprocessing effects like HDR rendering, radial blur, depth of field etc. via GLSL shaders.

http://en.wikipedia.org/wiki/Video_post-processing ==> Further information

Sponk

Wow, so you are currently able to use depth of field in your games? Is it real-time?

Re: Postprocessing inside the engine?

In theory you could do about anything, even depth of field. It's a major GLSL coding job I did not finish yet though.

I was able to do a bloom effect and tonemapping to simulate an HDR effect. I have also done a radial blur shader and some other experiments showing what you can do with GLSL shaders and postprocessing. I will upload some screenshots soon so you can see what can be done with it.

Sponk

PS: http://forum.maratis3d.com/viewtopic.php?id=710 ==> You saw my current screenshots already wink

Re: Postprocessing inside the engine?

Can you upload a patch so those that want it do not have to wait for Anael, I don't think he is paying attention to the forums currently?

I am going to do a diff on your version of maratis for the theme support, I want that also. But I didn't see any commits in regards to the shaders.

Last edited by zester (2013-10-19 08:34:04)

Re: Postprocessing inside the engine?

Hi,

sorry for the late reply, I was working in another town for a week,
it will be valuable to add a simple to use post-processing system to the trunk.

At first it could follow the logic of the camera layer and add two functions to activate/deactivate a post-process shader in lua.
Later we could add something in the editor, but probably only after we move the editor to MGui-v2 (from the experimental branch).

1 : add an "MFXRef * m_FXRef;" to MOCamera to handle the post-processing shaders
there is already "MTextureRef * m_renderColorTexture;" and "MTextureRef * m_renderDepthTexture;" to handle the render to texture.

2 : add the effect rendering to the default MGame::draw

3 : add two lua functions to enable and disable a camera effect. For exemple :

Camera = getObject("Camera")
enableCameraPostProcess(Camera, "shaders/myPostShader.frag")
disableCameraPostProcess(Camera)

4 : in a second time, we also need to add custom variables to the camera to send uniform variables to the shader (to control blur size, focus etc). I'll think about something generic that can create dynamic MVariable.

Re: Postprocessing inside the engine?

Hi,

I now have integrated the code I use in my plugin into the engine.

BUT: It is not per camera. It uses the current camera of the current scene. You can't use camera layers for now or use multiple cameras with pp enabled. I will look into that before proposing a patch.

Sponk

Re: Postprocessing inside the engine?

Hey community!

Here is my status update about my progress with the engine level post processing.

First: The lua part is fully operational. It loads the shader and sets up all needed textures.

Camera layers are now unaffected by having a pp enabled camera.

The render to texture part still needs love. It shows just a red background, what means that all textures are setup correctly. I still have problems when leaving the play mode. You can't see any parts of the scene for now.

Sponk

PS: I completely rewrote the posprocessing code to respect camera layers and utilize the engine functionality better.

Re: Postprocessing inside the engine?

Great work Sponk !
With your post processing effect, and eventually when we have a glow shader,
even basic 3D scenes will start to look really good