@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
126 lines • 3.98 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../Engines/shaderStore.js";
import "./ShadersInclude/backgroundVertexDeclaration.js";
import "./ShadersInclude/backgroundUboDeclaration.js";
import "./ShadersInclude/helperFunctions.js";
import "./ShadersInclude/bonesDeclaration.js";
import "./ShadersInclude/bakedVertexAnimationDeclaration.js";
import "./ShadersInclude/instancesDeclaration.js";
import "./ShadersInclude/clipPlaneVertexDeclaration.js";
import "./ShadersInclude/fogVertexDeclaration.js";
import "./ShadersInclude/lightVxFragmentDeclaration.js";
import "./ShadersInclude/lightVxUboDeclaration.js";
import "./ShadersInclude/logDepthDeclaration.js";
import "./ShadersInclude/instancesVertex.js";
import "./ShadersInclude/bonesVertex.js";
import "./ShadersInclude/bakedVertexAnimation.js";
import "./ShadersInclude/clipPlaneVertex.js";
import "./ShadersInclude/fogVertex.js";
import "./ShadersInclude/shadowsVertex.js";
import "./ShadersInclude/logDepthVertex.js";
const name = "backgroundVertexShader";
const shader = `precision highp float;
attribute vec3 position;
attribute vec3 normal;
varying vec3 vPositionW;
varying vec3 vNormalW;
attribute vec2 uv;
attribute vec2 uv2;
varying vec2 vMainUV1;
varying vec2 vMainUV2;
varying vec2 vDiffuseUV;
varying vec3 vPositionUVW;
varying vec3 vDirectionW;
void main(void) {
vPositionUVW=position;
if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*finalWorld*vec4(position,1.0);} else {gl_Position=viewProjectionR*finalWorld*vec4(position,1.0);}
gl_Position=viewProjection*finalWorld*vec4(position,1.0);
vec4 worldPos=finalWorld*vec4(position,1.0);vPositionW=vec3(worldPos);
mat3 normalWorld=mat3(finalWorld);
normalWorld=transposeMat3(inverseMat3(normalWorld));
vNormalW=normalize(normalWorld*normal);
vDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));
mat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));vec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));if (fFovMultiplier<=1.0) {vDirectionW=normalize(segment);} else {vDirectionW=normalize(vDirectionW+(vDirectionW-segment));}
vec2 uv=vec2(0.,0.);
vec2 uv2=vec2(0.,0.);
vMainUV1=uv;
vMainUV2=uv2;
if (vDiffuseInfos.x==0.)
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));}
else
{vDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));}
vColor=colorUpdated;
gl_PointSize=pointSize;
}
`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
/** @internal */
export const backgroundVertexShader = { name, shader };
//# sourceMappingURL=background.vertex.js.map