sidebar features
sidebar content

Go Back   Blender Artists Forums > Game Engine > Game Engine Resources

Reply
 
Thread Tools
martinsh's Avatar
martinsh martinsh is offline
Member
 
Join Date: Oct 2006
Location: riga, latvia
Posts: 482
Hey
Recently i`ve been trying to implement SSGI (screen space global illumination) and HDR (tonemapping with auto exposure) in Game Engine.

I couldn`t get SSGI to work as BGE doesn`t have Normal Buffer yet. Otherwise it works really well.
HDR is still work in progress, but while making it, I came up with these simple filters.


screenshot:


and a blend
Few_Simple_Filters.blend


Controls:

1 - noise
2 - vignette
3 - retinex

mouse/wasd - rotate/move camera
mouse wheel - change retinex value
up/down - noise amount
left/right - vignette size

______________________________________________
edit:

HDR is here:
HDR.blend

It will run properly only with Blender 2.49RC3 or newer build.

Controls: same as before.
only now press 1 to enable HDR rendering.
2 - noise
3 - vignette
4 - retinex

screenshot showing difference in exposure:



video, with filter in motion
http://www.youtube.com/watch?v=8bO9enLeJig


Luminance info is taken form 5 points close to center of the screen.
_________________________________________________

version 2.0

HDR2.0.blend

controls:
1 - HDR
2 - Noise
3 - Vignette
4 - Retinex
5 - Gamma correction
6 - barrel Distortion
7 - underwater-like screen distortion
8 - DoF with blurred depth map
9 - DoF without blurred depth map
0 - edge blur filter

i - technicolor 1 Film Filter
o - technicolor 2 Film Filter
n - normals
b - bloom
l - light scattering

z - ZX Spectrum 1
x - ZX Spectrum 2
r - Radial Blur
p - BleachBypass
j - color channel remapping with curves
............................................
www.martinsh.co.nr - gallery is broken..

Blender artworks:
Shotgun
Assault Rifle
Realtime Bathroom Demo
Advanced GLSL 2D Filters

Last edited by martinsh; 04-Jul-09 at 19:31.
#1   Old 20-May-09, 00:03   
Reply With Quote


B-theawsomegeek's Avatar
B-theawsomegeek B-theawsomegeek is offline
Member
 
Join Date: May 2009
Location: the place i'll always call home.
Posts: 73
cool!
nice work!
............................................
i do voice acting, so if anybody needs a voice actor for a animation of anything im here.



HI, don't forget to be random.... and remember, the world began and will end with cheese, your fate rests with the cheeses, its thought commands all things, like..."bom bom bom" the end of blender! (wakes up) O.O ...no...it cant be....



To be continued.... maybe...

CBM "rawrrrr......"
#2   Old 20-May-09, 01:00   
Reply With Quote
sick's Avatar
sick sick is offline
Member
 
Join Date: Jan 2008
Posts: 329
That's awesome!

I was thinking today about controlling bloom through properties,
and the retinex filter does exactly what I wanted.

Thanks a lot martinsh!
............................................
http://thisroomthatikeep.blogspot.com/
#3   Old 20-May-09, 03:23   
Reply With Quote
Mico27's Avatar
Mico27 Mico27 is offline
Member
 
Join Date: Jul 2007
Location: Canada, Quebec
Posts: 603
mm nice! so the retinex filters is like the reverse of a bloom shader right?
............................................
when you ASSUME you just make an ASS of U and ME.
e-mail: mickaelfortier616@msn.com
#4   Old 20-May-09, 04:28   
Reply With Quote
martinsh's Avatar
martinsh martinsh is offline
Member
 
Join Date: Oct 2006
Location: riga, latvia
Posts: 482
Well technically yes, reverse of retinex looks like a bloom. Actually that`s how i accidentally came up with retinex. But retinex itself doesn`t look like reverse of bloom .
Reverse of bloom looks like this:
............................................
www.martinsh.co.nr - gallery is broken..

Blender artworks:
Shotgun
Assault Rifle
Realtime Bathroom Demo
Advanced GLSL 2D Filters
#5   Old 20-May-09, 12:04   
Reply With Quote
Cloud_GL's Avatar
Cloud_GL Cloud_GL is online now
Member
 
Join Date: Sep 2007
Location: Viña del Mar, Chile
Posts: 786
Quote:
I couldn`t get SSGI to work as BGE doesn`t have Normal Buffer yet.
Getting it by nodes won't do if it can't be accesed by buffer? It would be like applying the filter on the material tough...

http://blenderartists.org/forum/showthread.php?t=156301
#6   Old 20-May-09, 14:25   
Reply With Quote
martinsh's Avatar
martinsh martinsh is offline
Member
 
Join Date: Oct 2006
Location: riga, latvia
Posts: 482
I just finished High Dynamic Range 2D Filter.
Done with cooperation with Mike Pan (mpan3) and Dalai Felinto (dfelinto).

blend:
HDR.blend
It will run properly only with Blender 2.49RC3 or newer build.

screenshot showing difference in exposure:



without and with HDR enabled



video, with filter in motion
http://www.youtube.com/watch?v=8bO9enLeJig

Controls: same as before.
only now press 1 to enable HDR rendering.
2 - noise
3 - vignette
4 - retinex

Luminance info is taken form 5 points close to center of the screen.
............................................
www.martinsh.co.nr - gallery is broken..

Blender artworks:
Shotgun
Assault Rifle
Realtime Bathroom Demo
Advanced GLSL 2D Filters

Last edited by martinsh; 20-May-09 at 20:31.
#7   Old 20-May-09, 15:28   
Reply With Quote
Azan's Avatar
Azan Azan is offline
Member
 
Join Date: Apr 2009
Posts: 49
I was joking when i said next week, but you really did it. Good job.


Quote:
Originally Posted by martinsh View Post
I couldn`t get SSGI to work as BGE doesn`t have Normal Buffer yet.
I don't know much about GLSL, but maybe this link could be useful for you:
http://www.gamerendering.com/2008/09...-screen-space/



By the way: you can bake the radiosity to texture:
http://vi-wer.de.tl/Lightmap-Tutorial.htm

But please use the "selected to Active"-Button in the bake panel.
#8   Old 20-May-09, 21:08   
Reply With Quote
Sim88 Sim88 is offline
Member
 
Join Date: Aug 2006
Posts: 1,504
OOh.......MYGAD![/Janice]

awesome! The first three works but the HDR doesn't run as it should, or not at all. It prints the full script to the console then
Quote:
ERROR: 0:36: 'pow' : no matching overloaded function found
ERROR: 0:36 '=' : cannot convert from const float to 'noperspective 4-component vector of float'
ERROR 0:38 'pow' : no matching overloaded function found
ERROR 3 compilation errors. No code generated
#9   Old 20-May-09, 21:58   
Reply With Quote
Ace Dragon Ace Dragon is offline
Banned Member
 
Join Date: Feb 2006
Location: Wichita Kansas
Posts: 12,952
The work is amazing, however it produces too dark an image to be called a lighting enhancer, so I took the two lines of code that said
Code:
float contrast = avgL*4.0; float brightness = contrast*0.2;
And changed it to
Code:
float contrast = avgL*2; float brightness = contrast*0.23;
The new values are underlined, and are specifically for allowing the 2D filter to produce a reasonably bright image so as to enhance the atmosphere provided by the current lighting instead of darkening the scene significantly.

To everyone reading, these two values are all you need for lots of darkness/brightness/contrast variation provided by this filter and you don't really need to be a programmer just to change a couple of numbers.
#10   Old 20-May-09, 22:29   
Reply With Quote
gomer's Avatar
gomer gomer is offline
Member
 
Join Date: Dec 2004
Location: canada
Posts: 458
Doesn't seem to work on ATI card.

Heres a full copy of the error that gets printed: http://www.pasteall.org/5669/text

It's the same error as the one Sim88 had.
............................................
Nanoshooter
#11   Old 21-May-09, 00:09   
Reply With Quote
locadax locadax is offline
Member
 
Join Date: Mar 2009
Posts: 52
Looks awesome, they are make magic!
#12   Old 21-May-09, 04:34   
Reply With Quote
vitorbalbio's Avatar
vitorbalbio vitorbalbio is offline
Member
 
Join Date: Nov 2008
Location: Rio de Janeio - Brasil
Posts: 484
Fantastic Martinsh!!!!
Absolutaly Amazing!
............................................
Starats Studio! Brasil tb tem Blendero!
Blog: http://obalbio3d.wordpress.com/
Ruínas2.0 : http://blenderartists.org/forum/showthread.php?t=152668
"O Blender não é mt carismático mas.... "
#13   Old 21-May-09, 04:42   
Reply With Quote
psychotron's Avatar
psychotron psychotron is offline
Member
 
Join Date: Jul 2007
Posts: 229
wow great work!! many thanx
dreams come true to BGE
#14   Old 21-May-09, 09:46   
Reply With Quote
+peter's Avatar
+peter +peter is offline
Member
 
Join Date: Mar 2007
Location: Ibaraki, Japan
Posts: 234
Quote:
Originally Posted by gomer View Post
Doesn't seem to work on ATI card.

Heres a full copy of the error that gets printed: http://www.pasteall.org/5669/text

It's the same error as the one Sim88 had.
Same here.
BLA ... stupid ATI card
#15   Old 21-May-09, 10:38   
Reply With Quote
mziskandar mziskandar is offline
Member
 
Join Date: Nov 2008
Posts: 117
Quote:
Originally Posted by +peter View Post
Same here.
BLA ... stupid ATI card
Joining you with 9600xt
Not working..
............................................
Visit my Realtime 3D Projects http://digitalspine.blogspot.com
#16   Old 21-May-09, 11:57   
Reply With Quote
dusty ghost's Avatar
dusty ghost dusty ghost is offline
Member
 
Join Date: Apr 2008
Posts: 121
WOW!!!! It keeps getting better and better!!!
............................................
-----------------------------------------------
I used to be dustbin1_uk
#17   Old 21-May-09, 12:41   
Reply With Quote
martinsh's Avatar
martinsh martinsh is offline
Member
 
Join Date: Oct 2006
Location: riga, latvia
Posts: 482
Here is HDR that should work also on ATI cards. It is without bloom, but you can enable it with retinex filter separately.

HDR1.3.blend
............................................
www.martinsh.co.nr - gallery is broken..

Blender artworks:
Shotgun
Assault Rifle
Realtime Bathroom Demo
Advanced GLSL 2D Filters
#18   Old 21-May-09, 13:04   
Reply With Quote
psychotron's Avatar
psychotron psychotron is offline
Member
 
Join Date: Jul 2007
Posts: 229
martinsh can you look at problematics of tone and gamma corrections and introduce some 2d filter for it please?
would be nice to have gamma corrected BGE output... it's easier to make more photorealistic look (altought if one want use it it will introduce use of linearized colors for materials/textures.. but who cares it's just one more step to do in gimp)

see here:
what's going on - http://www.ypoart.com/tutorials/tone/index.php
thread about it using composite nodes on render output - http://blenderartists.org/forum/showthread.php?t=119205

here is your hdr1.jpg with tone and gamma correction to see difference
Attached Images
File Type: jpg hdr1_gamma_corrected.jpg (120.6 KB, 74 views)
#19   Old 21-May-09, 13:22   
Reply With Quote
ShadowFox ShadowFox is offline
Member
 
Join Date: Mar 2009
Posts: 17
This is amazing!

I remmember previously looking at this, when you had the reflection mirror objects, you used mouse.py to allow the mouse to freely move the camera, you wouldnt happen to have a link to a tutorial for that would you?
#20   Old 21-May-09, 14:13   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 18:49.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists