HDR + many simple GLSL 2D Filters v2.0

Mmmm… I don’t have lags, but my desktop is a core I7 920, with an ATI 4780… My old desktop has a geforce 6200 and can’t even handle bloom without serious lag, so I can’t really tell how much pc power you need to run these filters without lag…

Hello,

I was looking for a technique to downsample rendered image to 1x1 pixel to get average luminance and found this cool LED shader: http://www.lighthouse3d.com/opengl/ledshader/index.php?page4

screenshots:

http://img29.imageshack.us/img29/1314/pixelate.jpg

http://img14.imageshack.us/img14/917/woweek.jpg

Here is blend:

HDR1.9.blend (195 KB)

btw i use Blender`s “Compress File” function to get 1MB file to 190kb

Changes:

  • I wrote comments for few filters.
  • New Vignetting filter code.
  • Depth of Field shader with and without blurred depth map.
  • Fixed the bug for few filters when in certain camera angle whole screen goes grey. (screen space normals, vignette…)
  • Edge Blur filter - something like fake antialiasing
  • Film Shaders (Technicolor System1, Technicolor System 2) source from here http://abstrakt.vade.info/?p=141
  • I removed motion blur filter (i will remake it from scratch)
  • I removed SSGI filter (i will make color bleed filter instead)

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
p - pixelate/LED display shader
n - normals
b - bloom
l - light scattering
edit:
i accidently uploaded also previous - ATI version, but “HDR1.9” is newer and has all Cloud_GL`s updated shaders :).
download “HDR1.9” I posted before NOT the attached file file below “HDR1.9ATI”

Attachments

HDR1.9ATI.blend (195 KB)

that’s cool, looks like cyber vision or wasp vision lol

btw i use Blender`s “Compress File” function to get 1MB file to 190kb

I see, lol right under my nose XD

NICEEEEE, everything is working perfect, thanks Martinsh ^^

Thanks for all the great filters!
Everything is working perfect.

Wow nice work, I’m looking forward to the color bleed filter.

PS I was taking a walk in the sunset yesterday and realized that real life has HDR.

Hi martinsh,

One filter that I always thought would have been cool would have been a retro spectrum 48k filter.

Split the screen up into 8 x 8 squares, then limit the colours to 2 - the 2 most popular colours in that area, then match the remaining pixels to one of these 2 colours.

  • You could possibly even pre-scale the image down to 256x192 pixels.
  • Maybe even match the final 2 colours to an existing 8 bit palette.

See…

Seeing some games running in ZX Spectrum mode would be pretty cool! :slight_smile:
Mal

awesome work martinsh :ba:
thank you so much :slight_smile:

edit: +1 for some 8bit retro filter

Hehe,
ill take a look how to get real ZX spectrum in GE

But at the moment you can try tweaking “colorBoost” value and you may want to remove circles. You can o that setting “pixelRadius” to 0.8…
here is what i managed to get:

im getting this thing to work:
http://www.gamedev.net/community/forums/topic.asp?topic_id=375169
and Mal, i noticed your name in that thread :smiley:

ok here is the result, it is not quite finished yet, though.

Attachments


Very nice work!

Is there other things I should be doing to optimize this when it is run?
I have an Intel Core 2 Duo [email protected] and an NVIDIA 260 GTX but if I choose 1, 8 or 9 seperately it lags when I look around. It says my frames are 60fps, but there is no way that is true.
If I combine the filters with Retinex it oddly improves the frame rate.

These updates are crazy, so many cool filters! I love the technicolour ones, and the oldschool retro ones your working on at the moment, very nice for recreating old school games.

Any chance of seeing this one in action you mentioned earlier? :cool:
Or are there papers around which could help me write it myself? I had a look around but couldn’t find anything on ‘retina burning effects’. Im guessing it takes values from the HDR effect, like the brightest points, and works out how long theyve been in one spot in the view, and then turns that point black or something along those lines. Thats as much as I’ve worked out so far, I think thats the ‘basic’ idea of how I’d get it working :eyebrowlift2:

theyre so awesome!! you should make something similar to predator vision. that would be epic

Hi martinsh, I’ve been wondering if you know if it could be doable to have access to the buffer with the 2D filters (for exemple making a black outline around objects)
The method that use the textures doesnt work very well as it creates black line over the object too.

short question: Could it be possible to replicate in the BGE what the toon-edge in the render panel can do?

> ok here is the result, it is not quite finished yet, though.

That ROCKS!!! The ZX Spectrum mode would be the most difficult to get working ( due to the 2 colour in 8x8 block issue ), but getting it to work for other systems as part of a retro pack would be cool ( lower resolution, then map to a certain palette - maybe even buffer the display to lower the percieved frame rate ).

Keep up the great work!!!
Mal

Kneel before the awesome power of the ZX Spectrum!

Thanks, people!

@TAMcCullough

Hi,
you may want to disable VSync in NVIDIA Control panel for Blender and take a look at real framerate. On my computer without filters the scene runs at 340fps, with filter 1 enabled - 320fps, i dont call this a lag :), and on your system it should run even faster. There may be a problem with mouse look script.

@AD-Edge

Well basically this filter is very similar to Motion Blur filter in Blender`s 2D Filters actuator. + It requires getting bright parts of rendered image, invert colors of it and do a little blurring.
Unfortunately I cannot use accumulation buffer (to store and then use previously rendered frames) in 2D filters…
so that is on hold.
Same story with motionlur, where i need previously rendered frame to get proper velocity map.

@Mentalturkey

Hmm ok then, :slight_smile:

@Mico27

No, i cannot access normals and verteces of scene, as the 2D Filters is a screen shader. But i can make outline with edge detection and as input using Depth map.
Here is the result that can be achieved. (b) shows edges from depth map.
http://www.jvrb.org/archiv/1159/figure01_big.jpg

@malCanDo

Thanks, I must do a deeper research to achieve detailed color and gradient depiction.

this image is my guide :slight_smile:

edit:
little progress/experiment, but not quite there yet.
http://img196.imageshack.us/img196/8943/hehepa.jpg

Hi!

I made some other tests on different hardware and got camera lags on Geforce 260Gtx but a good framerate.

If the logic consumption becomes higher, (enable more filter) the lags becomse more intensive.

I played with vsync but it still lags with disabled vsync. The effect is, that you have to push the mouse very, very often over the desk, to get a whole turn around. The rotation becomes very slow and is dissrupted alot.

greetings, moerdn

v-sync seemed to help, shame though looks better on.
How do I enable real frames?