Topic: glow shader

Hello smile

I'm doing test with Maratis. I want to use HDR and glow.

Glow is done with two render. A first render with only light and blurred, a second one with normal scene.
The two render are mixed together with an additive blending. This technique is described here.

In maratis I was thinking to use the emit map.

First render (normal)
Second render (with light turned off) (so only thing that will be rendered is emit surfaces)

My question is how I can do the second render ? With a script ? or a plugin ?

And to speed up the second render I want to disable other textures (we don't need normal mapping or specular mapping). How I can do this ? Can I pass to a shader a variable with a plugin ?

Re: glow shader

Hi,

you need to use the plugin system and customize the MGame::draw function (with a custom MGame class),
then using render to texture and a glsl shader.

An exemple here (doing blur) : http://www.maratis3d.org/code/post-process/

Re: glow shader

Ok thanks I will try to build the plugin example for linux smile.

But please add bookmark or something that can remember your last file open. Like blender in the splash screen. It would be perfect. It's annoying to always reopen your project and search it in the root directory sad.

Re: glow shader

( Compiling MyGame.cpp )
MyGame.cpp: In member function ‘virtual void MyGame::draw()’:
MyGame.cpp:216:71: error: invalid conversion from ‘MOCamera*’ to ‘unsigned int’ [-fpermissive]
In file included from /home/jmclemencon/Software/maratis-read-only/trunk/dev/MSDK/MEngine/Includes/MEngine.h:148:0,
                 from MyGame.h:11,
                 from MyGame.cpp:8:
/home/jmclemencon/Software/maratis-read-only/trunk/dev/MSDK/MEngine/Includes/MScene.h:147:20: error:   initializing argument 1 of ‘MOCamera* MScene::getCameraByIndex(unsigned int)’ [-fpermissive]
MyGame.cpp:222:48: error: ambiguous overload for ‘operator*’ in ‘*MOCamera::getClearColor() const()’
MyGame.cpp:222:48: note: candidates are:
MyGame.cpp:222:48: note: operator*(float*) <built-in>
MyGame.cpp:222:48: note: operator*(const float*) <built-in>
make: *** [MyGame.o] Error 1

I have this error sad.

I'm using the SVN version of maratis. I have already corrected the error by using

MOCamera * camera = scene->getCurrentCamera();   

But it doesn't blur sad

Last edited by samυncle (2013-05-20 21:11:45)

Re: glow shader

Hi,
for the pointer thing, yes the example is a bit old, the engine was modified a bit,
some variables was sent as a pointer and it was removed.

If you corrected getScene and getClearColor (remove the *) it should work normally,
did you send the new game class to the engine ? :

MyGame * game = NULL;

void StartPlugin(void)
{
    // get engine
    MEngine * engine = MEngine::getInstance();

    game = new MyGame();
    engine->setGame(game);
}

void EndPlugin(void)
{
    SAFE_DELETE(game);
}