uniform float iGlobalTime; uniform sampler2D diffuse; float blendReflect(float base, float blend) { return (blend==1.0)?blend:min(base*base/(1.0-blend),1.0); } vec3 blendReflect(vec3 base, vec3 blend) { return vec3(blendReflect(base.r,blend.r),blendReflect(base.g,blend.g),blendReflect(base.b,blend.b)); } vec3 blendReflect(vec3 base, vec3 blend, float opacity) { return (blendReflect(base, blend) * opacity + base * (1.0 - opacity)); } vec3 blendGlow(vec3 base, vec3 blend) { return blendReflect(blend,base); } vec3 blendGlow(vec3 base, vec3 blend, float opacity) { return (blendGlow(base, blend) * opacity + base * (1.0 - opacity)); } void getEmission() { // vec2 p = -1.0 + 2.0 * vUv0; // // main code, *original shader by: 'Plasma' by Viktor Korsun (2011) // float x = p.x; // float y = p.y; // float mov0 = x+y+cos(sin(iGlobalTime)*2.0)*100.+sin(x/100.)*1000.; // float mov1 = y / 0.9 + iGlobalTime; // float mov2 = x / 0.2; // float c1 = abs(sin(mov1+iGlobalTime)/2.+mov2/2.-mov1-mov2+iGlobalTime); // float c2 = abs(sin(c1+sin(mov0/1000.+iGlobalTime)+sin(y/40.+iGlobalTime)+sin((x+y)/100.)*3.)); // float c3 = abs(sin(c2+cos(mov1+mov2+c2)+cos(mov2)+sin(x/1000.))); vec3 diff = texture2D(diffuse, vUv0).rgb; //float b = abs(sin(iGlobalTime*1.5)); //vec3 o = mix(diff, vec3(0.525, 0.858, 1), iGlobalTime); vec3 emissive = mix(vec3(0, 0, 0), vec3(0.525, 0.858, 1), iGlobalTime); dEmission = emissive; }