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.

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