Hi all,
I've been away from all this for a while and alhough I have ideas swimming around, I'm usually too busy to work on much. I revisited an old project a few days ago and have been playing with various effects to give things a certain look - I had left the 'noise' effect on the layout and although it works nicely I was wondering if there might be a way to implement a more accurate 'film grain' style effect.
There is already a great shader available here http://devlog-martinsh.blogspot.fi/2013/05/image-imperfections-and-film-grain-post.html (or for the code, see here https://dl.dropboxusercontent.com/u/11542084/FilmGrain_v1.1 ) that I have been trying to convert over to c2 but naturally, nothing is working as expected. I'm at work currently and can't access the code I had been modifying, but I wanted to check I wasn't just hitting c2 limitations as I was getting constant errors - seemingly with the initial declaration of variables, and the c2 effect template was a bit confusing (I also found that there is an additional parameter in the stock c2 effects such as noise that doesn't appear in the effect template XML file - to do with opacity I think). I keep having it crash complaining about a syntax error with 'mediump' - there are a lot of vaiables in there and I'm not sure how it handles things.
Does every float need to be explicitly assigned a precision? I tried precision mediump float at the beginning but no luck. Is there a way to get the game's X and Y resolution, as it seems to be relevant in this shader? Can C2 handle multiple functions in the shader outside of the main function call? Forgive me if anything is obvious but I just want to avoid wasting time if I won't be able to get it working!
EDIT I also removed the code relating to coloured noise as I wanted to keep it monochrome, I thought it may speed things up slightly
Cheers