[0.4.4] [Blood] "Delirium Effect" blur is still missing
Moderator: Raze Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
-
- Posts: 1349
- Joined: Tue Nov 05, 2019 6:48 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia with Vulkan support
[0.4.4] [Blood] "Delirium Effect" blur is still missing
Reminder that this has not been re-implemented yet.
-
- Lead GZDoom+Raze Developer
- Posts: 49183
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
I know.
This will require a postprocessing shader.
This will require a postprocessing shader.
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
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.Graf Zahl wrote:This will require a postprocessing shader.
If not for this little issue I'd have happily done it myself.
-
- Lead GZDoom+Raze Developer
- Posts: 49183
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
I think that's a question where only dpJudas may be able to give an answer.
-
-
- Posts: 3134
- Joined: Sat May 28, 2016 1:01 pm
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
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.
-
- Posts: 309
- Joined: Tue Apr 10, 2018 8:14 am
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
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.
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
I'll try it out and attempt to make something later on. Right now I have way too much going on.
-
- Posts: 830
- Joined: Sun Jun 16, 2019 9:17 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Gosford NSW, Australia
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
@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
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
I still haven't gotten around to this.
-
- Posts: 830
- Joined: Sun Jun 16, 2019 9:17 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Gosford NSW, Australia
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
That's all good, thanks for the quick reply
-
-
- Posts: 375
- Joined: Mon Jun 27, 2016 7:26 pm
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia with Vulkan support
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
I came up with a post-processing shader which should approximate the desired blur effect:
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.
Code: Select all
// #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;
}
-
- Lead GZDoom+Raze Developer
- Posts: 49183
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [0.4.4] [Blood] "Delirium Effect" blur is still missing
Closing because we got a duplicate on the Github issues.