A8 Postprocessing Shaders + Framework 0.07 (2013-01-24)

Posted By: HeelX

A8 Postprocessing Shaders + Framework 0.07 (2013-01-24) - 12/16/12 00:30

Hi guys,
I started the development of something that I want to be in the future called "A8 Postprocessing Shaders + Framework".

The first shader is a Vignette Shader:


It is really nothing big yet and I just want to have some fun again. So, if you have nice and simple ideas of what can be added (I bet you will), please tell me smile

download
a8-ppsf-0.07-20130124.rar (~12,93 MB; MIT-license)

effects included in a8-ppsf 0.7:
- Vignette
- Grayscale
- Sepia
- Film Grain Overlay
- Cathode Ray Tube (CRT)
Posted By: 3run

Re: A8 Postprocessing Shaders + Framework - 12/16/12 00:41

This workds really nice laugh Maybe I will use this instead of the panel workaround for current project.
Originally Posted By: HeelX
if you have nice and simple ideas of what can be added (I bet you will), please tell me.
Nice, easy to use and customizable deffered lightning solution, with point/spotlights? grin
Deferred lighting - Alien Swarm SDK + Source
Alien Swarm Deferred Lighting Showcase
I know, that you won't do this.. it's too complex I guess, and will need to spend on it too much of your time..
But this would be really useful! And the thing, that I couldn't afford this to myself, makes me sad frown
Sure, there are some solutions, but they are two slow, or too limited..
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework - 12/16/12 00:46

Hey 3run, deferred shading and deferred ligthning are postprocessing techniques, but they are not easy to implement and require a G-Buffer. I would like to focus on simpler things.
Posted By: 3run

Re: A8 Postprocessing Shaders + Framework - 12/16/12 01:00

Yeah, that was some kind of a bad joke dude, I didn't really meant it for you to implement! laugh
I loved vignette shader, thank you for you time you've spent on it and for sharing it with us as well.

Plus, maybe as you've started with vignette (camera) effect, maybe you could go on, and create dynamic lenseflare effect? laugh Which could be easily added to a camera chain effects via pp_add, so we could combine it with other postprocessing shaders, like hdr etc. That would be awesome I think, but I don't know, is that thing complex or not mate. Sorry if it is, that's the only idea I had in my head for now.
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework - 12/16/12 01:08

Originally Posted By: 3run
dynamic lenseflare effect? laugh


I guess that is possible, I'll put that on my list.
Posted By: 3run

Re: A8 Postprocessing Shaders + Framework - 12/16/12 01:10

I'll be happy to use it in my current horror project and to give you a credit man, your stuff is always great! Thank you.
Posted By: Stansmedia

Re: A8 Postprocessing Shaders + Framework - 12/16/12 06:06

This could be used for so many things! Awesome.
Posted By: 3run

Re: A8 Postprocessing Shaders + Framework - 12/16/12 07:56

Another idea could be motion blur, which will blend from camera movement instead of mouse input. Plus, with ability to do not blur some models (for example, world model used for weapon). This could be great!
Posted By: Ch40zzC0d3r

Re: A8 Postprocessing Shaders + Framework - 12/16/12 09:06

Originally Posted By: 3run
Another idea could be motion blur, which will blend from camera movement instead of mouse input. Plus, with ability to do not blur some models (for example, world model used for weapon). This could be great!


+1 Thats a really nice Idea laugh
Motion blur is a nice effect!
Also, is there a shader which can fake "zooming" of weapons?
Like a DOF just reversed.
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework - 12/16/12 09:15

@3run: A full motion blur where every pixel is smoothed over time is possible. What do you mean by "which will blend from camera movement instead of mouse input"? Excluding models would require, that I know at each pixel, that there is something that I shouldn't blur. If you were able to provide that mask, a masked motion blur would be possible, too.

@Ch40zzC0d3r: You mean the blurring of the weapon or the zoom effect in its lens? The zooming would require a re-rendering of the scene of course. The explicit and static blur of things can be done, but as with 3run's suggestion, I would need a mask for that. A shader that draws the content of a target with a mask onto the screen is possible - you would need that too, for your weapon on that screenshot (or you render it onto the model but that would have been done by you).
Posted By: 3run

