UNPKG

@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.

26 lines 1.34 kB
// Do not edit. import { ShaderStore } from "../../Engines/shaderStore.js"; const name = "openpbrBackgroundTransmission"; const shader = `vec4 slab_translucent_background=vec4(0.,0.,0.,1.); #ifdef REFRACTED_BACKGROUND {float refractionLOD=transmission_roughness*vBackgroundRefractionInfos.x;vec2 refractionNoiseOffset=vec2(0.0); #ifdef DISPERSION for (int i=0; i<3; i++) {vec3 refractedViewVector=refractedViewVectors[i]; #endif vec3 refractionUVW=vec3(backgroundRefractionMatrix*(view*vec4(vPositionW+refractedViewVector*geometry_thickness,1.0)));vec2 refractionCoords=refractionUVW.xy/refractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;if (refractionLOD>0.0) {refractionNoiseOffset=(noise.xy+refractedViewVector.xy)/vec2(pow(2.0,vBackgroundRefractionInfos.x-refractionLOD));} refractionCoords+=refractionNoiseOffset; #ifdef DISPERSION slab_translucent_background[i]=texture2DLodEXT(backgroundRefractionSampler,refractionCoords,refractionLOD)[i];} #else slab_translucent_background=texture2DLodEXT(backgroundRefractionSampler,refractionCoords,refractionLOD); #endif } #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStore[name]) { ShaderStore.IncludesShadersStore[name] = shader; } /** @internal */ export const openpbrBackgroundTransmission = { name, shader }; //# sourceMappingURL=openpbrBackgroundTransmission.js.map