Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions away3d/materials/compilation/ShaderCompiler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 6 additions & 0 deletions away3d/materials/compilation/ShaderRegisterData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, ShaderRegisterElement> = null;

public function new()
{

Expand Down
Loading