diff --git a/src/main.cpp b/src/main.cpp index 8ea282e..b5c2b70 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,6 +16,11 @@ #define USE_AUDIO 1 #define NO_UNIFORMS 0 +#define SHAPES 16 +#define SHAPES_TEX_SIZE (SHAPES * SHAPES * 4) +#define SHAPES_TOTAL (SHAPES * SHAPES) +#define MAX_DISTANCE 100.f + #include "definitions.h" #if OPENGL_DEBUG #include "debug.h" @@ -126,28 +131,14 @@ int __cdecl main(int argc, char* argv[]) static float fft_input[FFT_SIZE]; static float fft_output[FFT_SIZE / 2]; // Magnitudes static float fft_uniform[FFT_SIZE / 4]; + + static float shapesData[SHAPES_TEX_SIZE]; // main note effect boolean beenPlaying = false; const int SHAPES_SIZE = 15; float shapeIncrement = 0.15f; - /** - * Definition of shape with 3 parameters in a vec3 - * - * h position, v position, length - * - */ - float vec3ShapeArray[5][3] = { - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f } - }; - - float test[3] = { 0.0f, 0.0f, 0.0f }; // test float of one shape - int currentShape = 0; // mark location which shape we are currently building boolean isPlaying = false; @@ -155,43 +146,17 @@ int __cdecl main(int argc, char* argv[]) float lastPlayPos = 0; float lastNote = 0.0f; - /*GLfloat shapes[5][3] = { - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f } - };*/ - struct Vec3 { float x, y, z; }; -#define GRID 32 -#define HEX_TEX_SIZE (GRID * GRID * 4) // RGBA: 4 floats per texel - -#define SHAPES 16 -#define SHAPES_TEX_SIZE (SHAPES * SHAPES * 4) -#define SHAPES_TOTAL (SHAPES * SHAPES) -#define MAX_DISTANCE 100.f - PFNGLUNIFORM1FVPROC glUniform1fvProc = ((PFNGLUNIFORM1FVPROC)wglGetProcAddress("glUniform1fv")); PFNGLACTIVETEXTUREPROC glActiveTexture = ((PFNGLACTIVETEXTUREPROC)wglGetProcAddress("glActiveTexture")); PFNGLUNIFORM1IPROC glUniform1i = ((PFNGLUNIFORM1IPROC)wglGetProcAddress("glUniform1i")); PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation = ((PFNGLGETUNIFORMLOCATIONPROC)wglGetProcAddress("glGetUniformLocation")); - GLuint hexGridTex, ShapesTex; - glGenTextures(1, &hexGridTex); - glBindTexture(GL_TEXTURE_2D, hexGridTex); - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, GRID, GRID, 0, GL_RGBA, GL_FLOAT, nullptr); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - + GLuint ShapesTex; glGenTextures(1, &ShapesTex); glBindTexture(GL_TEXTURE_2D, ShapesTex); @@ -271,11 +236,11 @@ int __cdecl main(int argc, char* argv[]) { float gain = 50.0f; float alpha = 0.10f; // "Hidastaa" FFT:n piikkej� - float threshhold = 0.05f; // Alin arvo mik� p��stet��n shaderille (v�hent�� "noisea") - float x_t = fft_output[i] * gain; + float threshhold = 0.015f; // Alin arvo mik� p��stet��n shaderille (v�hent�� "noisea") + float x_t = (fft_output[i] < threshhold) ? 0.f : fft_output[i] * gain; // Exponential smoothing kaava // s(t) = alpha*x(t)+(1-alpha)*s(t-1) - fft_uniform[i] = (x_t < threshhold) ? 0.f : alpha * (x_t)+(1 - alpha) * fft_uniform[i]; + fft_uniform[i] = alpha * (x_t)+(1 - alpha) * fft_uniform[i]; } } syncs[0] = (float)playCursor / (SU_SAMPLE_RATE * SU_CHANNEL_COUNT * SU_SAMPLE_SIZE); // Aika sekunteina. @@ -294,7 +259,6 @@ int __cdecl main(int argc, char* argv[]) // if sound is playing, start a shape, if shape is already started - add length // if sound has stopped, end shape // if shape is finished, move shape forward - static float shapesData[SHAPES_TEX_SIZE]; float captureSync = syncs[5]; bool shapeJustFinished = false; @@ -304,7 +268,6 @@ int __cdecl main(int argc, char* argv[]) bool noteChanged = (captureSync != lastNote) ? TRUE : FALSE; lastNote = captureSync; - // If note changed and value is significant, start new shape if (noteChanged) { int index = currentShape * 4; @@ -349,23 +312,6 @@ int __cdecl main(int argc, char* argv[]) glActiveTexture(GL_TEXTURE0 + 0); glBindTexture(GL_TEXTURE_2D, ShapesTex); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, SHAPES, SHAPES, GL_RGBA, GL_FLOAT, shapesData); - - - /* - float flatShapes[15] = { - vec3ShapeArray[0][0], vec3ShapeArray[0][1], vec3ShapeArray[0][2], - vec3ShapeArray[1][0], vec3ShapeArray[1][1], vec3ShapeArray[1][2], - vec3ShapeArray[2][0], vec3ShapeArray[2][1], vec3ShapeArray[2][2], - vec3ShapeArray[3][0], vec3ShapeArray[3][1], vec3ShapeArray[3][2], - vec3ShapeArray[4][0], vec3ShapeArray[4][1], vec3ShapeArray[4][2] - }; - */ - - - - //PFNGLUNIFORM3FVPROC glUniform3fvProc = ((PFNGLUNIFORM3FVPROC)wglGetProcAddress("glUniform3fv")); - //glUniform3fvProc(600, 1, flatShapes); // array of shapes - //glUniform3fvProc(700, 1, test); // test shape glUniform1fvProc(0, SU_NUMSYNCS + 1, syncs); diff --git a/src/shaders/fragment.frag b/src/shaders/fragment.frag index b927812..0fe80d4 100644 --- a/src/shaders/fragment.frag +++ b/src/shaders/fragment.frag @@ -54,43 +54,7 @@ float hexPylon(vec3 p, vec2 h) {//float r, float ht){ p.xz = vec2(p.x*.866025 + p.z*.5, p.z); // The ".015" is a subtle rounding factor. Zero gives sharp edges, // and larger numbers give a more rounded look. - return length(max(abs(p) - b + .015, 0.)) - .015; -} - -#define zclamp(a) max(a,0.0) //Clamp negative values at zero -float DF_RoundedHex( vec3 p, vec2 h) //float width, float height) -{ - float width = h.x; - float height = h.y; - //Modified version (smooth edges) of the exagon prism found here: - //https://iquilezles.org/articles/distfunctions - float smoothRadius = 0.05; - width -= smoothRadius*2.0; - - //Hexagon prism constructed using X,Y,Z symmetry. - //Only quadrant 1 needs to be solved, but the joining diagonal to quadrant IV is also - //required for distance blending (see db). - p = abs(p); - - //Hexagonal edge distances : - //Note : [.8666,0.5] = [sin(PI/3,cos(PI/3)] -> Hexagon edges rotation coeff (60 degrees). - float da = (p.x*0.866025+p.z*0.5)-width; //quadrant I diagonal edge distance - float db = (p.x*0.866025-p.z*0.5)-width; //quadrant IV diagonal edge distance (needed for blending) - float dc = p.z-width; //upper distance - - vec3 d = zclamp(vec3(da,db,dc)); - //Note: this is not an euclidian length, therefore this operation slightly distorts our distance field. - //Yet, it is harmless to convergence, and does the smoothing job quite well. - float dw = length(d)-smoothRadius; //hexagonal part smoothness (blending at 60 deg) - float dh = p.y-height; - - //Now that we have xz distance(dw) and y distance (dh), we can compute the distance - //for the given isovalue (the smoothing radius). - //Note : internal distance (maxX,maxY,maxZ) is also used to genereate internal signed dist, - // helping convergence when overstepping (very frequent with domain repetition). - float externalDistance = length(zclamp(vec2(dh,dw)))-smoothRadius; //Smoothed, unsigned - float internalDistance = max(max(da,dc),dh); //Sharp, signed. - return min(externalDistance,internalDistance); + return length(max(abs(p) - b + .15, 0.)) - .15; } // Return local coordinates inside hex AND axial ID @@ -164,20 +128,18 @@ vec2 mapScene(in vec3 p) { vec3 hexpos = vec3(p.x, p.y - 2.5, p.z); HexData hex = hexTile(hexpos, 1.0); - - // Use axial coordinates as a stable hex ID + float distFromCenter = hexDistance(hex.axial); int fftIndex = int(clamp(distFromCenter +1.0, 0.0, 511.0)); // tweak 15.0 to taste - float fftVal = fft_output[fftIndex]; float hexHeight = 1.0 + fftVal * 3.0; // Rotate individual hex tiles if needed vec3 r = hex.local; //r.yz *= rot2D(1.0); - r.xz *= rot2D(0.5); + r.xz *= rot2D(0.5); - float d1 = fHexagonCircumcircle(vec3(r.x,(r.y-hexHeight/2),r.z), vec2(hexRadius, hexHeight/2)); + float d1 = hexPylon(vec3(r.x,(r.y-hexHeight/2),r.z), vec2(hexRadius, hexHeight/2)); res = min(res, vec2(d1,0.)); float gridSize2 = 16.; @@ -211,22 +173,22 @@ vec3 castRay(vec3 ro, vec3 rd, inout vec3 pos) { vec3 d; float t = 0.,ad,tmax=400.; // total distance travelled const float tolerance = 0.001; - const float Z_REPEAT_DIST = 1.; + const float Z_REPEAT_DIST = 2.; vec2 res; -// // Raymarching -// for (int i = 0; i < 50; i++) { -// pos = ro + rd * t; -// res = mapScene(pos); // Get distance to objects -// ad = abs(res.x); -// mat = res.y; -// if (t > tmax) break; -// if (ad < tolerance*(t*0.125 + 1.0)) { -// hit = 1.0; -// break; -// } -// t += res.x; // "march" the ray -// } + // Raymarching + for (int i = 0; i < 50; i++) { + pos = ro + rd * t; + res = mapScene(pos); // Get distance to objects + ad = abs(res.x); + mat = res.y; + if (t > tmax) break; + if (ad < tolerance*(t*0.0125 + 1.0)) { + hit = 1.0; + break; + } + t += res.x; // "march" the ray + } // t -= Z_REPEAT_DIST*1.; // // for( int i=0; i<30; i++ ) @@ -249,20 +211,20 @@ vec3 castRay(vec3 ro, vec3 rd, inout vec3 pos) { // hit = 0.; //} //Reduced from 40 to 24 steps - for(int i = 0; i < 30; i++) { - pos = ro + rd * t; - vec2 res = mapScene(pos); - // Increase step size multiplier for faster marching - t += res.x; - mat = res.y; - if(t > 400.) { // Reduced max distance - break; - } - if(res.x < 0.00001 * (t*0.00125 + 1.0)) { // Less precise hit detection - hit = 1.; - break; - } - } +// for(int i = 0; i < 30; i++) { +// pos = ro + rd * t; +// vec2 res = mapScene(pos); +// // Increase step size multiplier for faster marching +// t += res.x; +// mat = res.y; +// if(t > 400.) { // Reduced max distance +// break; +// } +// if(res.x < 0.00001 * (t*0.00125 + 1.0)) { // Less precise hit detection +// hit = 1.; +// break; +// } +// } // This will break fog effect //if (t > 100.) // t = 0.; diff --git a/src/shaders/fragment.inl b/src/shaders/fragment.inl index 223e5a9..2736f5d 100644 --- a/src/shaders/fragment.inl +++ b/src/shaders/fragment.inl @@ -2,174 +2,176 @@ #ifndef FRAGMENT_INL_ # define FRAGMENT_INL_ # define VAR_fft_output "f" -# define VAR_o "v" +# define VAR_o "l" # define VAR_shapes "H" # define VAR_syncs "m" -# define VAR_test "l" -# define VAR_u_ShapesTex "a" +# define VAR_test "k" +# define VAR_u_ShapesTex "x" const char *fragment_frag = "#version 460\n" "precision mediump float;" - "out vec4 v;" - "const float i=2.*acos(-1.),n=sqrt(5.)*.5+.5;" + "out vec4 l;" + "const float i=2.*acos(-1.),v=sqrt(5.)*.5+.5;" "layout(location=0)uniform float m[12];" "layout(location=20)uniform float f[512];" "layout(location=600)uniform vec3 H[15];" - "layout(location=700)uniform vec3 l;" - "layout(binding=0)uniform sampler2D a;" - "float g=m[0];" - "mat2 t()" + "layout(location=700)uniform vec3 k;" + "layout(binding=0)uniform sampler2D x;" + "float n=m[0];" + "mat2 s()" "{" - "float v=sin(.5),a=cos(.5);" - "return mat2(a,-v,v,a);" + "float v=sin(.5),x=cos(.5);" + "return mat2(x,-v,v,x);" "}" - "float t(vec3 v,vec2 i)" + "float s(vec3 v,vec2 l)" "{" - "v=abs(v);" - "return max(v.y-i.y,max(v.x*sqrt(3.)*.5+v.z*.5,v.z)-i.x);" - "}\n" - "#define zclamp(a)max(a,0.0)\n" - "struct HexData{vec3 local;vec2 axial;};" - "HexData t(vec3 v)" - "{" - "float i=sqrt(3.)/3.*v.x-1./3.*v.z,f=2./3.*v.z,a=round(i),x=round(f),l=round(-i-f),m=abs(a-i),n=abs(x-f);" - "i=abs(l+i+f);" - "if(m>n&&m>i)" - "a=-x-l;" - "else if(n>i)" - "x=-a-l;" - "i=sqrt(3.)*(a+x*.5);" - "f=1.5*x;" - "HexData r;" - "r.local=v-vec3(i,0,f);" - "r.axial=vec2(a,x);" - "return r;" + "v.xz=abs(v.xz);" + "v.xz=vec2(v.x*.866025+v.z*.5,v.z);" + "return length(max(abs(v)-vec3(l.xyx)+.15,0.))-.15;" "}" "struct HexData{vec3 local;vec2 axial;};" - "float t(vec2 v)" + "HexData s(vec3 v)" "{" - "float i=v.x,a=v.y;" - "return max(abs(i),max(abs(a),abs(-i-a)));" + "float x=sqrt(3.)/3.*v.x-1./3.*v.z,l=2./3.*v.z,m=round(x),y=round(l),t=round(-x-l),n=abs(m-x),d=abs(y-l);" + "x=abs(t+x+l);" + "if(n>d&&n>x)" + "m=-y-t;" + "else if(d>x)" + "y=-m-t;" + "x=sqrt(3.)*(m+y*.5);" + "l=1.5*y;" + "HexData f;" + "f.local=v-vec3(x,0,l);" + "f.axial=vec2(m,y);" + "return f;" "}" - "vec2 s(vec3 v)" + "struct HexData{vec3 local;vec2 axial;};" + "float s(vec2 v)" "{" - "vec2 i=vec2(v.y,0);" - "HexData m=t(vec3(v.x,v.y-2.5,v.z));" - "float l=1.+f[int(clamp(t(m.axial)+1.,0.,511.))]*3.;" - "vec3 r=m.local;" - "r.xz*=t();" - "l=t(vec3(r.x,r.y-l/2,r.z),vec2(.83,l/2));" - "i=min(i,vec2(l,0));" + "float x=v.x,l=v.y;" + "return max(abs(x),max(abs(l),abs(-x-l)));" + "}" + "vec2 t(vec3 v)" + "{" + "vec2 l=vec2(v.y,0);" + "HexData m=s(vec3(v.x,v.y-2.5,v.z));" + "float i=1.+f[int(clamp(s(m.axial)+1.,0.,511.))]*3.;" + "vec3 n=m.local;" + "n.xz*=s();" + "i=s(vec3(n.x,n.y-i/2,n.z),vec2(.83,i/2));" + "l=min(l,vec2(i,0));" "for(float f=0.;f<16.;f++)" - "for(float l=0.;l<16.;l++)" + "for(float i=0.;i<16.;i++)" "{" - "ivec2 m=textureSize(a,0);" - "vec2 n=vec2(l,f)/vec2(m);" - "vec4 r=texture(a,n);" - "if(r.w<.5)" + "ivec2 m=textureSize(x,0);" + "vec2 n=vec2(i,f)/vec2(m);" + "vec4 d=texture(x,n);" + "if(d.w<.5)" "continue;" - "i=min(i,vec2(length(v-vec3(-70.+r.x*2.,12.+r.y*80.,0))-.8,1));" + "l=min(l,vec2(length(v-vec3(-70.+d.x*2.,12.+d.y*80.,0))-.8,1));" "}" - "return i;" + "return l;" "}" - "vec3 s(vec3 v,vec3 i,inout vec3 f)" + "vec3 s(vec3 v,vec3 x,inout vec3 l)" "{" - "float l=0.,a=0.,x=0.;" - "for(int r=0;r<30;r++)" + "float i=0.,n=0.,m=0.,f;" + "vec2 d;" + "for(int r=0;r<50;r++)" "{" - "f=v+i*x;" - "vec2 m=s(f);" - "x+=m.x;" - "l=m.y;" - "if(x>4e2)" + "l=v+x*m;" + "d=t(l);" + "f=abs(d.x);" + "i=d.y;" + "if(m>4e2)" "break;" - "if(m.x<1e-5*(x*.00125+1.))" + "if(f<.001*(m*.0125+1.))" "{" - "a=1.;" + "n=1.;" "break;" "}" + "m+=d.x;" "}" - "return vec3(x,l,a);" + "return vec3(m,i,n);" "}" - "float s(vec3 v,vec3 i,float f)" + "float s(vec3 v,vec3 x,float l)" "{" - "float l=1.,a=.02;" - "for(int r=0;r<6;r++)" + "float i=1.,m=.02;" + "for(int f=0;f<6;f++)" "{" - "if(a>f)" + "if(m>l)" "break;" - "float m=s(v+a*i).x;" - "l=min(l,m/(4.*a));" - "a+=clamp(m,.1,.8);" - "if(l<-1.)" + "float n=t(v+m*x).x;" + "i=min(i,n/(4.*m));" + "m+=clamp(n,.1,.8);" + "if(i<-1.)" "break;" "}" - "l=max(l,-1.);" - "return.25*(1.+l)*(1.+l)*(2.-l);" + "i=max(i,-1.);" + "return.25*(1.+i)*(1.+i)*(2.-i);" "}" - "vec3 x(vec3 v)" + "vec3 e(vec3 v)" "{" "vec2 i=vec2(.01,0);" - "v=vec3(s(v+i.xyy).x-s(v-i.xyy).x,s(v+i.yxy).x-s(v-i.yxy).x,s(v+i.yyx).x-s(v-i.yyx).x);" + "v=vec3(t(v+i.xyy).x-t(v-i.xyy).x,t(v+i.yxy).x-t(v-i.yxy).x,t(v+i.yyx).x-t(v-i.yyx).x);" "return normalize(v);" "}" - "vec3 s(vec3 v,vec3 l,vec3 i,vec3 a,float f)" + "vec3 e(vec3 v,vec3 m,vec3 l,vec3 x,float i)" "{" - "vec3 m=vec3(.77,.26,.73);" - "v-=l;" - "float r=length(v);" + "vec3 n=vec3(.77,.26,.73);" + "v-=m;" + "float f=length(v);" "v=normalize(v);" - "float x=30./(1.+.09*r+.032*r*r),n=max(dot(a,v),0.);" - "i=normalize(v-i);" - "vec3 e=vec3(.04);" - "e+=(1.-e)*pow(clamp(1.-max(dot(i,v),0.),0.,1.),5.);" - "r=s(l+a*.01,v,r);" - "return(m*n*x+m*pow(max(dot(a,i),0.),mix(128.,8.,f))*x*e)*r;" + "float y=30./(1.+.09*f+.032*f*f),d=max(dot(x,v),0.);" + "l=normalize(v-l);" + "vec3 r=vec3(.04);" + "r+=(1.-r)*pow(clamp(1.-max(dot(l,v),0.),0.,1.),5.);" + "f=s(m+x*.01,v,f);" + "return(n*d*y+n*pow(max(dot(x,l),0.),mix(128.,8.,i))*y*r)*f;" "}" - "vec3 s(vec3 v,vec3 a,vec3 i,float l)" + "vec3 e(vec3 v,vec3 m,vec3 i,float l)" "{" - "float f=.01;" - "vec3 m=vec3(0);" + "float n=.01;" + "vec3 x=vec3(0);" "if(l==0.)" - "m=vec3(.8314,.2941,.2941),f=.1;" + "x=vec3(.8314,.2941,.2941),n=.1;" "else if(l==1.)" - "m=vec3(.6196,.6118,.6118),f=.7;" + "x=vec3(.6196,.6118,.6118),n=.7;" "else if(l==2.)" - "m=vec3(.3255,.4784,.3255),f=.2;" + "x=vec3(.3255,.4784,.3255),n=.2;" "else if(l==3.)" - "m=vec3(.2471,.3059,.6314),f=1.;" + "x=vec3(.2471,.3059,.6314),n=1.;" "else if(l==4.)" - "m=vec3(.9961,1,.9922),f=.1;" + "x=vec3(.9961,1,.9922),n=.1;" "else if(l==5.)" - "m=vec3(.9961,1,.9922),f=.3;" - "vec3 r=vec3(0);" - "r+=s(vec3(0,40,-10),v,i,a,f);" - "r+=s(vec3(0,20,15),v,i,a,f);" - "r+=vec3(.08,.62,.75)*clamp(dot(a,normalize(vec3(0,1,-3)*vec3(0,-1,-2))),0.,1.)*.8;" - "return m*max(vec3(0),r);" + "x=vec3(.9961,1,.9922),n=.3;" + "vec3 f=vec3(0);" + "f+=e(vec3(0,40,-10),v,i,m,n);" + "f+=e(vec3(0,20,15),v,i,m,n);" + "f+=vec3(.08,.62,.75)*clamp(dot(m,normalize(vec3(0,1,-3)*vec3(0,-1,-2))),0.,1.)*.8;" + "return x*max(vec3(0),f);" "}" - "vec3 s(vec2 i,vec3 v)" + "vec3 e(vec2 v,vec3 l)" "{" - "v=normalize(vec3(0,10,0)-v);" - "vec3 f=normalize(cross(vec3(0,1,0),v));" - "return normalize(v+i.x*f+i.y*cross(v,f));" + "l=normalize(vec3(0,10,0)-l);" + "vec3 n=normalize(cross(vec3(0,1,0),l));" + "return normalize(l+v.x*n+v.y*cross(l,n));" "}" - "vec3 s(vec2 v)" + "vec3 e(vec2 v)" "{" - "vec3 i=vec3(-20,20,-20),a=s(v,i),l=vec3(0),f=vec3(0);" - "i=s(i,a,f);" - "if(i.x>0.)" + "vec3 l=vec3(-20,20,-20),n=e(v,l),i=vec3(0),x=vec3(0);" + "l=s(l,n,x);" + "if(l.x>0.)" "{" - "vec3 v=x(f);" - "l=s(f,v,a,i.y);" + "vec3 v=e(x);" + "i=e(x,v,n,l.y);" "}" - "return l*exp(-i.x*.01)+mix(l,mix(vec3(.2667,.2941,.3451),vec3(.302,.3176,.3725),pow(max(dot(a,vec3(0,-.5,1.8)),0.),clamp(m[1]+m[2]+m[3],0.,1.)*5.)),1.-exp(-i.x*.01))*(1.-exp(-i.x*.01));" + "return i*exp(-l.x*.01)+mix(i,mix(vec3(.2667,.2941,.3451),vec3(.302,.3176,.3725),pow(max(dot(n,vec3(0,-.5,1.8)),0.),clamp(m[1]+m[2]+m[3],0.,1.)*5.)),1.-exp(-l.x*.01))*(1.-exp(-l.x*.01));" "}" "void main()" "{" - "vec3 l=s(gl_FragCoord.xy*vec2(.00104166667,.00185185185)-1.);" - "v=vec4(l,1);" + "vec3 v=e(gl_FragCoord.xy*vec2(.00104166667,.00185185185)-1.);" + "l=vec4(v,1);" "}"; #endif // FRAGMENT_INL_