@@ -251,12 +251,6 @@ export class OpenPBRMaterialDefines extends ImageProcessingDefinesMixin(OpenPBRM
251
251
public PARALLAXOCCLUSION = false ;
252
252
public NORMALXYSCALE = true ;
253
253
254
- public LIGHTMAP = false ;
255
- public LIGHTMAPDIRECTUV = 0 ;
256
- public USELIGHTMAPASSHADOWMAP = false ;
257
- public GAMMALIGHTMAP = false ;
258
- public RGBDLIGHTMAP = false ;
259
-
260
254
public REFLECTION = false ;
261
255
public REFLECTIONMAP_3D = false ;
262
256
public REFLECTIONMAP_SPHERICAL = false ;
@@ -278,7 +272,6 @@ export class OpenPBRMaterialDefines extends ImageProcessingDefinesMixin(OpenPBRM
278
272
public LODINREFLECTIONALPHA = false ;
279
273
public GAMMAREFLECTION = false ;
280
274
public RGBDREFLECTION = false ;
281
- public LINEARSPECULARREFLECTION = false ;
282
275
public RADIANCEOCCLUSION = false ;
283
276
public HORIZONOCCLUSION = false ;
284
277
@@ -658,20 +651,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
658
651
@expandToProperty ( "_markAllSubMeshesAsTexturesDirty" )
659
652
public useSpecularWeightFromTextureAlpha = false ;
660
653
661
- /**
662
- * Stores the pre-calculated light information of a mesh in a texture.
663
- */
664
- @serializeAsTexture ( )
665
- @expandToProperty ( "_markAllSubMeshesAsTexturesDirty" , null )
666
- public lightmapTexture : Nullable < BaseTexture > ;
667
-
668
- /**
669
- * If true, the light map contains occlusion information instead of lighting info.
670
- */
671
- @serialize ( )
672
- @expandToProperty ( "_markAllSubMeshesAsTexturesDirty" )
673
- public useLightmapAsShadowmap = false ;
674
-
675
654
/**
676
655
* Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.
677
656
*/
@@ -981,36 +960,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
981
960
*/
982
961
public _useSpecularWeightFromTextureAlpha = false ;
983
962
984
- /**
985
- * Stores the pre-calculated light information of a mesh in a texture.
986
- * @internal
987
- */
988
- public _lightmapTexture : Nullable < BaseTexture > = null ;
989
-
990
- /**
991
- * The color of a material in ambient lighting.
992
- * @internal
993
- */
994
- public _ambientColor = new Color3 ( 0 , 0 , 0 ) ;
995
-
996
- /**
997
- * AKA Specular Color in other nomenclature.
998
- * @internal
999
- */
1000
- public _reflectivityColor = new Color3 ( 1 , 1 , 1 ) ;
1001
-
1002
- /**
1003
- * The color applied when light is reflected from a material.
1004
- * @internal
1005
- */
1006
- public _reflectionColor = new Color3 ( 1 , 1 , 1 ) ;
1007
-
1008
- /**
1009
- * Specifies that the material will use the light map as a show map.
1010
- * @internal
1011
- */
1012
- public _useLightmapAsShadowmap = false ;
1013
-
1014
963
/**
1015
964
* This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal
1016
965
* makes the reflect vector face the model (under horizon).
@@ -1597,12 +1546,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
1597
1546
}
1598
1547
}
1599
1548
1600
- if ( this . _lightmapTexture && MaterialFlags . LightmapTextureEnabled ) {
1601
- if ( ! this . _lightmapTexture . isReadyOrNotBlocking ( ) ) {
1602
- return false ;
1603
- }
1604
- }
1605
-
1606
1549
if ( this . _environmentBRDFTexture && MaterialFlags . ReflectionTextureEnabled ) {
1607
1550
// This is blocking.
1608
1551
if ( ! this . _environmentBRDFTexture . isReady ( ) ) {
@@ -1691,8 +1634,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
1691
1634
public override buildUniformLayout ( ) : void {
1692
1635
// Order is important !
1693
1636
const ubo = this . _uniformBuffer ;
1694
- ubo . addUniform ( "vLightmapInfos" , 2 ) ;
1695
- ubo . addUniform ( "lightmapMatrix" , 16 ) ;
1696
1637
ubo . addUniform ( "vTangentSpaceParams" , 2 ) ;
1697
1638
ubo . addUniform ( "vLightingIntensity" , 4 ) ;
1698
1639
@@ -1789,11 +1730,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
1789
1730
}
1790
1731
}
1791
1732
1792
- if ( this . _lightmapTexture && MaterialFlags . LightmapTextureEnabled ) {
1793
- ubo . updateFloat2 ( "vLightmapInfos" , this . _lightmapTexture . coordinatesIndex , this . _lightmapTexture . level ) ;
1794
- BindTextureMatrix ( this . _lightmapTexture , ubo , "lightmap" ) ;
1795
- }
1796
-
1797
1733
if ( this . geometryNormalTexture ) {
1798
1734
if ( scene . _mirroredCameraPosition ) {
1799
1735
ubo . updateFloat2 ( "vTangentSpaceParams" , this . _invertNormalMapX ? 1.0 : - 1.0 , this . _invertNormalMapY ? 1.0 : - 1.0 ) ;
@@ -1852,10 +1788,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
1852
1788
if ( defines . ENVIRONMENTBRDF ) {
1853
1789
ubo . setTexture ( "environmentBrdfSampler" , this . _environmentBRDFTexture ) ;
1854
1790
}
1855
-
1856
- if ( this . _lightmapTexture && MaterialFlags . LightmapTextureEnabled ) {
1857
- ubo . setTexture ( "lightmapSampler" , this . _lightmapTexture ) ;
1858
- }
1859
1791
}
1860
1792
1861
1793
// OIT with depth peeling
@@ -1929,10 +1861,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
1929
1861
results . push ( this . _reflectionTexture ) ;
1930
1862
}
1931
1863
1932
- if ( this . _lightmapTexture && this . _lightmapTexture . animations && this . _lightmapTexture . animations . length > 0 ) {
1933
- results . push ( this . _lightmapTexture ) ;
1934
- }
1935
-
1936
1864
return results ;
1937
1865
}
1938
1866
@@ -1955,10 +1883,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
1955
1883
activeTextures . push ( this . _reflectionTexture ) ;
1956
1884
}
1957
1885
1958
- if ( this . _lightmapTexture ) {
1959
- activeTextures . push ( this . _lightmapTexture ) ;
1960
- }
1961
-
1962
1886
return activeTextures ;
1963
1887
}
1964
1888
@@ -1984,10 +1908,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
1984
1908
return true ;
1985
1909
}
1986
1910
1987
- if ( this . _lightmapTexture === texture ) {
1988
- return true ;
1989
- }
1990
-
1991
1911
return false ;
1992
1912
}
1993
1913
@@ -2020,7 +1940,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
2020
1940
}
2021
1941
2022
1942
this . _reflectionTexture ?. dispose ( ) ;
2023
- this . _lightmapTexture ?. dispose ( ) ;
2024
1943
}
2025
1944
2026
1945
this . _renderTargets . dispose ( ) ;
@@ -2115,10 +2034,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
2115
2034
fallbacks . addFallback ( fallbackRank ++ , "USEIRRADIANCEMAP" ) ;
2116
2035
}
2117
2036
2118
- if ( defines . LIGHTMAP ) {
2119
- fallbacks . addFallback ( fallbackRank ++ , "LIGHTMAP" ) ;
2120
- }
2121
-
2122
2037
if ( defines . NORMAL ) {
2123
2038
fallbacks . addFallback ( fallbackRank ++ , "NORMAL" ) ;
2124
2039
}
@@ -2173,10 +2088,8 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
2173
2088
"vFogInfos" ,
2174
2089
"vFogColor" ,
2175
2090
"pointSize" ,
2176
- "vLightmapInfos" ,
2177
2091
"mBones" ,
2178
2092
"normalMatrix" ,
2179
- "lightmapMatrix" ,
2180
2093
"vLightingIntensity" ,
2181
2094
"logarithmicDepthConstant" ,
2182
2095
"vTangentSpaceParams" ,
@@ -2192,7 +2105,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
2192
2105
}
2193
2106
2194
2107
const samplers = [
2195
- "lightmapSampler" ,
2196
2108
"environmentBrdfSampler" ,
2197
2109
"boneSampler" ,
2198
2110
"morphTargets" ,
@@ -2321,7 +2233,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
2321
2233
defines [ "MAINUV" + i ] = false ;
2322
2234
}
2323
2235
if ( scene . texturesEnabled ) {
2324
- defines . LIGHTMAPDIRECTUV = 0 ;
2325
2236
2326
2237
if ( engine . getCaps ( ) . textureLOD ) {
2327
2238
defines . LODBASEDMICROSFURACE = true ;
@@ -2347,15 +2258,6 @@ export class OpenPBRMaterial extends OpenPBRMaterialBase {
2347
2258
this . _baseDiffuseRoughnessTexture != null ;
2348
2259
PrepareDefinesForIBL ( scene , reflectionTexture , defines , this . realTimeFiltering , this . realTimeFilteringQuality , ! useSHInFragment ) ;
2349
2260
2350
- if ( this . _lightmapTexture && MaterialFlags . LightmapTextureEnabled ) {
2351
- PrepareDefinesForMergedUV ( this . _lightmapTexture , defines , "LIGHTMAP" ) ;
2352
- defines . USELIGHTMAPASSHADOWMAP = this . _useLightmapAsShadowmap ;
2353
- defines . GAMMALIGHTMAP = this . _lightmapTexture . gammaSpace ;
2354
- defines . RGBDLIGHTMAP = this . _lightmapTexture . isRGBD ;
2355
- } else {
2356
- defines . LIGHTMAP = false ;
2357
- }
2358
-
2359
2261
if ( MaterialFlags . SpecularTextureEnabled ) {
2360
2262
if ( this . _baseMetalRoughTexture ) {
2361
2263
defines . AOSTOREINMETALMAPRED = this . _useAmbientOcclusionFromMetallicTextureRed ;
0 commit comments