@babylonjs/materials
Version:
For usage documentation please visit the [materials library documentation](https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/).
69 lines • 3.63 kB
JavaScript
// Do not edit.
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
import { sceneFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/sceneFragmentDeclaration.js";
import { sceneUboDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js";
import { helperFunctions } from "@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js";
import { lightFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
import { lightUboDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
import { lightsFragmentFunctions } from "@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js";
import { shadowsFragmentFunctions } from "@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js";
import { clipPlaneFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js";
import { logDepthDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
import { fogFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js";
import { clipPlaneFragment } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js";
import { lightFragment } from "@babylonjs/core/Shaders/ShadersInclude/lightFragment.js";
import { logDepthFragment } from "@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js";
import { fogFragment } from "@babylonjs/core/Shaders/ShadersInclude/fogFragment.js";
import { imageProcessingCompatibility } from "@babylonjs/core/Shaders/ShadersInclude/imageProcessingCompatibility.js";
const name = "shadowOnlyPixelShader";
const shader = `precision highp float;
uniform float alpha;uniform vec3 shadowColor;varying vec3 vPositionW;
varying vec3 vNormalW;
varying float vViewDepth;
void main(void) {
vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
vec3 normalW=normalize(vNormalW);
vec3 normalW=vec3(1.0,1.0,1.0);
vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.;
vec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha);
gl_FragColor=color;
}`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
const includes = [sceneFragmentDeclaration, sceneUboDeclaration, helperFunctions, lightFragmentDeclaration, lightUboDeclaration, lightsFragmentFunctions, shadowsFragmentFunctions, clipPlaneFragmentDeclaration, logDepthDeclaration, fogFragmentDeclaration, clipPlaneFragment, lightFragment, logDepthFragment, fogFragment, imageProcessingCompatibility];
for (const inc of includes) {
if (!ShaderStore.IncludesShadersStore[inc.name]) {
ShaderStore.IncludesShadersStore[inc.name] = inc.shader;
}
}
/** @internal */
export const shadowOnlyPixelShader = { name, shader };
//# sourceMappingURL=shadowOnly.fragment.js.map