UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

13 lines (11 loc) 676 B
const IBL_SKYBOX_CALCULATION = `let R = input.worldPos - scene.vEyePosition.xyz; let maxLod = f32(textureNumLevels(iblTexture) - 1); let cubemapDim = f32(textureDimensions(iblTexture).x); let skyboxAlphaG = max(roughness * roughness, 0.000001); var specLod = log2(cubemapDim * skyboxAlphaG) * scene.vImageInfos.z; var environmentRadiance = textureSampleLevel(iblTexture, iblSampler, R, clamp(specLod, 0.0, maxLod)).rgb * material.environmentIntensity; let finalSpecularScaled = vec3<f32>(0.0); let finalRadianceScaled = environmentRadiance; color = finalRadianceScaled + emissive;`; export { IBL_SKYBOX_CALCULATION }; //# sourceMappingURL=ibl-skybox-wgsl-CPHVLg5v.esm.js.map