Download

[Solved] Colour Corruption in Material Editor

I cannot for the life of me work out why what I’m doing below is a problem, and I’m 99.99% sure I’ve stumbled accross an engine bug but need someone to sanity-check it for me first.

The vehicles in my game have a bunch of masks (all textures use TC_Masks compression setting), which allow me to control various emissive parameters in their materials. I use this for things like weapon muzzle glow, engine overheating etc. One of my material functions that I use is causing me headaches with colours.

This material function let’s me mask in a ‘colour’ for four different channels separately. Pretty basic right? Below it is the MF_MapRange function - which is just supposed to scale scalar values from one range to another.

fe2f021c5fc43694208775258391074cbc8f8a9c.jpeg

However, the Map Range function seems to be confusing the Shader Compiler when used inside another material function like this, and it can’t seem to deduce the channels properly. Currently if I have this node plugged into my chain of nodes up to the emissive channel, it causes the following colour corruption:

7118de7a4f849df0bd45f54b8ff11367b7210170.jpeg
d578abc5dfd8c2dab7f7c50900912835f9eee24d.jpeg
6dfdd34f0d6f2624f1f7db90ac6a62bca5eb152d.jpeg

I have to drive the emissive parameters much harder too. If I unhook MapRange from that material function, everything works as it’s supposed to - but this makes no sense? I even tried adding a Mask (R) node after the MapRange node, but that still didn’t work.


^ What it’s supposed to look like.


In short, I think the engine is unable to correctly deduce channels for colours when material functions are used inside other material functions - since I really can’t see anything I’m doing wrong here.