Re: A8 Postprocessing Shaders + Framework - 12/16/12 09:43

HeelX@ I guess, I'm not familiar with real motion blur yet laugh Cause at the moment I use simple (native) blur shader, which blurs the screen in the direction of the input values (I use "mickey.x" and "mickey.y", so it blurs the screen in the opposite direction of the mouse movement in my case). But real motion blur effect, will blur the screen from the camera rotation, as it looks like in games (cause I don't know the technique behind it, for me it looks like it blurs from the rotations of the camera). I hope I was more clear now, but my English sucks any way grin
Posted By: 3run

Re: A8 Postprocessing Shaders + Framework - 12/16/12 10:37

Sorry for double post, but I got another idea laugh What about dirt, water, blood and other shader effects on screen? I played recently Modern Warfare 2, and just got this idea in my head. Would be really nice to get one shader, which could be used for those needs, just by changing .tga files and adjusting some parameters.
Posted By: Kartoffel

Re: A8 Postprocessing Shaders + Framework - 12/16/12 12:20

what about a video grain effect and tone mapping?
Simple to create and gives nice results wink
Posted By: 3run

Re: A8 Postprocessing Shaders + Framework - 12/16/12 12:23

They already exist man laugh Tone mapping from Wiki and video grain from Slin collection, if you need them, I can get you some links.
Posted By: Kartoffel

Re: A8 Postprocessing Shaders + Framework - 12/16/12 12:27

Thank you 3run but I'm not really interested in this shader-collection 'cause I'm experienced enough to write my own
...but I have to say it's a nice idea and HeelX will do a great job on it wink
I just wanted to give some ideas and all these pp-effects could be implemented into one single shader for good performance laugh
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework - 12/17/12 21:53

The next effect is something easy: a grayscale shader. It supports 8 different modes. This shader is also a nice example how to use the .technique feature of Gamestudio wink The download link is in the first post of this thread.

Grayscale shader:


P.S: if you use an alpha below 0%, you BOOST your colors by their calculated luminance and if the alpha is above 100%, the colors get INVERTED and are boosted if above 200%!
Posted By: sivan

Re: A8 Postprocessing Shaders + Framework - 12/18/12 12:38

nice toy, can be really useful sometimes, thanks!
Posted By: PadMalcom

Re: A8 Postprocessing Shaders + Framework - 12/18/12 15:16

Really useful, thanks! laugh
Posted By: KingdaKa

Re: A8 Postprocessing Shaders + Framework - 12/19/12 08:59

great work HeelX! Thanks for your efforts
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework - 12/23/12 18:32

I added a Sepia Tone effect with 4 different modes: Tint, Matrix, Duotone and YIQ. The download link is in the first post of this thread.

- Tint: the pixel is converted to grayscale and an offset is added for each R-, G- and B-channel
- Matrix: the pixel's RGB color is multiplied with a matrix which returns a sepia tone
- Duotone: the grayscale value of the pixel is used to blend beween two sepia'ish colors
- YIQ: the pixel's color is converted from RGB color space to YIQ color space, modified to a sepia color and translated back into RGB color space

Sepia effect:


When adjusting the alpha parameter, you can blend the Sepia tone with the original image to control the style of your game. Especially the YIQ- and Duotone-mode are useful. If you change the YIQ-target color and tune down the alpha, you can make the scene "feel" colder or warmer. With the Duotone-mode you can produce arbitrary duotone images.
Posted By: rojart

Re: A8 Postprocessing Shaders + Framework - 12/24/12 01:27

Thanks, will be very helpful.

ppMath.c seems to be useless?
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework - 12/24/12 02:12

Originally Posted By: rojart
ppMath.c seems to be useless?


Ah, yes. Thanks for the hint. Will be removed with the next shader.
Posted By: PadMalcom

Re: A8 Postprocessing Shaders + Framework - 12/24/12 08:58

That even is a feature that AAA-Engines still advertise currently, it looks really good!
Posted By: sivan

Re: A8 Postprocessing Shaders + Framework - 12/24/12 10:39

great to have a pp effect to transform colours colder or warmer, this way my levels have a more integrated appearance, many thanks, I really need it, and merry Xmas!
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework 0.06 (2013-01-06) - 01/06/13 00:56

