Explorar o código

A new RegisterShader function in Effect

Raanan Weber %!s(int64=7) %!d(string=hai) anos
pai
achega
0116995138
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      src/Materials/babylon.effect.ts

+ 10 - 0
src/Materials/babylon.effect.ts

@@ -1423,6 +1423,16 @@
             return this;
         }
 
+        public RegisterShader(name: string, pixelShader?: string, vertexShader?: string) {
+            if (pixelShader) {
+                Effect.ShadersStore[`${name}PixelShader`] = pixelShader;
+            }
+
+            if (vertexShader) {
+                Effect.ShadersStore[`${name}VertexShader`] = vertexShader;
+            }
+        }
+
         /**
          * Store of each shader (The can be looked up using effect.key)
          */