UNPKG

@animech-public/playcanvas

Version:
2 lines (1 loc) 1.6 kB
import{ShaderProcessorOptions as s}from"../../platform/graphics/shader-processor-options.js";import{SPECULAR_BLINN as t,SPECOCC_AO as i,DITHER_NONE as e,FRESNEL_SCHLICK as h}from"../constants.js";import{Material as r}from"./material.js";import{LitMaterialOptions as a}from"./lit-material-options.js";import{LitMaterialOptionsBuilder as o}from"./lit-material-options-builder.js";import{getProgramLibrary as n}from"../shader-lib/get-program-library.js";import{lit as l}from"../shader-lib/programs/lit.js";const c=new a;class p extends r{constructor(...s){super(...s),this.usedUvs=[!0],this.shaderChunk="void evaluateFrontend() {}\n",this.chunks=null,this.useLighting=!0,this.useFog=!0,this.useGammaTonemap=!0,this.useSkybox=!0,this.shadingModel=t,this.ambientSH=null,this.pixelSnap=!1,this.nineSlicedMode=null,this.fastTbn=!1,this.twoSidedLighting=!1,this.occludeDirect=!1,this.occludeSpecular=i,this.occludeSpecularIntensity=1,this.opacityFadesSpecular=!0,this.opacityDither=e,this.opacityShadowDither=e,this.conserveEnergy=!0,this.ggxSpecular=!1,this.fresnelModel=h,this.dynamicRefraction=!1,this.hasAo=!1,this.hasSpecular=!1,this.hasSpecularityFactor=!1,this.hasLighting=!1,this.hasHeights=!1,this.hasNormals=!1,this.hasSheen=!1,this.hasRefraction=!1,this.hasIrridescence=!1,this.hasMetalness=!1,this.hasClearCoat=!1,this.hasClearCoatNormals=!1}getShaderVariant(t,i,e,h,r,a,p,d,u){c.usedUvs=this.usedUvs.slice(),c.shaderChunk=this.shaderChunk,o.update(c.litOptions,this,i,e,r,a);const m=new s(p,d,u),g=n(t);g.register("lit",l);return g.getProgram("lit",c,m,this.userId)}}export{p as LitMaterial};