- Home /
Shader Color Bumped elements
Hi guys , is any way to color a bumped elements from normal map in other color then main texture ?
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_BumpMap ("NormalMap", 2D) = "bump" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float2 uv_BumpMap;
};
sampler2D _BumpMap;
fixed4 _Color;
void surf (Input IN, inout SurfaceOutputStandard o) {
// Albedo comes from a texture tinted by color
fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
o.Normal = UnpackNormal (tex2D(_BumpMap, IN.uv_BumpMap)) *20 ;
// Metallic and smoothness come from slider variables
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613195444im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
U5 shader coming out solid black on newer iOS devices (iPad 2 Air / iPhone 6) 1 Answer
A shader that ignores the direction of normals, but takes distance into account 0 Answers
Problem of color in custom vertex shader 0 Answers
Reflection probes overriding roughness 0 Answers
Shader: Normal Angle 1 Answer