No WebGL available :(
68.31
24.2 fps
512 x 288
Fractal Explorer DOF
131
Views: 19126, Tags:
Created by Dave_Hoskins in 2016-01-21

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)
Compiled in 0.0 secs
623 / 7820 chars

Filter
Wrap
iChannel0

Filter
Wrap
iChannel1

Filter
Wrap
iChannel2

Filter
Wrap
iChannel3
Comments (22)
Sign in to post a comment.

Tsiukh, 2025-02-09
I can only see exhausted face of the creator and the amount of hard work. Such an amazing job, stunning, mind blowing!
oddmustache, 2025-02-08
that looks fun, indeed
Pozzi, 2025-02-01
Great!
DerShade, 2025-01-17
ultrafast, what is it? looks like miracle.
ReplicaBagsOnline, 2025-01-10
mind blow
Kris_Katur, 2025-01-07
Great!! So much details to explore <3
Joshy20XX, 2024-12-30
Sir! This is INCREDIBLE and it runs really smooth too! Awesome job
pelleman, 2024-12-18
Great fractal, gives a bit of a Christmas feeling :-)
jeyko, 2019-05-03
nice frax, dof, and such
jt, 2016-01-27
Cool!
BigWIngs, 2016-01-23
Very nice!!
trapzz, 2016-01-22
Man this is awesome, I feel like in an Alien movie - love the music too!
Dave_Hoskins, 2016-01-22
@eiffie, oh of course. I've put that in and I think I'm getting away with the simpler version. It does mean the lack of blurring shows up the aliasing a bit more, but it is clearer. Cheers.
Shane, 2016-01-22
Atmospheric, super pretty, and your code is always easy to read through.
eiffie, 2016-01-22
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.
iapafoto, 2016-01-22
wow !
Dave_Hoskins, 2016-01-22
I'm using the arrow keys already, if you want to try them.
FabriceNeyret2, 2016-01-22
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).
dr2, 2016-01-21
Aren't fractals magnificent. Even BBM would be impressed.
poljere, 2016-01-21
You should add VR support
poljere, 2016-01-21
This is beautiful dude.
Dave_Hoskins, 2016-01-21
Mouse drag to turn, ie. you can let go and regrab. WASD or Cursor keys to move. Space or Shift to speed up.
We use cookies to give you the best experience on our website. If you continue using Shadertoy, we'll assume that you are happy to receive all cookies on this website. For more information, please review our Terms & Privacy.
Select input for iChannel

by



by



by



by



by



by



by



by



by





by



by



by



by



by



by



by



by



by





by



by



by



by



by



by



by



by



by





by



by



by



by



by



by



by



by



by





by



by



by



by



by



by



by



by



by





by



by



by



by



by



by



by



by



by




GLSL Help
This help only covers the parts of GLSL ES that are relevant for Shadertoy. For the complete specification please have a look at GLSL ES specification

Language:


  • Version: WebGL 2.0
  • Arithmetic: ( ) + - ! * / %
  • Logical/Relatonal: ~ < > <= >= == != && ||
  • Bit Operators: & ^ | << >>
  • Comments: // /* */
  • Types: void bool int uint float vec2 vec3 vec4 bvec2 bvec3 bvec4 ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 mat2 mat3 mat4 mat?x? sampler2D, sampler3D, samplerCube
  • Format: float a = 1.0; int b = 1; uint i = 1U; int i = 0x1;
  • Function Parameter Qualifiers: [none], in, out, inout
  • Global Variable Qualifiers: const
  • Vector Components: .xyzw .rgba .stpq
  • Flow Control: if else for return break continue switch/case
  • Output: vec4 fragColor
  • Input: vec2 fragCoord
  • Preprocessor: #define #undef #if #ifdef #ifndef #else #elif #endif #error #pragma #line

