0

[BUG] "Attempt to find input node of connector B of Lerp" error with working shader

Bunkins 8 years ago updated by Hb Spartan IV 8 years ago 1

Hi,


I've created a shader, but now it won't open in the Shader Forge editor, despite the shader being functional in my game.


--------------------------------------------------


The error I get:


Attempt to find input node of connector B of Lerp

UnityEngine.Debug:LogWarning(Object)
ShaderForge.SF_Node:GetInputData(String)
ShaderForge.SFN_Lerp:IsUniformOutput()
ShaderForge.SFN_If:IsUniformOutput()
ShaderForge.SF_NodePreview:Combine()
ShaderForge.SF_Node:RefreshValue(Int32, Int32)
ShaderForge.SF_Node_Arithmetic:RefreshValue()
ShaderForge.SF_Node:OnUpdateNode(NodeUpdateType, Boolean)
ShaderForge.SF_NodeConnector:SetValueType(ValueType)
ShaderForge.SFNCG_Arithmetic:SetOutputValueType(ValueType)
ShaderForge.SFNCG_Arithmetic:Refresh()
ShaderForge.SF_NodeConnector:LinkTo(SF_NodeConnector, LinkingMethod, Boolean)
ShaderForge.SF_Link:Establish(SF_Editor, LinkingMethod)
ShaderForge.SF_Parser:LoadFromNodeData(String, Single, String&)
ShaderForge.SF_Parser:ParseNodeDataFromShader(SF_Editor, Shader)
ShaderForge.SF_Editor:InitializeInstance(Shader)
ShaderForge.SF_Editor:Init(Shader)
ShaderForgeMaterialInspector:OnInspectorGUI() (at Assets/ShaderForge/Editor/InternalResources/Inspectors/ShaderForgeMaterialInspector.cs:85)
UnityEditor.DockArea:OnGUI()

--------------------------------------------------


Shader code:


// Shader created with Shader Forge v1.31

// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
// Note: Manually altering this data may prevent you from opening it in Shader Forge
/*SF_DATA;ver:1.31;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:0,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:0,bdst:1,dpts:2,wrdp:True,dith:0,rfrpo:True,rfrpn:Refraction,coma:15,ufog:False,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:3138,x:34102,y:32600,varname:node_3138,prsc:2|custl-3292-OUT;n:type:ShaderForge.SFN_Color,id:7241,x:32379,y:32482,ptovrint:False,ptlb:BuildingColour,ptin:_BuildingColour,varname:node_7241,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.3822448,c2:0.4270076,c3:0.5147059,c4:1;n:type:ShaderForge.SFN_Color,id:4209,x:32379,y:33285,ptovrint:False,ptlb:FogColourBase,ptin:_FogColourBase,varname:node_4209,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:1,c2:0.8068966,c3:0,c4:1;n:type:ShaderForge.SFN_FragmentPosition,id:1951,x:32379,y:32651,varname:node_1951,prsc:2;n:type:ShaderForge.SFN_Abs,id:8707,x:32630,y:32848,varname:node_8707,prsc:2|IN-1951-Y;n:type:ShaderForge.SFN_ValueProperty,id:6201,x:32379,y:33001,ptovrint:False,ptlb:FogStartDistance,ptin:_FogStartDistance,varname:node_6201,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,v1:50;n:type:ShaderForge.SFN_ValueProperty,id:7992,x:32379,y:33097,ptovrint:False,ptlb:FogEndDistance,ptin:_FogEndDistance,varname:node_7992,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,v1:200;n:type:ShaderForge.SFN_ValueProperty,id:835,x:32804,y:32937,ptovrint:False,ptlb:FogFadeHeight,ptin:_FogFadeHeight,varname:node_835,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,v1:200;n:type:ShaderForge.SFN_If,id:3292,x:32947,y:32621,varname:node_3292,prsc:2|A-1775-OUT,B-6201-OUT,GT-1030-OUT,EQ-7241-RGB,LT-7241-RGB;n:type:ShaderForge.SFN_InverseLerp,id:3203,x:32630,y:33001,varname:node_3203,prsc:2|A-6201-OUT,B-7992-OUT,V-1775-OUT;n:type:ShaderForge.SFN_InverseLerp,id:823,x:32991,y:32866,varname:node_823,prsc:2|A-8016-OUT,B-835-OUT,V-8707-OUT;n:type:ShaderForge.SFN_Vector1,id:8016,x:32804,y:32833,varname:node_8016,prsc:2,v1:0;n:type:ShaderForge.SFN_OneMinus,id:4025,x:33161,y:32866,varname:node_4025,prsc:2|IN-823-OUT;n:type:ShaderForge.SFN_Multiply,id:3842,x:33339,y:32866,varname:node_3842,prsc:2|A-4025-OUT,B-3203-OUT;n:type:ShaderForge.SFN_Lerp,id:1030,x:33636,y:32860,varname:node_1030,prsc:2|A-7241-RGB,B-4209-RGB,T-3842-OUT;n:type:ShaderForge.SFN_ViewPosition,id:6443,x:32379,y:32774,varname:node_6443,prsc:2;n:type:ShaderForge.SFN_ComponentMask,id:4275,x:32630,y:32482,varname:node_4275,prsc:2,cc1:0,cc2:2,cc3:-1,cc4:-1|IN-1951-XYZ;n:type:ShaderForge.SFN_Distance,id:1775,x:32826,y:32492,varname:node_1775,prsc:2|A-4275-OUT,B-382-OUT;n:type:ShaderForge.SFN_ComponentMask,id:382,x:32630,y:32682,varname:node_382,prsc:2,cc1:0,cc2:2,cc3:-1,cc4:-1|IN-6443-XYZ;proporder:7241-6201-7992-4209-835;pass:END;sub:END;*/

