How to use the babylonjs.Effect.ShadersStore function in babylonjs

To help you get started, we’ve selected a few babylonjs examples, based on popular ways it is used in public projects.

github BabylonJS / Babylon.js / gui / src / 3D / materials / shaders / fluent.vertex.fx.ts View on Github external
}
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 };
github BabylonJS / Babylon.js / postProcessLibrary / src / digitalRain / digitalrain.fragment.fx.ts View on Github external
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 };
github BabylonJS / Babylon.js / gui / src / 3D / materials / shaders / fluent.fragment.fx.ts View on Github external
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 };
github springtype-org / springtype / e2e / babylon-3d / src / component / first-scene / first-scene.tsx View on Github external
private registerShaders() {
        Effect.ShadersStore["customFragmentShader"] = fragmentShader;
        Effect.ShadersStore["customVertexShader"] = vertexShader;
    }
github Beg-in / vue-babylonjs / lib / shader / defaults.js View on Github external
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;
github BabylonJS / Babylon.js / materialsLibrary / src / cell / cell.fragment.fx.ts View on Github external
float glossiness=0.;
#ifdef SPECULARTERM
vec3 specularBase=vec3(0.,0.,0.);
#endif
#include<lightFragment>[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<fogFragment>
gl_FragColor=color;
}`;

Effect.ShadersStore[name] = shader;

export { shader, name };
github springtype-org / springtype / src / packages / cli / springtype / template / project / babylon-3d / src / component / first-scene / first-scene.tsx View on Github external
private registerShaders() {
        Effect.ShadersStore["customFragmentShader"] = fragmentShader;
        Effect.ShadersStore["customVertexShader"] = vertexShader;
    }
github BabylonJS / Babylon.js / materialsLibrary / src / terrain / terrain.fragment.fx.ts View on Github external
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<fogFragment>
gl_FragColor=color;
}
`;

Effect.ShadersStore[name] = shader;

export { shader, name };
github BabylonJS / Babylon.js / proceduralTexturesLibrary / src / road / roadProceduralTexture.fragment.fx.ts View on Github external
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 };
github BabylonJS / Babylon.js / materialsLibrary / src / gradient / gradient.vertex.fx.ts View on Github external
#include<clipPlaneVertex>

#include<fogVertex>
#include<shadowsVertex>[0..maxSimultaneousLights]

#ifdef VERTEXCOLOR
vColor=color;
#endif

#ifdef POINTSIZE
gl_PointSize=pointSize;
#endif
}
`;

Effect.ShadersStore[name] = shader;

export { shader, name };