Built-in Functions:


  • ftype radians (ftype degrees)
  • ftype degrees (ftype radians)
  • ftype sin (ftype angle)
  • ftype cos (ftype angle)
  • ftype tan (ftype angle)
  • ftype asin (ftype x)
  • ftype acos (ftype x)
  • ftype atan (ftype y, ftype x)
  • ftype atan (ftype y_over_x)
  • ftype sinh (ftype x)
  • ftype cosh (ftype x)
  • ftype tanh (ftype x)
  • ftype asinh (ftype x)
  • ftype acosh (ftype x)
  • ftype atanh f(type x)
  • ftype pow (ftype x, ftype y)
  • ftype exp (ftype x)
  • ftype log (ftype x)
  • ftype exp2 (ftype x)
  • ftype log2 (ftype x)
  • ftype sqrt (ftype x)
  • ftype inversesqrt (ftype x)
  • type abs (type x)
  • type sign (type x)
  • ftype floor (ftype x)
  • ftype ceil (ftype x)
  • ftype trunc (type x)
  • ftype fract (ftype x)
  • ftype mod (ftype x, ftype y)
  • ftype modf (ftype x, out ftype i)
  • type min (type x, type y)
  • type max (type x, type y)
  • type clamp (type x, type minV, type maxV)
  • ftype mix (ftype x, ftype y, ftype a)
  • type step (type edge, type x)
  • ftype smoothstep (ftype a, ftype b, ftype x)
  • float length (vec x)
  • float distance (vec p0, vec p1)
  • float dot (vec x, vec y)
  • vec3 cross (vec3 x, vec3 y)
  • vec normalize (vec x)
  • vec faceforward (vec N, vec I, vec Nref)
  • vec reflect (vec I, vec N)
  • vec refract (vec I, vec N, float eta)
  • float determinant(mat? m)
  • mat?x? outerProduct(vec c, vec r)
  • mat?x? matrixCompMult (mat?x? x, mat?x? y)
  • mat? inverse (mat? inverse)
  • mat?x? transpose (mat?x? inverse)
  • vec4 texture( sampler , vec coord [, float bias])
  • vec4 textureLod( sampler, vec coord, float lod)
  • vec4 textureLodOffset( sampler sampler, vec coord, float lod, ivec offset)
  • vec4 textureGrad( sampler , vec coord, vec2 dPdx, vec2 dPdy)
  • vec4 textureGradOffset sampler , vec coord, vec dPdx, vec dPdy, vec offset)
  • vec4 textureProj( sampler , vec coord [, float bias])
  • vec4 textureProjLod( sampler , vec coord, float lod)
  • vec4 textureProjLodOffset( sampler , vec coord, float lod, vec? offset)
  • vec4 textureProjGrad( sampler , vec coord, vec2 dPdx, vec2 dPdy)
  • vec4 texelFetch( sampler , ivec coord, int lod)
  • vec4 texelFetchOffset( sampler, ivec coord, int lod, ivec offset )
  • ivec textureSize( sampler , int lod)
  • ftype dFdx (ftype x)
  • ftype dFdy (ftype x)
  • ftype fwidth (ftype p)
  • btype isnan (ftype x)
  • btype isinf (ftype x)
  • ftype intBitsToFloat (itype v)
  • ftype uintBitsToFloat (utype v)
  • itype floatBitsToInt (ftype v)
  • utype floatBitsToUint (ftype v)
  • uint packSnorm2x16 (vec2 v)
  • uint packUnorm2x16 (vec2 v)
  • vec2 unpackSnorm2x16 (uint p)
  • vec2 unpackUnorm2x16 (uint p)
  • bvec lessThan (vec x, vec y)
  • bvec lessThanEqual (vec x, vec y)
  • bvec greaterThan (vec x, vec y)
  • bvec greaterThanEqual (vec x, vec y)
  • bvec equal (type x, type y)
  • bvec notEqual (type x, type y)
  • bool any (bvec x)
  • bool all (bvec x)
  • bvec not (bvec x)

How-to


  • Use structs: struct myDataType { float occlusion; vec3 color; }; myDataType myData = myDataType(0.7, vec3(1.0, 2.0, 3.0));
  • Initialize arrays: float[] x = float[] (0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6);
  • Do conversions: int a = 3; float b = float(a);
  • Do component swizzling: vec4 a = vec4(1.0,2.0,3.0,4.0); vec4 b = a.zyyw;
  • Access matrix components: mat4 m; m[1] = vec4(2.0); m[0][0] = 1.0; m[2][3] = 2.0;

Be careful!


  • the f suffix for floating pont numbers: 1.0f is illegal in GLSL. You must use 1.0
  • saturate(): saturate(x) doesn't exist in GLSL. Use clamp(x,0.0,1.0) instead
  • pow/sqrt: please don't feed sqrt() and pow() with negative numbers. Add an abs() or max(0.0,) to the argument
  • mod: please don't do mod(x,0.0). This is undefined in some platforms
  • variables: initialize your variables! Don't assume they'll be set to zero by default
  • functions: don't call your functions the same name as any of your variables

Shadertoy Inputs


vec3iResolutionimage/bufferThe viewport resolution (z is pixel aspect ratio, usually 1.0)
floatiTimeimage/sound/bufferCurrent time in seconds
floatiTimeDeltaimage/bufferTime it takes to render a frame, in seconds
intiFrameimage/bufferCurrent frame
floatiFrameRateimage/bufferNumber of frames rendered per second
floatiChannelTime[4]image/bufferTime for channel (if video or sound), in seconds
vec3iChannelResolution[4]image/buffer/soundInput texture resolution for each channel
vec4iMouseimage/bufferxy = current pixel coords (if LMB is down). zw = click pixel
sampler2DiChannel{i}image/buffer/soundSampler for input textures i
vec4iDateimage/buffer/soundYear, month, day, time in seconds in .xyzw
floatiSampleRateimage/buffer/soundThe sound sample rate (typically 44100)

Shadertoy Outputs


Image shaders: fragColor is used as output channel. It is not, for now, mandatory but recommended to leave the alpha channel to 1.0.

Sound shaders: the mainSound() function returns a vec2 containing the left and right (stereo) sound channel wave data.


Share your shader
Yes
No
BBCode Help

Codes:


You can format your comments by using standard BBCode. The following tags are implemented in Shadertoy:

Bold[b]this text goes in bold[/b]
Italic[i]this text goes in italic[/i]
Images[img]url_to_image[/img]
Url[url]http://www.shadertoy.com[/url]
Url[url=http://www.shadertoy.com]Shadertoy[/url]
Code[code]fixed-width text[/code]
Video[video]http://www.youtube.com/watch?v=0ifChJ0nJfM[/video]

Emoticons:


:)
:(
:D
:love:
:octopus:
:octopusballoon:

Symbols:


:alpha:α
:beta:β
:delta:Δ
:epsilon:ε
:nabla:
:square:²
:cube:³
:limit:

Share your shader
Direct link:

Just copy and paste this URL below:

Embed:

Add to playlist