Jamsh, are you sure that remap function is working as intended? Try checking it with DebugScalarValues node(Big thanks to whoever added these debug nodes to the editor) , it seems to me that it is not remapping stuff correctly. Cross-check it with something like this:
[SPOILER]


Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_38"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4680"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4679"
   End Object
   Begin Object Class=MaterialExpressionFunctionOutput Name="MaterialExpressionFunctionOutput_1"
   End Object
   Begin Object Name="EdGraphPin_4680"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
   End Object
   Begin Object Name="EdGraphPin_4679"
      PinName="Input"
      PinFriendlyName=" "
      PinType=(PinCategory="required")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_116.EdGraphPin_4963'
   End Object
   Begin Object Name="MaterialExpressionFunctionOutput_1"
      A=(Expression=MaterialExpressionAdd'MaterialGraphNode_116.MaterialExpressionAdd_4')
      bLastPreviewed=True
      Id=82C95DD94C25EF0A7C3A20B4A7D622AB
      MaterialExpressionEditorX=720
      MaterialExpressionEditorY=496
      MaterialExpressionGuid=A49E40A54CE1F5D011CD1B9E46546278
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionFunctionOutput'MaterialExpressionFunctionOutput_1'
   Pins(0)=EdGraphPin'EdGraphPin_4679'
   Pins(1)=EdGraphPin'EdGraphPin_4680'
   NodePosX=720
   NodePosY=496
   NodeGuid=5D0F212D4EB8992C8EEA9FB0BA74B7B5
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_40"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4682"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4681"
   End Object
   Begin Object Class=MaterialExpressionFunctionInput Name="MaterialExpressionFunctionInput_7"
   End Object
   Begin Object Name="EdGraphPin_4682"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_109.EdGraphPin_4926'
      LinkedTo(1)=EdGraphPin'MaterialGraphNode_110.EdGraphPin_4928'
   End Object
   Begin Object Name="EdGraphPin_4681"
      PinName="Preview"
      PinType=(PinCategory="optional")
   End Object
   Begin Object Name="MaterialExpressionFunctionInput_7"
      InputName="Input Range"
      Id=2A9CFD5148AAA7E24FFC7F8D2678CE9D
      InputType=FunctionInput_Vector2
      MaterialExpressionEditorX=-592
      MaterialExpressionEditorY=416
      MaterialExpressionGuid=6AFBFE6C4765E14A3EFD8388BEBCDB7C
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionFunctionInput'MaterialExpressionFunctionInput_7'
   Pins(0)=EdGraphPin'EdGraphPin_4681'
   Pins(1)=EdGraphPin'EdGraphPin_4682'
   NodePosX=-592
   NodePosY=416
   NodeGuid=1E9E0FE64A140C61E357EEB64B8A0E27
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_41"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4684"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4683"
   End Object
   Begin Object Class=MaterialExpressionFunctionInput Name="MaterialExpressionFunctionInput_8"
   End Object
   Begin Object Name="EdGraphPin_4684"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_108.EdGraphPin_4932'
      LinkedTo(1)=EdGraphPin'MaterialGraphNode_107.EdGraphPin_4936'
   End Object
   Begin Object Name="EdGraphPin_4683"
      PinName="Preview"
      PinType=(PinCategory="optional")
   End Object
   Begin Object Name="MaterialExpressionFunctionInput_8"
      InputName="OutputRange"
      Id=DC019EBD4991E3902516A79F8F333CF6
      InputType=FunctionInput_Vector2
      SortPriority=1
      MaterialExpressionEditorX=-608
      MaterialExpressionEditorY=688
      MaterialExpressionGuid=6AFBFE6C4765E14A3EFD8388BEBCDB7C
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionFunctionInput'MaterialExpressionFunctionInput_8'
   Pins(0)=EdGraphPin'EdGraphPin_4683'
   Pins(1)=EdGraphPin'EdGraphPin_4684'
   NodePosX=-608
   NodePosY=688
   NodeGuid=BD72B0854F68719F9354C8BC0548F5BB
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_39"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4688"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4687"
   End Object
   Begin Object Class=MaterialExpressionFunctionInput Name="MaterialExpressionFunctionInput_9"
   End Object
   Begin Object Name="EdGraphPin_4688"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_113.EdGraphPin_4940'
   End Object
   Begin Object Name="EdGraphPin_4687"
      PinName="Preview"
      PinType=(PinCategory="optional")
   End Object
   Begin Object Name="MaterialExpressionFunctionInput_9"
      InputName="Value"
      Id=D4C51D7447209858A82B6CB4784E7D59
      InputType=FunctionInput_Scalar
      SortPriority=-1
      MaterialExpressionEditorX=-384
      MaterialExpressionEditorY=176
      MaterialExpressionGuid=6AFBFE6C4765E14A3EFD8388BEBCDB7C
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionFunctionInput'MaterialExpressionFunctionInput_9'
   Pins(0)=EdGraphPin'EdGraphPin_4687'
   Pins(1)=EdGraphPin'EdGraphPin_4688'
   NodePosX=-384
   NodePosY=176
   NodeGuid=AB7DB0E94A82230A816949B4C2EA7B67
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_109"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4927"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4926"
   End Object
   Begin Object Class=MaterialExpressionComponentMask Name="MaterialExpressionComponentMask_20"
   End Object
   Begin Object Name="EdGraphPin_4927"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_113.EdGraphPin_4941'
      LinkedTo(1)=EdGraphPin'MaterialGraphNode_115.EdGraphPin_4947'
   End Object
   Begin Object Name="EdGraphPin_4926"
      PinName="Input"
      PinFriendlyName=" "
      PinType=(PinCategory="required")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_40.EdGraphPin_4682'
   End Object
   Begin Object Name="MaterialExpressionComponentMask_20"
      Input=(Expression=MaterialExpressionFunctionInput'MaterialGraphNode_40.MaterialExpressionFunctionInput_7')
      R=True
      MaterialExpressionEditorX=-320
      MaterialExpressionEditorY=432
      MaterialExpressionGuid=55496A9C468B8360CC5C55AEA91D91C6
      Material=Material'/Engine/Transient.Material_3'
      Desc="from1"
      bCommentBubbleVisible=True
   End Object
   MaterialExpression=MaterialExpressionComponentMask'MaterialExpressionComponentMask_20'
   Pins(0)=EdGraphPin'EdGraphPin_4926'
   Pins(1)=EdGraphPin'EdGraphPin_4927'
   NodePosX=-320
   NodePosY=432
   NodeComment="from1"
   bCommentBubbleVisible=True
   NodeGuid=400326A347D0E467985C20ACD51DFCE9
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_110"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4929"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4928"
   End Object
   Begin Object Class=MaterialExpressionComponentMask Name="MaterialExpressionComponentMask_21"
   End Object
   Begin Object Name="EdGraphPin_4929"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_115.EdGraphPin_4946'
   End Object
   Begin Object Name="EdGraphPin_4928"
      PinName="Input"
      PinFriendlyName=" "
      PinType=(PinCategory="required")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_40.EdGraphPin_4682'
   End Object
   Begin Object Name="MaterialExpressionComponentMask_21"
      Input=(Expression=MaterialExpressionFunctionInput'MaterialGraphNode_40.MaterialExpressionFunctionInput_7')
      G=True
      MaterialExpressionEditorX=-288
      MaterialExpressionEditorY=528
      MaterialExpressionGuid=55496A9C468B8360CC5C55AEA91D91C6
      Material=Material'/Engine/Transient.Material_3'
      Desc="to1"
      bCommentBubbleVisible=True
   End Object
   MaterialExpression=MaterialExpressionComponentMask'MaterialExpressionComponentMask_21'
   Pins(0)=EdGraphPin'EdGraphPin_4928'
   Pins(1)=EdGraphPin'EdGraphPin_4929'
   NodePosX=-288
   NodePosY=528
   NodeComment="to1"
   bCommentBubbleVisible=True
   NodeGuid=5F3A8EF141832EEAE4FEC89D9E3C8211
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_108"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4933"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4932"
   End Object
   Begin Object Class=MaterialExpressionComponentMask Name="MaterialExpressionComponentMask_22"
   End Object
   Begin Object Name="EdGraphPin_4933"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_111.EdGraphPin_4956'
      LinkedTo(1)=EdGraphPin'MaterialGraphNode_116.EdGraphPin_4962'
   End Object
   Begin Object Name="EdGraphPin_4932"
      PinName="Input"
      PinFriendlyName=" "
      PinType=(PinCategory="required")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_41.EdGraphPin_4684'
   End Object
   Begin Object Name="MaterialExpressionComponentMask_22"
      Input=(Expression=MaterialExpressionFunctionInput'MaterialGraphNode_41.MaterialExpressionFunctionInput_8')
      R=True
      MaterialExpressionEditorX=-64
      MaterialExpressionEditorY=688
      MaterialExpressionGuid=55496A9C468B8360CC5C55AEA91D91C6
      Material=Material'/Engine/Transient.Material_3'
      Desc="from2"
      bCommentBubbleVisible=True
   End Object
   MaterialExpression=MaterialExpressionComponentMask'MaterialExpressionComponentMask_22'
   Pins(0)=EdGraphPin'EdGraphPin_4932'
   Pins(1)=EdGraphPin'EdGraphPin_4933'
   NodePosX=-64
   NodePosY=688
   NodeComment="from2"
   bCommentBubbleVisible=True
   NodeGuid=FD1FD22F456A8533D7347B9CF80A531F
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_107"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4937"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4936"
   End Object
   Begin Object Class=MaterialExpressionComponentMask Name="MaterialExpressionComponentMask_23"
   End Object
   Begin Object Name="EdGraphPin_4937"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_111.EdGraphPin_4955'
   End Object
   Begin Object Name="EdGraphPin_4936"
      PinName="Input"
      PinFriendlyName=" "
      PinType=(PinCategory="required")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_41.EdGraphPin_4684'
   End Object
   Begin Object Name="MaterialExpressionComponentMask_23"
      Input=(Expression=MaterialExpressionFunctionInput'MaterialGraphNode_41.MaterialExpressionFunctionInput_8')
      G=True
      MaterialExpressionEditorX=-32
      MaterialExpressionEditorY=784
      MaterialExpressionGuid=55496A9C468B8360CC5C55AEA91D91C6
      Material=Material'/Engine/Transient.Material_3'
      Desc="to2"
      bCommentBubbleVisible=True
   End Object
   MaterialExpression=MaterialExpressionComponentMask'MaterialExpressionComponentMask_23'
   Pins(0)=EdGraphPin'EdGraphPin_4936'
   Pins(1)=EdGraphPin'EdGraphPin_4937'
   NodePosX=-32
   NodePosY=784
   NodeComment="to2"
   bCommentBubbleVisible=True
   NodeGuid=ACB8D9834F7408AB0F5221A252176E31
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_113"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4942"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4941"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4940"
   End Object
   Begin Object Class=MaterialExpressionSubtract Name="MaterialExpressionSubtract_32"
   End Object
   Begin Object Name="EdGraphPin_4942"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_112.EdGraphPin_4943'
   End Object
   Begin Object Name="EdGraphPin_4941"
      PinName="B"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_109.EdGraphPin_4927'
   End Object
   Begin Object Name="EdGraphPin_4940"
      PinName="A"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_39.EdGraphPin_4688'
   End Object
   Begin Object Name="MaterialExpressionSubtract_32"
      A=(Expression=MaterialExpressionFunctionInput'MaterialGraphNode_39.MaterialExpressionFunctionInput_9')
      B=(Expression=MaterialExpressionComponentMask'MaterialGraphNode_109.MaterialExpressionComponentMask_20')
      MaterialExpressionEditorX=32
      MaterialExpressionEditorY=272
      MaterialExpressionGuid=A33FC22046567004DA0BFCA84620AC33
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionSubtract'MaterialExpressionSubtract_32'
   Pins(0)=EdGraphPin'EdGraphPin_4940'
   Pins(1)=EdGraphPin'EdGraphPin_4941'
   Pins(2)=EdGraphPin'EdGraphPin_4942'
   NodePosX=32
   NodePosY=272
   NodeGuid=D4C744FC430640ADD241A8B6C4646B57
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_112"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4945"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4944"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4943"
   End Object
   Begin Object Class=MaterialExpressionDivide Name="MaterialExpressionDivide_4"
   End Object
   Begin Object Name="EdGraphPin_4945"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_114.EdGraphPin_4952'
   End Object
   Begin Object Name="EdGraphPin_4944"
      PinName="B"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_115.EdGraphPin_4948'
   End Object
   Begin Object Name="EdGraphPin_4943"
      PinName="A"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_113.EdGraphPin_4942'
   End Object
   Begin Object Name="MaterialExpressionDivide_4"
      A=(Expression=MaterialExpressionSubtract'MaterialGraphNode_113.MaterialExpressionSubtract_32')
      B=(Expression=MaterialExpressionSubtract'MaterialGraphNode_115.MaterialExpressionSubtract_33')
      MaterialExpressionEditorX=256
      MaterialExpressionEditorY=384
      MaterialExpressionGuid=0CB07C53409396C401ADE1BF4A5188CF
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionDivide'MaterialExpressionDivide_4'
   Pins(0)=EdGraphPin'EdGraphPin_4943'
   Pins(1)=EdGraphPin'EdGraphPin_4944'
   Pins(2)=EdGraphPin'EdGraphPin_4945'
   NodePosX=256
   NodePosY=384
   NodeGuid=FF23BF67442ECD0FB1C4069DA9D5A7CF
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_115"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4948"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4947"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4946"
   End Object
   Begin Object Class=MaterialExpressionSubtract Name="MaterialExpressionSubtract_33"
   End Object
   Begin Object Name="EdGraphPin_4948"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_112.EdGraphPin_4944'
   End Object
   Begin Object Name="EdGraphPin_4947"
      PinName="B"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_109.EdGraphPin_4927'
   End Object
   Begin Object Name="EdGraphPin_4946"
      PinName="A"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_110.EdGraphPin_4929'
   End Object
   Begin Object Name="MaterialExpressionSubtract_33"
      A=(Expression=MaterialExpressionComponentMask'MaterialGraphNode_110.MaterialExpressionComponentMask_21')
      B=(Expression=MaterialExpressionComponentMask'MaterialGraphNode_109.MaterialExpressionComponentMask_20')
      MaterialExpressionEditorX=64
      MaterialExpressionEditorY=528
      MaterialExpressionGuid=A33FC22046567004DA0BFCA84620AC33
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionSubtract'MaterialExpressionSubtract_33'
   Pins(0)=EdGraphPin'EdGraphPin_4946'
   Pins(1)=EdGraphPin'EdGraphPin_4947'
   Pins(2)=EdGraphPin'EdGraphPin_4948'
   NodePosX=64
   NodePosY=528
   NodeGuid=366895084E3009A32CFE5985480CD2E6
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_114"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4954"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4953"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4952"
   End Object
   Begin Object Class=MaterialExpressionMultiply Name="MaterialExpressionMultiply_4"
   End Object
   Begin Object Name="EdGraphPin_4954"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_116.EdGraphPin_4961'
   End Object
   Begin Object Name="EdGraphPin_4953"
      PinName="B"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_111.EdGraphPin_4957'
   End Object
   Begin Object Name="EdGraphPin_4952"
      PinName="A"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_112.EdGraphPin_4945'
   End Object
   Begin Object Name="MaterialExpressionMultiply_4"
      A=(Expression=MaterialExpressionDivide'MaterialGraphNode_112.MaterialExpressionDivide_4')
      B=(Expression=MaterialExpressionSubtract'MaterialGraphNode_111.MaterialExpressionSubtract_34')
      MaterialExpressionEditorX=416
      MaterialExpressionEditorY=496
      MaterialExpressionGuid=BD0C0A5E432C609BF4E8B0BD5A907F51
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionMultiply'MaterialExpressionMultiply_4'
   Pins(0)=EdGraphPin'EdGraphPin_4952'
   Pins(1)=EdGraphPin'EdGraphPin_4953'
   Pins(2)=EdGraphPin'EdGraphPin_4954'
   NodePosX=416
   NodePosY=496
   NodeGuid=5EB5F7294FE21CF0FCCFFC8BF3DFAFE5
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_111"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4957"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4956"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4955"
   End Object
   Begin Object Class=MaterialExpressionSubtract Name="MaterialExpressionSubtract_34"
   End Object
   Begin Object Name="EdGraphPin_4957"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_114.EdGraphPin_4953'
   End Object
   Begin Object Name="EdGraphPin_4956"
      PinName="B"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_108.EdGraphPin_4933'
   End Object
   Begin Object Name="EdGraphPin_4955"
      PinName="A"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_107.EdGraphPin_4937'
   End Object
   Begin Object Name="MaterialExpressionSubtract_34"
      A=(Expression=MaterialExpressionComponentMask'MaterialGraphNode_107.MaterialExpressionComponentMask_23')
      B=(Expression=MaterialExpressionComponentMask'MaterialGraphNode_108.MaterialExpressionComponentMask_22')
      MaterialExpressionEditorX=240
      MaterialExpressionEditorY=736
      MaterialExpressionGuid=A33FC22046567004DA0BFCA84620AC33
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionSubtract'MaterialExpressionSubtract_34'
   Pins(0)=EdGraphPin'EdGraphPin_4955'
   Pins(1)=EdGraphPin'EdGraphPin_4956'
   Pins(2)=EdGraphPin'EdGraphPin_4957'
   NodePosX=240
   NodePosY=736
   NodeGuid=E315BBAA4D61134B8766DC80D8138F87