I added a Film Grain effect. It supports different approaches used in digital photography, films and games. Except simple noise, almost all modes base upon actual film grain samples, as a texture or a video stream. Following is a screenshot, which hardly captures the effect - you have to run the demo in order to recognize the differences; the download is in the first post of this thread.

Film Grain effect:


The first mode is procedural and calculates for each pixel random noise. The other modes tile or scale a grain-texture onto the screen in each different manners. A stream-mode takes a video file from actual film grain footage and streams it on the screen which is done pretty often in the film industry. You can buy footage at Pond5, iStockphoto or Cinegrain.com. Included in the download is a free grain sample.
Posted By: Kartoffel

Re: A8 Postprocessing Shaders + Framework 0.06 (2013-01-06) - 01/06/13 01:31

It's nice to see this progress with always high quality features.

You've done a great job (and I think this will stay the same in the future)
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework 0.06 (2013-01-06) - 01/06/13 12:01

Originally Posted By: Kartoffel
It's nice to see this progress with always high quality features. You've done a great job (and I think this will stay the same in the future)
Thanks Kartoffel smile you were lately into HDR, are you willing to share code so that I can implement it?
Posted By: Kartoffel

Re: A8 Postprocessing Shaders + Framework 0.06 (2013-01-06) - 01/06/13 13:11

Yea, but the code is complex, dirty and needs some optimization grin
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework 0.06 - 01/06/13 13:33

Originally Posted By: Kartoffel
but the code is complex, dirty and needs some optimization grin
That won't be a problem, I guess smile
Posted By: Uhrwerk

Re: A8 Postprocessing Shaders + Framework 0.06 - 01/06/13 14:15

You, Sir, are awesome. I love it. I especially think that your code is beautiful. I can't reason about it, but I'm stunned everytime I have a look at your code about its clarity.
Posted By: rojart

Re: A8 Postprocessing Shaders + Framework 0.06 - 01/06/13 15:13

Thanks again for the new update, very nice effect!
It's only me, or the mode = stream use a very high cpu's performance and was running at ~95%?
Posted By: Kartoffel

Re: A8 Postprocessing Shaders + Framework 0.06 - 01/06/13 15:18

Originally Posted By: rojart
Thanks again for the new update, very nice effect!
It's only me, or the mode = stream use a very high cpu's performance and was running at ~95%?

I didn't look through the code, yet but maybe there's no frame-limitation.
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework 0.06 - 01/06/13 15:40

@Uhrwerk: Thanks, very much appreciated smile

@rojart: I dunno, I just create a bitmap and stream the file onto it; the fps is limited to 60 fps. Nothing special.
Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework 0.07 - 01/24/13 15:50

Added a Cathode Ray Tube (CRT) effect, it renders the screen as if it were displayed on an old fashioned monitor or Television. Modes: scanlines, dot'n'bloom, RGB bars, Magenta/Green bars and RGB triad. It is completely procedural and doesn't need any textures. The image shader was updated, too, you can now move the image as well. All demos support now the possibilty to hide the demo info on the space-key and on 0 you can reset the parameters of the shader.

Cathode Ray Tube (CRT) effect:


download
a8-ppsf-0.07-20130124.rar (~12,93 MB; MIT-license)

Have fun!
-Christian
Posted By: rojart

Re: A8 Postprocessing Shaders + Framework 0.07 - 01/31/13 13:28

Awesome, now is time to remake my Vaders retro game with your pp CRT shader. Thanks again!

Originally Posted By: HeelX
@rojart: I dunno, I just create a bitmap and stream the file onto it; the fps is limited to 60 fps. Nothing special.

Strange, because if I switch to the stream mode, my cpu performance rises up from ~50% to ~90%, check the pictures.


Posted By: HeelX

Re: A8 Postprocessing Shaders + Framework 0.07 - 01/31/13 13:57

Originally Posted By: rojart
strange, because if I switch to the stream mode, my cpu performance rises up from ~50% to ~90%, check the pictures.


I can't do anything about this, sorry... And maybe it is a strange combination between the high framerate and the syncing between Gamestudio and the media_play-stream, because I use the streamed texture in the shader.
© 2024 lite-C Forums