68.31
24.2 fps
512 x 288
More fractal fun! This time with a single pass depth of field effect. MOUSE DRAG to turn WASD & cursor keys to move. SHIFT for speed up. SPACE for another speed up!
Shader Inputs
uniform vec3 iResolution; // viewport resolution (in pixels)
uniform float iTime; // shader playback time (in seconds)
uniform float iTimeDelta; // render time (in seconds)
uniform float iFrameRate; // shader frame rate
uniform int iFrame; // shader playback frame
uniform float iChannelTime[4]; // channel playback time (in seconds)
uniform vec3 iChannelResolution[4]; // channel resolution (in pixels)
uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click
uniform samplerXX iChannel0..3; // input channel. XX = 2D/Cube
uniform vec4 iDate; // (year, month, day, time in seconds)
uniform float iSampleRate; // sound sample rate (i.e., 44100)
xxxxxxxxxx1
// Fractal Explorer DOF. January 20162
// by David Hoskins3
// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.4
// https://www.shadertoy.com/view/4s3GW25
// Missing sound track: https://soundcloud.com/art-zero/zzzzra-a-few-days-of-invinite 6
7
//-------------------------------------------------------------------------------------------8
9
const float GA =2.399; 10
const mat2 rot = mat2(cos(GA),sin(GA),-sin(GA),cos(GA));11
12
vec3 dof(vec2 uv,float rad, float zed)13
{14
rad += 1e-10; // /...divide by zero guard15
vec3 acc=vec3(0);16
vec2 pixel=vec2(iResolution.y/iResolution.x,1.)*0.003, angle=vec2(0,rad);;17
vec3 central = texture(iChannel0, uv, -99.0).xyz;18
rad=1.;19
for (int j=0;j<40;j++)20
{ 21
rad += 1./rad;22
angle*=rot;23
vec4 col=texture(iChannel0,uv+pixel*(rad-1.)*angle);24
acc+= (col.w >= zed) ? col.xyz: central;25
26
}27
return acc/40.;28
}29
30
//-------------------------------------------------------------------------------------------31
void mainImage( out vec4 fragColor, in vec2 fragCoord )32
{33
vec2 uv = fragCoord.xy / iResolution.xy;34
float zed = texture(iChannel0, uv).w;35
float radius = abs(zed-1.)*.1;36
radius*= radius;37
fragColor = vec4(dof(uv, radius, zed-2.), 1.0);38
}Filter
Wrap
iChannel0
Filter
Wrap
iChannel1
Filter
Wrap
iChannel2
Filter
Wrap
iChannel3
I can only see exhausted face of the creator and the amount of hard work. Such an amazing job, stunning, mind blowing!
that looks fun, indeed
Great!
ultrafast, what is it? looks like miracle.
mind blow
Great!! So much details to explore <3
Sir! This is INCREDIBLE and it runs really smooth too! Awesome job
Great fractal, gives a bit of a Christmas feeling :-)
nice frax, dof, and such
Cool!
Very nice!!
Man this is awesome, I feel like in an Alien movie - love the music too!
@eiffie, oh of course. I've put that in and I think I'm getting away with the simpler version.
Atmospheric, super pretty, and your code is always easy to read through.
DOF is trickier than it seems. For instance on distance objects you don't want to pull in samples from nearer pixels that are in focus. (That gives the sharp focused areas jitter around the edges.) The opposite would be true if near items are out of focus - then you WANT to pull in samples from these areas even if your pixel is in focus. Yikes! But this is very pretty.
wow !
I'm using the arrow keys already, if you want to try them.
Dave: no, please avoid "key cursors" like WASD : on non-qwerty keyboard it can be very unconvenient. Arrows keycode are easy to find. or the numeric keypad (but not everybody have one).
Aren't fractals magnificent. Even BBM would be impressed.
You should add VR support
This is beautiful dude.
Mouse drag to turn, ie. you can let go and regrab. WASD or Cursor keys to move. Space or Shift to speed up.