@luma.gl/shadertools
Version:
Shader module system for luma.gl
67 lines (56 loc) • 1.48 kB
JavaScript
// luma.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
export const pbrMaterialUniforms = /* glsl */ `\
uniform Projection {
// Projection
vec3 u_Camera;
};
uniform pbrMaterialUniforms {
// Material is unlit
bool unlit;
// Base color map
bool baseColorMapEnabled;
vec4 baseColorFactor;
bool normalMapEnabled;
float normalScale; // #ifdef HAS_NORMALMAP
bool emissiveMapEnabled;
vec3 emissiveFactor; // #ifdef HAS_EMISSIVEMAP
vec2 metallicRoughnessValues;
bool metallicRoughnessMapEnabled;
bool occlusionMapEnabled;
float occlusionStrength; // #ifdef HAS_OCCLUSIONMAP
bool alphaCutoffEnabled;
float alphaCutoff; // #ifdef ALPHA_CUTOFF
// IBL
bool IBLenabled;
vec2 scaleIBLAmbient; // #ifdef USE_IBL
// debugging flags used for shader output of intermediate PBR variables
// #ifdef PBR_DEBUG
vec4 scaleDiffBaseMR;
vec4 scaleFGDSpec;
// #endif
};
// Samplers
uniform sampler2D u_BaseColorSampler;
uniform sampler2D u_NormalSampler;
uniform sampler2D u_EmissiveSampler;
uniform sampler2D u_MetallicRoughnessSampler;
uniform sampler2D u_OcclusionSampler;
uniform samplerCube u_DiffuseEnvSampler;
uniform samplerCube u_SpecularEnvSampler;
uniform sampler2D u_brdfLUT;
`;
//# sourceMappingURL=pbr-uniforms-glsl.js.map