1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Shader idea

Discussion in 'Suggestions & Ideas' started by Asu, Mar 4, 2015.

Mods: Rainbows
  1. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    Heya, think that hasn't be suggested already on this forum.
    So the idea I have is pretty simple, it would be about sending two new infos to the shader by default :
    • A sampler2D containing the previous frame buffer and
    • A delta time float, which is equal to FPS / Baseline.
    These two ideas would allow making simple effects such as motion blur or frame interpolation.
     
    Last edited: Mar 4, 2015
  2. blackjoker77777

    blackjoker77777 Haxor Tester
    1. Zen Laboratories

    Messages:
    441
    well, I didn't understand most of what you are saying... but since you are the one who suggested this I am sure it is pretty useful :p:thumbs_up:
     
    J-man2003 likes this.
  3. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    The previous frame buffer allows a GLSL shader (Such as the smooth shader, but KAG's one doesn't use it) to get the previous frame showed up on the screen. That allows, for example, making motion blur effects, so it looks more "natural" (For once you have >30 FPS and you turned on FPS uncap, which will most likely not your case because of your chipset GPU). In completion to this, the delta time float would allow to adapt the motion blur effect following the FPS so it looks always constant.
     
  4. blackjoker77777

    blackjoker77777 Haxor Tester
    1. Zen Laboratories

    Messages:
    441
    ehhh....w-well...y-yeah...yeah...I...kinda got it
    *pretending to understand AsuMagic*
     
    Blue_Tiger and Asu like this.
  5. Fernegulus

    Fernegulus Bison Rider

    Messages:
    400
    Yeah I guess that it'd be a fun thing to toy around with once it's added.
     
    Last edited by a moderator: Mar 4, 2015
    J-man2003 likes this.
  6. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Lets not drop the nazi shit in here shall we.

    Capturing the previous frame each time is problematic though - we'd have to either switch to triple buffering (more vram), or copy the frame each time if it was turned on (slow, and more vram) - i dont want to do this just so you can add more slow graphics filters on top of the game, haha.

    However: you can actually already send the frame time to a shader though. CDriver has SetShaderFloat and SetShaderInt methods, as well as SetShaderExtraTexture - the latter could MAYBE be used if combined with some way of sampling the screen into a texture but I doubt something's there for that (you can open a file into an imagedata or whatever but I dont think you can turn that into a texture...).
     
    Asu and Noburu like this.
  7. War_Crab

    War_Crab Ballista Bolt Thrower

    Messages:
    39
    But i am a nazi :rekt::rekt::rekt::rekt::rekt::rekt::rekt::rekt::rekt::rekt:
    -snip-
     
    Last edited by a moderator: Mar 4, 2015
  8. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Cool, banned. See you in a week.
     
    Chukka, Blue_Tiger, Asu and 5 others like this.
Mods: Rainbows