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