[Discussion] Film Grain, Converting to C2

  • 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

  • A proper film grain would be great. If you could get this working I would love to try it out.

    The noise filter bundled with C2 looks okay, but it's not quite film grain quality.

  • Working on it... Not had any fedback on here as to the way c2 works so I'm just working blind at the moment. I don't have a lot of time at the moment and life is getting to me, but I managed to get it working in shadertoy at the weekend (took til 4am though) so now I understand it better it should be (hopefully) easier to port to c2. Will keep you posted.

  • untune

    I had a look at your 'FilmGrain_v1.1' file...way too complicated for my brain.

    The best I can come up with is this basic noise/image mix effect-

    I will play around with the sums to see if i can improve it.

    Its a start?.

    https://dl.dropboxusercontent.com/u/22173473/filmgrainrequest.rar

    P.S

    ' I don't have a lot of time at the moment and life is getting to me'

    Its only a shader

  • untune

    I had a look at your 'FilmGrain_v1.1' file...way too complicated for my brain.

    The best I can come up with is this basic noise/image mix effect-

    I will play around with the sums to see if i can improve it.

    Its a start?.

    https://dl.dropboxusercontent.com/u/22173473/filmgrainrequest.rar

    Thanks, I'll have a look at this tomorrow

    P.S

    ' I don't have a lot of time at the moment and life is getting to me'

    Its only a shader

    Haha yes I know, it's just been a very tough week! Getting better though I've got a much better understanding of the code now so it should be easier to convert as long as a few things are possible with C2...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I dont want to disturb you and chrisbrobs

    Here is a quick port of this shader from your source ...

    Tell me if it's ok .. i have not added grain amount a,d other parameters just converted it.

    Here is a demo like i love : http://gigatron3k.free.fr/html5/C2/FX/fgrain/

  • I dont want to disturb you and chrisbrobs

    Here is a quick port of this shader from your source ...

    Tell me if it's ok .. i have not added grain amount a,d other parameters just converted it.

    Here is a demo like i love : http://gigatron3k.free.fr/html5/C2/FX/fgrain/

    Nicely done gigatron! I did finally get this working a few nights ago but I've not been well the last couple of days and haven't had the chance to clean up the code etc

  • So , no need for me to finalize this shader fx ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)