Topic: Post Processing supported?

Hi!

Does maratis support post processing effects?

PS It would be nice to add some effects like bloom or depth of field

Last edited by SadWolf (2013-01-06 20:02:58)

Re: Post Processing supported?

Normally it has to be done using a c++ plugin,
but I recently added a feature that can enable render to texture from lua, and the texture can be used to do post process with a shader. Only thing is this method don't give access to depth yet so depth of field will still need to be done in c++ (I think I'll add it for the next version).

"Render to texture" example here : http://www.maratis3d.org/?page_id=53

http://www.maratis3d.org/wp-content/uploads/2012/08/renderToTexture.jpg

Re: Post Processing supported?

I don't have a great knowledge about graphics in C++,
so I have no idea of how to implement such a thing... maybe I'll give it a try too after some research on graphics! smile

but some years ago , i used a little 3d program like maratis to make some model testing suite...
it already has bloom and depth of field, maybe its source could be usefull...

It has a good graphics, but some feature was missing for a complete editor ( the scene editor and the scene tree system )...

here it is...
https://github.com/centralnoise/BlendEL … master/elf

video
http://www.youtube.com/watch?v=qg7_N2-H4Wg

I hope maratis can get this capability...

Re: Post Processing supported?

http://en.wikibooks.org/wiki/OpenGL_Pro … Processing

It doesn't look like complicated, I'll give it a try on my spare time smile

Re: Post Processing supported?

Bloom is already possible using the render to texture technique, it just need a shader, but should not be very complicated, you can look at the shaders of the example from the link I gave you, Bloom can be done a bit like the blur effect but with a contrasted image put in addition of the normal render.

Re: Post Processing supported?

I still have some questions...

1. Can I apply shaders without using the textures system directly on the cam?
2. How does maratis manage shaders? I didn't find any "shader" option , does it pass which shader on the mesh file?

Re: Post Processing supported?

It's in Blender : http://www.maratis3d.org/?p=277
There is a material mode called "CustomShader"

Re: Post Processing supported?

So actually to use shaders I have to:

1 - Create the glsl .frag/.vert files
2 - Apply the shader to a mesh in blender
3 - Render a camera to a texture, so the mesh applies the shader to the texture ( which in reality is the scene of the camera )
4 - Use a second camera to see the shader effect

It's a bit complicated...
And if I write a plugin can I hook the shaders directly to the camera output?

Re: Post Processing supported?

yes, the mesh in blender is in fact just a quad, you can make it one time and reuse it,
or take the one from the example with the t-pot.

With a plugin you can do it directly with code, there is a direct access to the engine so it can do anything.

I'll try to do something more simple in-editor for the next release if I have time.

Re: Post Processing supported?

Maybe a faster way can be implemented in lua:

//this creates automatically the second camera and the mesh
imageOnCam = createShadingFrameBuffer()  // imageOnCam = { mesh = plane with the texture of the primary camera ,  camera = a camera pointing to mesh}
setShader( imageOnCam.mesh , "shaderfile.frag" , "shaderfile.vert" )

but maybe the auxiliary cam will be influenced by the lights of the environment

Last edited by SadWolf (2013-01-07 09:11:42)