@babylonjs/materials
Version:
For usage documentation please visit the [materials library documentation](https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/).
86 lines • 3.69 kB
JavaScript
// Do not edit.
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
import { bonesDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js";
import { bakedVertexAnimationDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js";
import { instancesDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js";
import { clipPlaneVertexDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js";
import { logDepthDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
import { fogVertexDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js";
import { instancesVertex } from "@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js";
import { bonesVertex } from "@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js";
import { bakedVertexAnimation } from "@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js";
import { clipPlaneVertex } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js";
import { logDepthVertex } from "@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js";
import { fogVertex } from "@babylonjs/core/Shaders/ShadersInclude/fogVertex.js";
import { vertexColorMixing } from "@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js";
const name = "fireVertexShader";
const shader = `precision highp float;attribute vec3 position;
attribute vec2 uv;
attribute vec2 uv2;
attribute vec4 color;
uniform mat4 view;uniform mat4 viewProjection;
varying vec2 vDiffuseUV;
uniform float pointSize;
varying vec3 vPositionW;
varying vec4 vColor;
uniform float time;uniform float speed;
varying vec2 vDistortionCoords1;varying vec2 vDistortionCoords2;varying vec2 vDistortionCoords3;
void main(void) {
vec4 colorUpdated=color;
vec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);
vDiffuseUV=uv;vDiffuseUV.y-=0.2;
gl_PointSize=pointSize;
vec3 layerSpeed=vec3(-0.2,-0.52,-0.1)*speed;vDistortionCoords1.x=uv.x;vDistortionCoords1.y=uv.y+layerSpeed.x*time/1000.0;vDistortionCoords2.x=uv.x;vDistortionCoords2.y=uv.y+layerSpeed.y*time/1000.0;vDistortionCoords3.x=uv.x;vDistortionCoords3.y=uv.y+layerSpeed.z*time/1000.0;
}
`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
const includes = [bonesDeclaration, bakedVertexAnimationDeclaration, instancesDeclaration, clipPlaneVertexDeclaration, logDepthDeclaration, fogVertexDeclaration, instancesVertex, bonesVertex, bakedVertexAnimation, clipPlaneVertex, logDepthVertex, fogVertex, vertexColorMixing];
for (const inc of includes) {
if (!ShaderStore.IncludesShadersStore[inc.name]) {
ShaderStore.IncludesShadersStore[inc.name] = inc.shader;
}
}
/** @internal */
export const fireVertexShader = { name, shader };
//# sourceMappingURL=fire.vertex.js.map