UNPKG

@babylonjs/materials

Version:

Babylon.js Materials Library =====================

60 lines 2.58 kB
// Do not edit. import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js"; import "@babylonjs/core/Shaders/ShadersInclude/sceneFragmentDeclaration.js"; import "@babylonjs/core/Shaders/ShadersInclude/sceneUboDeclaration.js"; import "@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js"; import "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js"; import "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js"; import "@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js"; import "@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js"; import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js"; import "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js"; import "@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js"; import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js"; import "@babylonjs/core/Shaders/ShadersInclude/lightFragment.js"; import "@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js"; import "@babylonjs/core/Shaders/ShadersInclude/fogFragment.js"; import "@babylonjs/core/Shaders/ShadersInclude/imageProcessingCompatibility.js"; const name = "shadowOnlyPixelShader"; const shader = `precision highp float; #include<__decl__sceneFragment> uniform float alpha;uniform vec3 shadowColor;varying vec3 vPositionW; #ifdef NORMAL varying vec3 vNormalW; #endif #include<helperFunctions> #include<__decl__lightFragment>[0..maxSimultaneousLights] #include<lightsFragmentFunctions> #include<shadowsFragmentFunctions> #include<clipPlaneFragmentDeclaration> #ifdef LOGARITHMICDEPTH #extension GL_EXT_frag_depth : enable #endif #include<logDepthDeclaration> #include<fogFragmentDeclaration> #define CUSTOM_FRAGMENT_DEFINITIONS void main(void) { #define CUSTOM_FRAGMENT_MAIN_BEGIN #include<clipPlaneFragment> vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW); #ifdef NORMAL vec3 normalW=normalize(vNormalW); #else vec3 normalW=vec3(1.0,1.0,1.0); #endif vec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float glossiness=0.;float aggShadow=0.;float numLights=0.; #include<lightFragment>[0..1] vec4 color=vec4(shadowColor,(1.0-clamp(shadow,0.,1.))*alpha); #include<logDepthFragment> #include<fogFragment> gl_FragColor=color; #include<imageProcessingCompatibility> #define CUSTOM_FRAGMENT_MAIN_END }`; // Sideeffect if (!ShaderStore.ShadersStore[name]) { ShaderStore.ShadersStore[name] = shader; } /** @internal */ export const shadowOnlyPixelShader = { name, shader }; //# sourceMappingURL=shadowOnly.fragment.js.map