Sepia Tone / Generic Color Gateway (Postprocessing)

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
linkoraclehero
Posts: 81
Joined: Sat Sep 09, 2006 6:46 am

Sepia Tone / Generic Color Gateway (Postprocessing)

Post by linkoraclehero »

I made up a quick post processing technique that I will work on toward applying Software Bloom / HDRR.

Initialize once (Out of loop):

Code: Select all

video::ITexture* rt = 0;
rt = driver->createRenderTargetTexture(core::dimension2d<s32>(800,800));
Our main loop:

Code: Select all

while(device->run()){
        driver->beginScene(true, true, video::SColor(0,0,0,100));
        driver->setRenderTarget(rt, true, true, video::SColor(0,0,0,255));
        smgr->drawAll();
        driver->setRenderTarget(0);
        SColor tmpColors[4];
        SColor tColor(128,128,0,0);
        tmpColors[0] = tColor;
        tmpColors[1] = tColor;
        tmpColors[2] = tColor;
        tmpColors[3] = tColor;
        smgr->drawAll();
        driver->draw2DImage(rt,rect<s32>(0,0,800,600),rect<s32>(0,0,800,800),0,tmpColors,true);     
        driver->draw2DImage(rt,rect<s32>(0,0,800,600),rect<s32>(0,0,800,800),0,tmpColors,true);
        driver->endScene();
    }
It'll be more power consuming, so I'm working on being able to pixelshade a ITexture, but i will work on doing an additive blend of a scene plus a luminance gateway (r+g+b/3=l), The first demo will most likely be too slow for standard use, but I'll see what I can do. I mostly want to avoid shaders because of the platform dependence.
GuerillaSoftworks
Posts: 83
Joined: Wed May 23, 2007 6:11 pm

Post by GuerillaSoftworks »

Very nice.

The problem your going to have by not using shaders however, is that there will be some serious CPU bashing since effects like these are quite a strain. I'd advice keeping the effects fairly simple if your doing it this way.

Good luck with this. Can't wait to see the results.
Guerilla Softworks

New Guerilla Softworks website under construction - http://guerillasoftworks.awardspace.com
Post Reply