IndieEffects: Bringing (almost) AAA quality Post-Process FX to Unity Indie

@Baldinoboy: Hmm… Could you show me a screenshot? Does the webplayer work for you? Also, try sending me your project or something so i can test it myself. (that is the most effective way of solving a problem, i believe) Please list your system info as well if you can as that could also be why the screen is dark.

EDIT: CHECK THE SHADERS. sometimes, the scripts don’t assign the shaders properly, so check that Motion Blur(Alpha-Blended) is in the shader field in IndieEffects.

@Tryder: Thanks man, :slight_smile: like to see what you come up with!

@Baldinoboy: Yes sir, you heard that correctly! thre isn’t just god rays/radial blur - YOU WILL ALSO GET VIGNETTING! (Beware though; it is mind-blowing… and a bit too dark in some scenes)

I imported the package into an empty project and it works great.

But for some reason it acts up in another (test) project, which has a lot of assets.

Without effects
1394273--71991--$Screenshot_without_effects.png

With effects
1394273--71990--$Screenshot_with_effects.png
With Blur enabled it gets even darker

Do not have the best internet service so a project upload would take forever. I will do some testing and see what is causing this.
Thanks again for the pack. Really looking forward to the upcoming update.:smile: Also thanks Tryder for your work.

Windows 7
AMD Phenom 9850
4.0 GB
AMD 6670 1.0 GB

1 Like

Indie alert! New files being uploaded!

1 Like

@Baldinoboy:Nice specs! Anyway, check if the Color Enhancer is on. sometimes, dark areas get bad if this is on, so turn it off. As for uploading the project: If your internet is bad, don’t bother, I have to deal with bad internet at times too!

Oh and by the way, thanks for the feedback! Tryder would be very happy to hear from you! (Oh, and here is a secret:Tryder said he might play around with one of my color enhance shaders, so you might get BLOOM in the next release!)
P.S @Baldinoboy: NICE SCENE!!! I could use some of your skills at terrain building! (I’m actually not that bad, but most terrain projects i come up with end up a tiny island with nothing on it!)

ATTENTION EVERYONE: New package (And Webplayer) Uploaded! Enjoy!

1 Like

Great work - I’ll port all the scripts to C# a bit later, maybe put them on my Skydrive for people to download if they want them.

Just one tiny thing though - I think there’s a misunderstanding about god rays, otherwise known as crepuscular rays, sunshafts etc. They don’t really have anything to do with radial blur, that’s why I was confused earlier.

http://en.wikipedia.org/wiki/Crepuscular_rays

They can totally be done in a post-processing effect (as per that Nvidia GPU gems link I mentioned earlier). I remember even Black on PS2 had a great implementation even if it was low res :smile:

@davew_uk: Thanks again, and thanks for mentioning the god ray/radial blur confusion, the god rays aren’t i’ve made aren’t perfect (they are cast from the center at the moment like the radial blur is, not from a light) I might add light-oriented god rays in a next release, or leave it as-is. As for C# porting, go ahead and post a link for the C# version (or you can give me the code so i can upload it if you like) so those who are heavy C# programmers can integrate it easier with their project (I know someone at my school who wouldn’t mind a C# version)

it’s not just a matter of centering the radial blur on a light, I would guess that you also have to do a bright pass, so that only the sun’s glow gets the radial blur effect (and only when it is sufficiently bright) and not any part of the background.

One other thing I did notice yesterday which I found odd - I was looking at the performance issues (its understandably very slow at higher resolutions) and I found that some effects (noticeably the negative colour effect) look better and work quicker without the renderTexture.Apply() call in postUpdate(). Most of them don’t work without it though.

I’ll aim to do the C# port a bit later and will post a link when its done.

I have a Bloom script/shader ready, you can grab it from my Google Drive here:
https://drive.google.com/file/d/0B6BscJ4Cq-K7LVpUMVpWZzhGbkk/edit?usp=sharing

This shader is awfully slow though. It runs through 7 passes, you can speed it up at the cost of quality by removing a pass or two, but do not remove the first or last pass as these are necessary. The first pass converts all pixels below a specified luminance value to black, the next 5 passes blur this new texture with a 10 pixel wide 4 direction box blur and the last pass adds the blurred image to the unmodified game image.

You could probably increase the quality of the bloom by adding in the 4 diagonal directions in the fragC function, but that’s going to double the performance hit. I also tried using a gaussian blur rather than box, and while the bloom had a rounder appearance, the edges didn’t fade much. I might revisit this and experiment more with gaussian.

P.S. I had a thought on centering the God Rays to a particular light using ViewportToScreenPoint, with that you could determine the lamp’s position in screen space and then convert that to UV coordinates for the shader to work on.

@davew_uk: Hmm… I WAS wondering that myself! But when i tried doing this, like you mentioned, half the effects don’t work as well.

I did a bit of research a few days ago, since i was bored, and found out that Texture2D.Apply() is the process that is more expensive, not ReadPixels, but ah well, perhaps i could see what else i can do to give a decent speedup.

@Tryder: Hmm… it doesn’t seem to work, every time i try to use it, this message appears in the console: “D3D assembly failed” and it appears to be an "if statement causing the problem (and unfortunately, there is no bloom…) Oh, and the idea for the god rays could be done, but i can be a hopeless vert/frag shader writer!

Try putting #pragma glsl into all of the passes.

At any rate I’m working on what might turn out to be a better approach.

Cool Bananas! I will try glsl instead and see how it goes. meanwhile, good luck and happy coding Tryder!

EDIT: Just failed again, just said it was riddled with errors. Also, what system are you using (if it uses DX11, that won’t work on mine, I’ve only got Intel HD 3000 and that could also explain the shader problem) Oh, and the error was mentioning FragC over and over with a red symbol!

The new approach I tried isn’t going to work out. The idea was to ignore pixels that were below the luminance threshold and I was able to get twice the speed out of it, but if the screen was filled with pixels at or above the luminance threshold performance dropped to maybe 1 frame per 5 minutes! It was a novel try, but oh well.

I’ll keep working on the current approach and see if I can’t find what the issue is. My system doesn’t support DX11 either, I’m on an ATI Radeon 4100 HD Mobility.

Oh, ok then, Don’t know why it throws up FragC errors then! Hopefully, we can sort this out.

EDIT: just to let you know, I ALMOST got bloom to work, but all my approach did (porting the unity pro fastBloom) was blur the screen without any kind of bloom at all!

For everyone’s info: If you want blur, give me a shout, I got blur by accident when making bloom for this package! (But take note, It’s only horizontal at the moment…)

Keep it up people! This is looking pretty cool.

Go ahead and send me your blur script/shader if you want. My blur shader was the first fragment shader I’ve ever written, I’m sure the Unity dev’s know more about it than I so it might help me fix the D3D error you’re receiving, plus their blur algorithm might be faster than mine.

Ok then, Tryder, time to port the script again! I shouldn’t take too long, and I’ll post a link when done! Oh, and by the way, congrats on your first vertex/fragment shader! Here’s the secret to mine: I ONLY USED ONE FRAME CAPTURE!

EDIT: Here’s the shader the script. The reason why your script may have been slow is because this one only uses one frame capture, whereas yours used several frame captures. only bug is no vertical blur.

Google Drive Link

@NextGen: That’s not just people sir, IT IS AWESOMENESS!!! And you can also thank Tryder for the color balance script. Tryder and I are also working on fake bloom, so keep your eyes, ears and internet connections OPEN!

Tryder, I might be onto something! with the shader, I’ve been able to get the tiniest bit of edge bleeding possible! Let’s see how this turns out!