@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.
25 lines • 1.5 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../../Engines/shaderStore.js";
const name = "openpbrBackgroundTransmission";
const shader = `var slab_translucent_background: vec4f=vec4f(0.,0.,0.,1.);
{let refractionLOD: f32=transmission_roughness*uniforms.vBackgroundRefractionInfos.x;var refractionNoiseOffset: vec2f=vec2f(0.0f);if (refractionLOD>0.0f) {refractionNoiseOffset=noise.xy/vec2f(pow(2.0f,uniforms.vBackgroundRefractionInfos.x-refractionLOD));}
for (var i: i32=0; i<3; i++) {let refractedViewVector: vec3f=refractedViewVectors[i];
let refractionUVW: vec3f=vec3f((uniforms.backgroundRefractionMatrix*(scene.view*vec4f(fragmentInputs.vPositionW+refractedViewVector*geometry_thickness,1.0f))).xyz);var refractionCoords: vec2f=refractionUVW.xy/refractionUVW.z;refractionCoords.y=1.0f-refractionCoords.y;refractionCoords+=refractionNoiseOffset;
slab_translucent_background[i]=textureSampleLevel(backgroundRefractionSampler,backgroundRefractionSamplerSampler,refractionCoords,refractionLOD)[i];}
slab_translucent_background=textureSampleLevel(backgroundRefractionSampler,backgroundRefractionSamplerSampler,refractionCoords,refractionLOD);
}
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name]) {
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
}
/** @internal */
export const openpbrBackgroundTransmissionWGSL = { name, shader };
//# sourceMappingURL=openpbrBackgroundTransmission.js.map