Explorar o código

Fix for samplers in struct uniforms

Forward `renderer` argument in `StructuredUniform.setValue` to allow uniform structs to contain samplers. This works in all webgl browsers except Edge. See isssue 11787
Markus Johnsson %!s(int64=8) %!d(string=hai) anos
pai
achega
056f6fbe80
Modificáronse 1 ficheiros con 2 adicións e 5 borrados
  1. 2 5
      src/renderers/webgl/WebGLUniforms.js

+ 2 - 5
src/renderers/webgl/WebGLUniforms.js

@@ -392,17 +392,14 @@ function StructuredUniform( id ) {
 
 }
 
-StructuredUniform.prototype.setValue = function ( gl, value ) {
-
-	// Note: Don't need an extra 'renderer' parameter, since samplers
-	// are not allowed in structured uniforms.
+StructuredUniform.prototype.setValue = function ( gl, value, renderer ) {
 
 	var seq = this.seq;
 
 	for ( var i = 0, n = seq.length; i !== n; ++ i ) {
 
 		var u = seq[ i ];
-		u.setValue( gl, value[ u.id ] );
+		u.setValue( gl, value[ u.id ], renderer );
 
 	}