Shader "Shader Forge/BuildingFogTest" {
Properties {
_BuildingColour ("BuildingColour", Color) = (0.3822448,0.4270076,0.5147059,1)
_FogStartDistance ("FogStartDistance", Float ) = 50
_FogEndDistance ("FogEndDistance", Float ) = 200
_FogColourBase ("FogColourBase", Color) = (1,0.8068966,0,1)
_FogFadeHeight ("FogFadeHeight", Float ) = 200
}
SubShader {
Tags {
"RenderType"="Opaque"
}
Pass {
Name "FORWARD"
Tags {
"LightMode"="ForwardBase"
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#define UNITY_PASS_FORWARDBASE
#include "UnityCG.cginc"
#pragma multi_compile_fwdbase_fullshadows
#pragma only_renderers d3d9 d3d11 opengl gles
#pragma target 3.0
uniform float4 _BuildingColour;
uniform float4 _FogColourBase;
uniform float _FogStartDistance;
uniform float _FogEndDistance;
uniform float _FogFadeHeight;
struct VertexInput {
float4 vertex : POSITION;
};
struct VertexOutput {
float4 pos : SV_POSITION;
float4 posWorld : TEXCOORD0;
};
VertexOutput vert (VertexInput v) {
VertexOutput o = (VertexOutput)0;
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
o.pos = mul(UNITY_MATRIX_MVP, v.vertex );
return o;
}
float4 frag(VertexOutput i) : COLOR {
////// Lighting:
float node_1775 = distance(i.posWorld.rgb.rb,_WorldSpaceCameraPos.rb);
float node_3292_if_leA = step(node_1775,_FogStartDistance);
float node_3292_if_leB = step(_FogStartDistance,node_1775);
float3 finalColor = lerp((node_3292_if_leA*_BuildingColour.rgb)+(node_3292_if_leB*lerp(_BuildingColour.rgb,_FogColourBase.rgb,((1.0 - ((abs(i.posWorld.g)-0.0)/(_FogFadeHeight-0.0)))*((node_1775-_FogStartDistance)/(_FogEndDistance-_FogStartDistance))))),_BuildingColour.rgb,node_3292_if_leA*node_3292_if_leB);
return fixed4(finalColor,1);
}
ENDCG
}
}
FallBack "Diffuse"
CustomEditor "ShaderForgeMaterialInspector"
}

Any ideas how I can fix up the Shader Forge comment, so make this shader editable again? Thanks!

I have the same problem .. been working on a shader for hours now I'm totally stuck!