@itwin/core-frontend
Version:
iTwin.js frontend components
9 lines • 1.06 kB
TypeScript
/** @packageDocumentation
* @module WebGL
*/
import { ProgramBuilder } from "../ShaderBuilder";
export declare const computeAlphaWeight = "\nfloat computeAlphaWeight(float a) {\n float d = computeLinearDepth(v_eyeSpace.z) * .85 + .15;\n float z = (u_shaderFlags[kShaderBit_OITFlatAlphaWeight] ? 1.0 : d);\n return pow(a + 0.01, 4.0) + max(1e-2, 3.0 * 1e3 * pow(z, 3.0));\n}\n";
export declare const computeOutputs = "\n vec3 Ci = baseColor.rgb * baseColor.a;\n float ai = min(0.99, baseColor.a); // OIT algorithm does not nicely handle a=1\n float wzi = computeAlphaWeight(ai);\n\n // If we are scaling output into the 0 to 1 range, we use the maximum output of the alpha weight function.\n float outputScale = (u_shaderFlags[kShaderBit_OITScaleOutput] ? 1.0 / 3001.040604 : 1.0);\n\n vec4 output0 = vec4(Ci * wzi * outputScale, ai);\n vec4 output1 = vec4(ai * wzi * outputScale, 0.0, 0.0, ai * wzi * outputScale);\n";
/** @internal */
export declare function addTranslucency(prog: ProgramBuilder): void;
//# sourceMappingURL=Translucency.d.ts.map