Oh no! Another shader.
Just a cross between 'tunnel' and 'shockwave'.
For what it's worth.
Played with meatballs(metaballs) but still haven't got complete control over it.
Are there other hidden features in GLSL?
I think that "extern vec2 rand;" should not be an extern.
The "vUv" vector is probably simply tc (or pc, I always invert these two).
Note that I'm not sure at all, but the way you have written it, every pixel is always the same color.
Oh two other things.
- I think that his "tDiffuse" texture is the input texture, so it should simply be the "tex" parameter of the effect function. (if you are not printing texture, I think that cTextureScreen is the "color" parameter. Here is another subtility I haven't totally understood )
- I'm not sure you can send boolean value with LÖVE, there is only float, matrix and texture sending functions. (so the extern bool grayscale should be treated with a float. Or just by commenting/uncommenting the line in if(grayscale))
I'll give a try, I'm quite interested in the result (I'm on a game with home-made CRT screen effects, there's some effects that are not really convincing)
vec3 HSV(float h, float s, float v)
{
if (s <= 0 ) { return vec3 (0.0); }
h = h * 6;
float c = v*s;
float x = (1-abs((mod(h,2)-1)))*c;
float m = v-c;
float r = 0.0;
float g = 0.0;
float b = 0.0;
if (h < 1) { r = c; g = x;b = 0.0;}
else if (h < 2) { r = x; g = c; b = 0.0; }
else if (h < 3) { r = 0.0; g = c; b = x; }
else if (h < 4) { r = 0.0; g = x; b = c; }
else if (h < 5) { r = x; g = 0.0; b = c; }
else { r = c; g = 0.0; b = x; }
return vec3(r+m,g+m,b+m);
}
from pouet.net which probably took somewhere else too:
bloom = love.graphics.newPixelEffect [[
vec2 image_size;
vec4 effect(vec4 color, Image tex, vec2 tc, vec2 pc)
{
vec2 pixel_offset = vec2(1.0)/image_size;
color = Texel(tex, tc); // maybe add a weight here?
color += Texel(tex, tc + vec2(-offset.x, offset.y));
color += Texel(tex, tc + vec2(0, offset.y));
color += Texel(tex, tc + vec2(offset.x, offset.y));
color += Texel(tex, tc + vec2(-offset.x, 0));
color += Texel(tex, tc + vec2(0, 0));
color += Texel(tex, tc + vec2(offset.x, 0));
color += Texel(tex, tc + vec2(-offset.x, -offset.y));
color += Texel(tex, tc + vec2(0, -offset.y));
color += Texel(tex, tc + vec2(offset.x, -offset.y));
return color / 9.0; // use 10.0 for regular blurring.
}
]]
How would I get the above pixelEffect to work? Assuming that this shader is complete here, what exactly do you pass to image_size? Surely tables don't work.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Well, I took StoneCrow's code to finish the adaptation of the film effect (I hope you don't mind )
It works pretty well, I think I will take some parts for my project. The desaturation/illumination that comes with the grain is really cool.