End Object
Begin Object Class=MaterialGraphNode Name="MaterialGraphNode_116"
   Begin Object Class=EdGraphPin Name="EdGraphPin_4963"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4962"
   End Object
   Begin Object Class=EdGraphPin Name="EdGraphPin_4961"
   End Object
   Begin Object Class=MaterialExpressionAdd Name="MaterialExpressionAdd_4"
   End Object
   Begin Object Name="EdGraphPin_4963"
      PinName="Output"
      PinFriendlyName=" "
      Direction=EGPD_Output
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_38.EdGraphPin_4679'
   End Object
   Begin Object Name="EdGraphPin_4962"
      PinName="B"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_108.EdGraphPin_4933'
   End Object
   Begin Object Name="EdGraphPin_4961"
      PinName="A"
      PinType=(PinCategory="optional")
      LinkedTo(0)=EdGraphPin'MaterialGraphNode_114.EdGraphPin_4954'
   End Object
   Begin Object Name="MaterialExpressionAdd_4"
      A=(Expression=MaterialExpressionMultiply'MaterialGraphNode_114.MaterialExpressionMultiply_4')
      B=(Expression=MaterialExpressionComponentMask'MaterialGraphNode_108.MaterialExpressionComponentMask_22')
      MaterialExpressionEditorX=543
      MaterialExpressionEditorY=565
      MaterialExpressionGuid=939F3AB64526DB20501AAD88B7E4BE20
      Material=Material'/Engine/Transient.Material_3'
   End Object
   MaterialExpression=MaterialExpressionAdd'MaterialExpressionAdd_4'
   Pins(0)=EdGraphPin'EdGraphPin_4961'
   Pins(1)=EdGraphPin'EdGraphPin_4962'
   Pins(2)=EdGraphPin'EdGraphPin_4963'
   NodePosX=543
   NodePosY=565
   NodeGuid=24B0CC73474478D892F51DB2BBBA2BF4
End Object


[/SPOILER]

As a side note, remapping 0 to 1 range into -1 to 1 range can be usually simplified to multiplying by 2 and subtracting 1

The only version of how can i explain the green color bleeding, where you expect only orange, lies in the fact that MF_WeaponsGlow is returning negative value and somehow subtracts the (12, 0.5, 0.2) color part, instead of adding it.

Dangit! negative values… that was the ticket. It’s the remap. I’m clamping the output, but it’s being clamped to -1 by the ‘output range’ and is indeed subtracting colours.

The reason for the more complex logic in the remap function is because sometimes I want to range to completely different values etc. With this done though, I should be able to fix the problem now. Argh! Thanks for the nudge!