diff --git a/away3d/materials/compilation/ShaderCompiler.hx b/away3d/materials/compilation/ShaderCompiler.hx index 90578e21..35238173 100644 --- a/away3d/materials/compilation/ShaderCompiler.hx +++ b/away3d/materials/compilation/ShaderCompiler.hx @@ -310,6 +310,15 @@ class ShaderCompiler _vertexCode = ""; _fragmentCode = ""; + if (_sharedRegisters.custom != null) + { + #if haxe4 + _sharedRegisters.custom.clear(); + #else + _sharedRegisters.custom = null; + #end + } + _sharedRegisters.localPosition = _registerCache.getFreeVertexVectorTemp(); _registerCache.addVertexTempUsages(_sharedRegisters.localPosition, 1); diff --git a/away3d/materials/compilation/ShaderRegisterData.hx b/away3d/materials/compilation/ShaderRegisterData.hx index c7c6808e..21b35c74 100644 --- a/away3d/materials/compilation/ShaderRegisterData.hx +++ b/away3d/materials/compilation/ShaderRegisterData.hx @@ -25,6 +25,12 @@ class ShaderRegisterData public var viewDirFragment:ShaderRegisterElement; public var bitangent:ShaderRegisterElement; + /** + * Space for named registers other than the ones above. Will be null until + * defined by an effect method. + */ + public var custom:Map = null; + public function new() {