[0.4.4] [Blood] "Delirium Effect" blur is still missing

Moderator: Raze Developers

[0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby sinisterseed » Thu Feb 13, 2020 5:55 am

Reminder that this has not been re-implemented yet.
User avatar
sinisterseed
Raze/GZDoom RO Translator & Raze Tester
 
Joined: 05 Nov 2019
Twitch ID: nixchievousfox
Github ID: sinisterseed
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby Graf Zahl » Thu Feb 13, 2020 6:00 am

I know. ;)
This will require a postprocessing shader.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby Rachael » Thu Feb 13, 2020 9:00 am

Graf Zahl wrote:This will require a postprocessing shader.

Is it even possible to write a blur shader without baking the GPU? None of mine have ever done it unless I sampled at really low resolutions and upsampled the result.

If not for this little issue I'd have happily done it myself.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby Graf Zahl » Thu Feb 13, 2020 11:43 am

I think that's a question where only dpJudas may be able to give an answer.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby dpJudas » Thu Feb 13, 2020 12:34 pm

The bloom effect is 8 blur shaders running in sequence. For a single blur effect you just need two runs (vertical + horizontal) with the gaussian blur shader used by the bloom pass.
dpJudas
 
 
 
Joined: 28 May 2016

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby Phredreeke » Thu Feb 13, 2020 12:52 pm

Another problem is that the speed of the delirium effect is tied to the framerate. I remember the first time I saw it in NBlood I thought it was unnaturally fast.
User avatar
Phredreeke
 
Joined: 10 Apr 2018
Discord: phredreeke#6500

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby Rachael » Thu Feb 13, 2020 1:37 pm

I'll try it out and attempt to make something later on. Right now I have way too much going on.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby mjr4077au » Sat Jul 24, 2021 12:02 am

@Rachael just wondering if this is something you ever got around to checking out? I know you're completely strapped for time but just thought I'd ask :)
User avatar
mjr4077au
 
Joined: 16 Jun 2019
Location: Gosford NSW, Australia
Discord: mjr4077au#1027
Github ID: mjr4077au
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby Rachael » Sat Jul 24, 2021 12:21 am

I still haven't gotten around to this.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby mjr4077au » Sat Jul 24, 2021 12:46 am

That's all good, thanks for the quick reply :)
User avatar
mjr4077au
 
Joined: 16 Jun 2019
Location: Gosford NSW, Australia
Discord: mjr4077au#1027
Github ID: mjr4077au
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing

Postby Talon1024 » Fri Jul 30, 2021 1:10 am

I came up with a post-processing shader which should approximate the desired blur effect:

Code: Select allExpand view
// #version 330 core
#define SHADERTOY
#ifdef SHADERTOY

#define INPUT_TEXTURE iChannel0
#define MOUSE_POS iMouse.xy
#define VIEW_RESOLUTION iResolution.xy
#define OUTPUT fragColor
#define TEXCOORD fragCoord/iResolution.xy
#define TIMER iTime

#else

#define INPUT_TEXTURE u_scene
#define MOUSE_POS u_mouse
#define VIEW_RESOLUTION u_resolution
#define OUTPUT gl_FragColor
#define TEXCOORD v_texcoord
#define TIMER u_time

uniform sampler2D INPUT_TEXTURE;
uniform vec2 VIEW_RESOLUTION;
uniform vec2 MOUSE_POS;
uniform float TIMER;

in vec2 TEXCOORD;

#endif

#define BLUR_SAMPLES 3
#define MAX_ROTATION .125
#define BLUR_MIX_FACTOR .25

#ifdef SHADERTOY
void mainImage(out vec4 fragColor, in vec2 fragCoord)
#else
void main()
#endif
{
    vec4 colour = texture(INPUT_TEXTURE, TEXCOORD);
    vec2 mousePos = MOUSE_POS / VIEW_RESOLUTION * 2. - 1.;
    /*
    float ef1 = min(v_texcoord.x, v_texcoord.y);
    float ef2 = 1 - max(v_texcoord.x, v_texcoord.y);
    float edgeFactor = min(ef1, ef2) * 2;
    */
    for (int i = BLUR_SAMPLES - 1; i >= 0; i--)
    {
        float th = mousePos.x * float(i + 1) * MAX_ROTATION;
        mat2 rotation = mat2(cos(th), sin(th), -sin(th), cos(th));
        vec2 rotUv = TEXCOORD;
        rotUv -= .5; // Set rotation pivot point
        rotUv = rotation * rotUv; // Rotate
        rotUv += .5; // Don't show the bottom of the screen
        vec4 blurred = texture(INPUT_TEXTURE, rotUv);
        colour = mix(colour, blurred, abs(sin(TIMER)) * BLUR_MIX_FACTOR);
    }
    OUTPUT = colour;
}


I developed it using ShaderToy and GLSLViewer. You can copy and paste the code into ShaderToy to see what it looks like. On a laptop with a crappy Intel integrated GPU, I get 60FPS on ShaderToy.
Talon1024
 
 
 
Joined: 27 Jun 2016
Github ID: Talon1024
Operating System: Debian-like Linux (Debian, Ubuntu, Mint, etc) 64-bit
Graphics Processor: nVidia with Vulkan support


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests