public void Compile(ShaderGraphMaterial shader) { if ((int)m_ChannelMask < (int)m_OutParam.Type || (int)m_ChannelMask >= (int)m_OutParam.Type + 1) { throw new TypeMismatch(shader.CurrentInstructionIndex, m_OutParam.Type.ToString(), ((VariableType)((int)m_ChannelMask)).ToString()); } shader.AddTextureSlot(m_TextureType, m_TextureSlot); shader.AddSamplerSlot(m_SamplerSlot); shader.AddSetValue(m_OutParam, $"{m_TextureSlot}.Sample({m_SamplerSlot}, {m_UVSlot}).{m_ChannelMask.ToString().ToLower()}"); }
public void Compile(ShaderGraphMaterial shader) { shader.AddSetValue(m_Variable, m_Value.Name.ToString() + "." + m_Mask.ToString().ToLower()); }
public void Compile(ShaderGraphMaterial shader) { shader.AddSetValue(m_Variable, m_Value.ToString()); }