Can I do 'old movie noise' with the particle system?

  • #1, z tor.brandtWednesday, 19. October 2016, 14:16 hodinky 8 years ago
    I want to have a layer of 'old movie' noise over my entire game.
    Basically it just has to be small grains/particles moving about randomly over all the other graphical elements of the game.

    I guess it could be done by animating a handful of full screen-sized images with alpha-blended noise, and then running that animation over all scenes, but I guess that's a pretty crude - and probably needlessly system-consuming - way to do it.

    So I was wondering if it would actually be possible to do something like that with the Visionaire particle system?

    Bažant

    22 Posts


  • #2, z afrlmeWednesday, 19. October 2016, 14:39 hodinky 8 years ago
    Actually you can use the openGL shader for that. There's already a premade old movie effect.

    If you haven't already included the shader toolkit in your project then you need to create a new script in the script section of the editor & copy/paste the script from this page into it.

    Quick note: the shader screen fx presets affect the entire screen including interfaces & mouse cursors, so if you want to exclude them from the effect you need to add a line of code to the top of the shader toolkit script.
    game.ShaderExclude = eShaderExcludeInterfaces -- exclude fonts, cursor and interfaces

    ... that will exclude cursors, fonts & the mouse cursor from the screen fx. Alternatively you can use...
    game.ShaderExclude = eShaderExcludeTextsAndCursor -- exclude fonts and cursor

    or...
    game.ShaderExclude = eShaderExcludeCursor -- exclude cursor


    Moving on... for the noise effect you can use 2 different options. Either way you will need to add the required line of code into a execute a script action part.

    1. shader noise
    shaderNoise(1, -0.1, 0) -- activate noise in 0ms with a soft black grain

    2. old movie effect
    shaderAddEffect("tv1")


    For more information on the shader check out the shader sections available on the script index page of the wiki.

    Quick note: I've not gotten round to documenting all the shader effects yet, but you can probably get the gist of how they work from the ones I have finished documenting.

    Imperátor

    7285 Posts

  • #3, z NigecWednesday, 19. October 2016, 14:44 hodinky 8 years ago
    I used a program called Swish max but it looks like they've packed in.
    Sqirlz Water Reflections can do rain which you could adapt to static, I think I used that last time but it was only static on black.

    As for the particles, I have no idea, it'll probably look like rain/snow, Swish was fantastic because it could do drag lines
    http://www.xiberpix.net/SqirlzReflect.html

    edit or do what Lee says.. seems like a better plan smile

    Zabiják klíčů

    635 Posts

  • #4, z tor.brandtWednesday, 19. October 2016, 14:55 hodinky 8 years ago
    Thanks for the replies!

    Nice, I wasn't aware of the Shader toolkit at all.
    I think I'll try and go with that - seems like the easiest way to go smile

    Thanks!

    Bažant

    22 Posts

  • #5, z tor.brandtWednesday, 19. October 2016, 15:07 hodinky 8 years ago
    Now I created a script under "Scripts", called it "Shader", checked it as a definition script, and pasted the shader Main Script into that script.

    I then made an execute script action for the beginning of a scene, and pasted
    game.ShaderExclude = eShaderExcludeInterfaces -- exclude fonts, cursor and interfaces
    
    shaderNoise(1, -0.1, 0) -- activate noise in 0ms with a soft black grain
    
    shaderAddEffect("tv1")

    into that.

    However, nothing happens when I run the scene... What have I done wrong?

    Bažant

    22 Posts

  • #6, z afrlmeWednesday, 19. October 2016, 15:37 hodinky 8 years ago
    1. add the game.ShaderExclude line to the top of the shader toolkit script.

    2 & 3. Only use 1 of these functions, not both of them.

    In regards to the script section... when you create a new script it's set as definition type automatically, so you don't need to mess about with the checkbox in the properties tab.

    Can you post screenshots of what you have done please?

    Imperátor

    7285 Posts

  • #7, z tor.brandtWednesday, 19. October 2016, 15:49 hodinky 8 years ago
    Okay, thanks for the corrections smile

    Here are some screenshots.
    Let me know if you need screenshots of other things, but these should be the only two that matter, I think.

    Bažant

    22 Posts

  • #8, z afrlmeWednesday, 19. October 2016, 16:15 hodinky 8 years ago
    It's not doing anything? Have you checked the log file? Did you make sure you copied all of the shader toolkit script? It's a large script so it's easy to accidentally not copy the entire thing - wish the wiki had an option to be able to add a button to select all the text inside of the code block as it would make things so much easier. I might look into a button again at some point...

    & you definitely set it as a definition script? Not "execution" type script. If you unticked the checkbox then it will require the script to be manually loaded which isn't desired as we need it to automatically load on game launch.

    https://i.gyazo.com/88924f20f78d9b95b93e23f6e0ee0db4.png


    Anyway, both shaderNoise() & shaderAddEffect() functions are working ok for me as you can see in the screenshots below.

    Imperátor

    7285 Posts

  • #9, z tor.brandtWednesday, 19. October 2016, 16:20 hodinky 8 years ago
    Okay, now I found out I hadn't actually got the whole thing copied, even though I thought I'd been careful to do so smile

    Now it's working.

    Thanks for your help!

    Bažant

    22 Posts

  • #10, z afrlmeWednesday, 19. October 2016, 16:26 hodinky 8 years ago
    No worries mate. I attached a couple screenshots & more information to my message above yours.

    Imperátor

    7285 Posts

  • #11, z tor.brandtWednesday, 19. October 2016, 16:32 hodinky 8 years ago
    Is there a way to adjust the noise?

    I'm thinking specifically of adjusting the speed of its movement, the size of the 'particles', and perhaps even the way they're scattered...

    Bažant

    22 Posts