|
@@ -62,7 +62,7 @@ export class CustomMaterial extends StandardMaterial {
|
|
|
public VertexShader: string;
|
|
|
|
|
|
public AttachAfterBind(mesh: Mesh, effect: Effect) {
|
|
|
- for (var el in this._newUniformInstances) {
|
|
|
+ for (var el in this._newUniformInstances) {
|
|
|
var ea = el.toString().split('-');
|
|
|
if (ea[0] == 'vec2') {
|
|
|
effect.setVector2(ea[1], this._newUniformInstances[el]);
|
|
@@ -90,20 +90,20 @@ export class CustomMaterial extends StandardMaterial {
|
|
|
|
|
|
public ReviewUniform(name: string, arr: string[]): string[] {
|
|
|
if (name == "uniform") {
|
|
|
- for (var ind in this._newUniforms) {
|
|
|
- if (this._customUniform[ind].indexOf('sampler') == -1) {
|
|
|
+ for (var ind = 0;ind < this._newUniforms.length ;ind ++ ) {
|
|
|
+ if ( this._customUniform[ind].indexOf('sampler') == -1) {
|
|
|
arr.push(this._newUniforms[ind]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (name == "sampler") {
|
|
|
- for (var ind in this._newUniforms) {
|
|
|
- if (this._customUniform[ind].indexOf('sampler') != -1) {
|
|
|
+ for (var ind = 0;ind < this._newUniforms.length ;ind ++ ) {
|
|
|
+ if ( this._customUniform[ind].indexOf('sampler') != -1) {
|
|
|
arr.push(this._newUniforms[ind]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return arr;
|
|
|
+ return arr;
|
|
|
}
|
|
|
|
|
|
public Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines, attributes?: string[]): string {
|
|
@@ -268,4 +268,4 @@ export class CustomMaterial extends StandardMaterial {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-_TypeStore.RegisteredTypes["BABYLON.CustomMaterial"] = CustomMaterial;
|
|
|
+_TypeStore.RegisteredTypes["BABYLON.CustomMaterial"] = CustomMaterial;
|