@@ -50,11 +50,11 @@ function X3DProgrammableShaderObject (executionContext)
50
50
51
51
this . fogNode = null ;
52
52
this . numClipPlanes = 0 ;
53
+ this . numEnvironmentLights = 0 ;
54
+ this . environmentLightNodes = [ ] ;
53
55
this . numLights = 0 ;
54
- this . numGlobalLights = 0 ;
55
56
this . lightNodes = [ ] ;
56
57
this . numTextureProjectors = 0 ;
57
- this . numGlobalTextureProjectors = 0 ;
58
58
this . textureProjectorNodes = [ ] ;
59
59
this . textures = new Set ( ) ;
60
60
}
@@ -924,6 +924,15 @@ Object .assign (X3DProgrammableShaderObject .prototype,
924
924
925
925
return false ;
926
926
} ,
927
+ hasEnvironmentLight ( i , lightNode )
928
+ {
929
+ if ( this . environmentLightNodes [ i ] === lightNode )
930
+ return true ;
931
+
932
+ this . environmentLightNodes [ i ] = lightNode ;
933
+
934
+ return false ;
935
+ } ,
927
936
hasLight ( i , lightNode )
928
937
{
929
938
if ( this . lightNodes [ i ] === lightNode )
@@ -985,14 +994,18 @@ Object .assign (X3DProgrammableShaderObject .prototype,
985
994
986
995
// Set global lights and global texture projectors.
987
996
988
- this . numLights = 0 ;
989
- this . numTextureProjectors = 0 ;
997
+ this . numEnvironmentLights = 0 ;
998
+ this . numLights = 0 ;
999
+ this . numTextureProjectors = 0 ;
1000
+
1001
+ this . environmentLightNodes . length = 0 ;
990
1002
this . lightNodes . length = 0 ;
991
1003
this . textureProjectorNodes . length = 0 ;
992
1004
993
1005
for ( const globalLights of renderObject . getGlobalLights ( ) )
994
1006
globalLights . setShaderUniforms ( gl , this , renderObject ) ;
995
1007
1008
+ this . numGlobalEnvironmentLights = this . numEnvironmentLights ;
996
1009
this . numGlobalLights = this . numLights ;
997
1010
this . numGlobalTextureProjectors = this . numTextureProjectors ;
998
1011
@@ -1032,6 +1045,7 @@ Object .assign (X3DProgrammableShaderObject .prototype,
1032
1045
// Clip planes and local lights
1033
1046
1034
1047
this . numClipPlanes = 0 ;
1048
+ this . numEnvironmentLights = this . numGlobalEnvironmentLights ;
1035
1049
this . numLights = this . numGlobalLights ;
1036
1050
this . numTextureProjectors = this . numGlobalTextureProjectors ;
1037
1051
0 commit comments