@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.
117 lines • 4.88 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../../Engines/shaderStore.js";
const name = "pbrBlockFinalLitComponents";
const shader = `aggShadow=aggShadow/numLights;
var baseSpecularEnergyConservationFactor: vec3f=getEnergyConservationFactor(vec3f(reflectanceF0),environmentBrdf);var coloredEnergyConservationFactor: vec3f=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);
surfaceAlbedo=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;
surfaceAlbedo=vec3f(1.-reflectanceF0)*surfaceAlbedo.rgb;
var finalIrradiance: vec3f=reflectionOut.environmentIrradiance;
var baseSpecularEnergy: vec3f=vec3f(baseSpecularEnvironmentReflectance);
baseSpecularEnergy*=baseSpecularEnergyConservationFactor;
finalIrradiance*=clamp(vec3f(1.0)-baseSpecularEnergy,vec3f(0.0),vec3f(1.0));
finalIrradiance*=clearcoatOut.conservationFactor;
finalIrradiance*=clearcoatOut.absorption;
finalIrradiance*=surfaceAlbedo.rgb;
finalIrradiance*=subSurfaceOut.refractionOpacity;
finalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);finalIrradiance+=subSurfaceOut.refractionIrradiance;
finalIrradiance*=surfaceAlbedo.rgb;
finalIrradiance*=uniforms.vLightingIntensity.z;finalIrradiance*=aoOut.ambientOcclusionColor;
var finalSpecular: vec3f=specularBase;finalSpecular=max(finalSpecular,vec3f(0.0));var finalSpecularScaled: vec3f=finalSpecular*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w;
finalSpecularScaled*=coloredEnergyConservationFactor;
finalSpecularScaled*=sheenOut.sheenAlbedoScaling;
var finalRadiance: vec3f=reflectionOut.environmentRadiance.rgb;finalRadiance*=colorSpecularEnvironmentReflectance;;var finalRadianceScaled: vec3f=finalRadiance*uniforms.vLightingIntensity.z;
finalRadianceScaled*=coloredEnergyConservationFactor;
finalRadianceScaled*=sheenOut.sheenAlbedoScaling;
var finalSheen: vec3f=sheenBase*sheenOut.sheenColor;finalSheen=max(finalSheen,vec3f(0.0));var finalSheenScaled: vec3f=finalSheen*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w;
sheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;
sheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;
var finalClearCoat: vec3f=clearCoatBase;finalClearCoat=max(finalClearCoat,vec3f(0.0));var finalClearCoatScaled: vec3f=finalClearCoat*uniforms.vLightingIntensity.x*uniforms.vLightingIntensity.w;
finalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;
subSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;
subSurfaceOut.finalRefraction*=clearcoatOut.absorption;
var luminanceOverAlpha: f32=0.0;
luminanceOverAlpha+=getLuminance(finalRadianceScaled);
luminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);
luminanceOverAlpha+=getLuminance(finalSpecularScaled);
luminanceOverAlpha+=getLuminance(finalClearCoatScaled);
alpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name]) {
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
}
/** @internal */
export const pbrBlockFinalLitComponentsWGSL = { name, shader };
//# sourceMappingURL=pbrBlockFinalLitComponents.js.map