|
|
|
|
|
|
|
|
|
|
public void SetConvolutionDivisor(float value) |
|
|
|
{ |
|
|
|
if (value == m_ConvolutionFilter[6].w) |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (onModified != null) |
|
|
|
onModified(this, ModificationScope.Node); |
|
|
|
} |
|
|
|
|
|
|
|
public float GetConvolutionWeight(int row, int col) |
|
|
|
|
|
|
string propGuid = guid.ToString().Replace("-", "_"); |
|
|
|
for (int i = 0; i < kNumConvolutionVector4; ++i) |
|
|
|
{ |
|
|
|
visitor.AddShaderChunk(precision + " " + GetPropertyName(i, propGuid) + ";", true); |
|
|
|
visitor.AddShaderChunk(precision + "4 " + GetPropertyName(i, propGuid) + ";", true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
string samplerName = GetSlotValue(InputSlot1Id, generationMode); |
|
|
|
|
|
|
|
//uv
|
|
|
|
//string input2Value = GetSlotValue(InputSlot2Id, generationMode);
|
|
|
|
var uvSlot = FindInputSlot<MaterialSlot>(InputSlot2Id); |
|
|
|
if (uvSlot == null) |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
//texelSize
|
|
|
|
string texelSize = samplerName + "_TexelSize.xy"; |
|
|
|
|
|
|
|
visitor.AddShaderChunk(precision + "4 " + GetVariableNameForSlot(OutputSlotId) + " = " + GetFunctionCallBody(samplerName, baseUV, texelSize) + ";", true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int valueIndex = col * 5 + row; |
|
|
|
int vectorIndex = valueIndex / 4; |
|
|
|
int vectorOffset = valueIndex % 4; |
|
|
|
|
|
|
|
outputString.AddShaderChunk("fetches *= weights6.w;", false); |
|
|
|
outputString.AddShaderChunk("fetches /= weights6.w;", false); |
|
|
|
outputString.AddShaderChunk("return fetches;", false); |
|
|
|
|
|
|
|
outputString.Deindent(); |
|
|
|