Hi there. I’m trying to make a threadbare carpet material so I don’t want any specular reflection.
This page…
…says ‘the alpha channel of the main texture acts as a Specular Map’. I have tried, in Photoshop, to add an alpha channel which is just black (0 specular), but the image does not save with that alpha channel included!
How do I save an image with an alpha channel set to black?
I have tried using both the metallic and specular versions of the standard shader, but even when I set the specular to colour to black, or added a black texture to the specular texture, I’m still getting specular reflections off my carpet!
What’s the deal? How do I save an image with a black alpha channel?
Any help, much appreciated!
Hi Moose,
Here I have an custom shader class for you, to create one, go in editor->Assets-> right mouse → create → shader → sub shader (first)
name your shader what you’ll want
and open it with Visual studio or Monodevelop
replace all code within the standard shader with:
//name "customShader" whatever you like to name it
Shader "Custom/customShader" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Main textyre", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_Transparency ("Transparency", Range(0.0,1.0)) = 1
}
SubShader {
Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard alpha
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
half _Glossiness;
half _Metallic;
fixed4 _Color;
half _Transparency;
void surf (Input IN, inout SurfaceOutputStandard o) {
// Albedo comes from a texture tinted by color
fixed4 alpha = fixed4(1, 1, 1, _Transparency);
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * alpha * _Color;
o.Albedo = c.rgb;
o.Alpha = alpha.a;
// Metallic and smoothness come from slider variables
o.Smoothness = _Glossiness;
o.Metallic = _Metallic;
}
ENDCG
}
FallBack "Diffuse"
}
In this case to use this shader, create new material add to shader → Custom → customShader
Playaround with the smoothness and metallic (smooth and metallic 0 is no specular)
Hope this worked a bit