Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
else
{
scaleInfo.x=1.0-scaledBorderWidth;
scaleInfo.y=1.0-(scaledBorderWidth*scaleRatio);
}
#endif
vec4 worldPos=world*vec4(position,1.0);
#ifdef HOVERLIGHT
worldPosition=worldPos.xyz;
#endif
gl_Position=viewProjection*worldPos;
}
`;
Effect.ShadersStore[name] = shader;
export { shader, name };
float speed=cosTimeZeroOne*(sin(tileX*314.5)*0.5+0.6);
float x=float(mod(gl_FragCoord.x,caracterSize))/fontx;
float y=float(mod(speed+gl_FragCoord.y/screeny,1.0));
y*=ratio;
vec4 finalColor=texture2D(digitalRainFont,vec2(x,1.0-y));
vec3 high=finalColor.rgb*(vec3(1.2,1.2,1.2)*pow(1.0-y,30.0));
finalColor.rgb*=vec3(pow(tileLuminance,5.0),pow(tileLuminance,1.5),pow(tileLuminance,3.0));
finalColor.rgb+=high;
finalColor.rgb=clamp(finalColor.rgb,0.,1.);
finalColor.a=1.0;
finalColor=mix(finalColor,tileColor,digitalRainOptions.w);
finalColor=mix(finalColor,baseColor,digitalRainOptions.z);
gl_FragColor=finalColor;
}`;
Effect.ShadersStore[name] = shader;
export { shader, name };
smoothstep(scaleInfo.y-edgeSmoothingValue,scaleInfo.y+edgeSmoothingValue,distanceToEdge.y));
borderColor=borderColor*borderValue*max(borderMinValue*inverseBorderPower,pointToHover);
albedo+=borderColor;
alpha=max(alpha,borderValue);
#endif
#ifdef INNERGLOW
vec2 uvGlow=(vUV-vec2(0.5,0.5))*(innerGlowColor.a*2.0);
uvGlow=uvGlow*uvGlow;
uvGlow=uvGlow*uvGlow;
albedo+=mix(vec3(0.0,0.0,0.0),innerGlowColor.rgb,uvGlow.x+uvGlow.y);
#endif
gl_FragColor=vec4(albedo,alpha);
}`;
Effect.ShadersStore[name] = shader;
export { shader, name };
private registerShaders() {
Effect.ShadersStore["customFragmentShader"] = fragmentShader;
Effect.ShadersStore["customVertexShader"] = vertexShader;
}
const NAME = 'vue-babylonjs';
Effect.ShadersStore[`${NAME}VertexShader`] = `
attribute vec3 position;
attribute vec2 uv;
uniform mat4 worldViewProjection;
uniform float time;
varying vec2 vUv;
void main() {
gl_Position = worldViewProjection * vec4(position, 1.0);
vUv = uv;
}
`;
Effect.ShadersStore[`${NAME}FragmentShader`] = `
precision highp float;
void main() {
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
}
`;
module.exports = NAME;
float glossiness=0.;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
#include[0..maxSimultaneousLights]
#ifdef VERTEXALPHA
alpha*=vColor.a;
#endif
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor,0.0,1.0)*baseColor.rgb;
vec4 color=vec4(finalDiffuse,alpha);
#include
gl_FragColor=color;
}`;
Effect.ShadersStore[name] = shader;
export { shader, name };
private registerShaders() {
Effect.ShadersStore["customFragmentShader"] = fragmentShader;
Effect.ShadersStore["customVertexShader"] = vertexShader;
}
alpha*=vColor.a;
#endif
#ifdef SPECULARTERM
vec3 finalSpecular=specularBase*specularColor;
#else
vec3 finalSpecular=vec3(0.0);
#endif
vec3 finalDiffuse=clamp(diffuseBase*diffuseColor*baseColor.rgb,0.0,1.0);
vec4 color=vec4(finalDiffuse+finalSpecular,alpha);
#include
gl_FragColor=color;
}
`;
Effect.ShadersStore[name] = shader;
export { shader, name };
float fbm(vec2 n) {
float total=0.0,amplitude=1.0;
for (int i=0; i<4; i++) {
total+=noise(n)*amplitude;
n+=n;
amplitude*=0.5;
}
return total;
}
void main(void) {
float ratioy=mod(gl_FragCoord.y*100.0 ,fbm(vUV*2.0));
vec3 color=roadColor*ratioy;
gl_FragColor=vec4(color,1.0);
}`;
Effect.ShadersStore[name] = shader;
export { shader, name };
#include
#include
#include[0..maxSimultaneousLights]
#ifdef VERTEXCOLOR
vColor=color;
#endif
#ifdef POINTSIZE
gl_PointSize=pointSize;
#endif
}
`;
Effect.ShadersStore[name] = shader;
export { shader, name };