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.

3 lines (2 loc) 986 B
const e="let eta=material.refractionParams.y;\nlet realIOR=1.0/eta;\nlet spread=0.04*material.volumeParams.w*(realIOR-1.0);\nlet etaR=1.0/(realIOR-spread);\nlet etaB=1.0/(realIOR+spread);\nlet cpR=scene.viewProjection*vec4<f32>(input.worldPos+refract(-V,N,etaR)*th,1.0);\nlet cpG=scene.viewProjection*vec4<f32>(input.worldPos+refract(-V,N,eta)*th,1.0);\nlet cpB=scene.viewProjection*vec4<f32>(input.worldPos+refract(-V,N,etaB)*th,1.0);\nlet uvR=(cpR.xy/cpR.w)*vec2<f32>(0.5,-0.5)+vec2<f32>(0.5,0.5);\nlet uvG=(cpG.xy/cpG.w)*vec2<f32>(0.5,-0.5)+vec2<f32>(0.5,0.5);\nlet uvB=(cpB.xy/cpB.w)*vec2<f32>(0.5,-0.5)+vec2<f32>(0.5,0.5);\nlet er=vec3<f32>(textureSampleLevel(refractionTexture,refractionSampler_,uvR,lv).r,textureSampleLevel(refractionTexture,refractionSampler_,uvG,lv).g,textureSampleLevel(refractionTexture,refractionSampler_,uvB,lv).b)*material.environmentIntensity;";export{e as DISPERSION_SAMPLE_WGSL}; //# sourceMappingURL=refraction-dispersion-wgsl-BrR0L3e9.esm.min.js.map