protected internal override void OnBind() { maskTextureScaleParameter = GetParameter("MaskTextureScale"); maskTexture0Parameter = GetParameter("MaskTexture0"); maskTexture1Parameter = GetParameter("MaskTexture1"); var maskTextures = MaterialPaintGroup.GetMaskTextures(MaterialGroup); maskTexture0 = maskTextures != null && maskTextures.Count > 0 ? maskTextures[0] as Texture2D : null; maskTexture1 = maskTextures != null && maskTextures.Count > 1 ? maskTextures[1] as Texture2D : null; maskTextureScale = MaterialPaintGroup.GetMaskTextureScale(MaterialGroup); maskTextureScale.X = 1.0f / maskTextureScale.X; maskTextureScale.Y = 1.0f / maskTextureScale.Y; }
protected internal override string GetShaderCode(MaterialUsage usage) { var maskCount = MaterialPaintGroup.GetMaskTextures(MaterialGroup).Count; return(GetShaderCode("BeginPaintGroup").Replace("{$T2}", maskCount > 1 ? "" : "//")); }