I'm really confused about why does the Standard Unity shader look so different from my bare-bone shader with Surf Standard. The biggest and maybe the only difference is how Specular Highlights looks, mine is much darker make it almost unusable along with objects with Standard shader in the scene. From my understanding, if I use the same textures and use "surf Standard" it should look pretty much the same. Here is the shader: Code (CSharp): Shader "Custom/MyStandard" { Properties { _Color ("Color", Color) = (1,1,1,1) _MainTex ("Albedo (RGB)", 2D) = "white" {} _Metallic("Metallic (R=Metallic, A=Smoothness)", 2D) = "white" {} _Smoothness("Smoothness", Range(0,1)) = 0.5 _BumpMap("Bumpmap", 2D) = "bump" {} } SubShader { Tags { "RenderType"="Opaque" } CGPROGRAM #pragma surface surf Standard fullforwardshadows sampler2D _MainTex; sampler2D _Metallic; sampler2D _BumpMap; float _Smoothness; struct Input { float2 uv_MainTex; float2 uv_Dirt; float3 viewDir; }; fixed4 _Color; void surf (Input IN, inout SurfaceOutputStandard o) { fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; o.Albedo = c.rgb; o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex)); fixed4 m = tex2D(_Metallic, IN.uv_MainTex); o.Metallic = m.r; o.Smoothness = _Smoothness * m.a; } ENDCG } FallBack "Diffuse" } And now comparising to show what I mean (please note that all textures and settings are the same 100%) I really need to get this looking the same way (or similar). If it is indeed intended behavior, how can I fake it to make it look more simular?
edit: Guess it was the #pragma 3.0. I had tested it initially without texture and it made no difference, but once I setup all the texture channels it did make a difference, bleh.
You're missing one line: #pragma target 3.0 If you don't have that line, Unity shaders default to the equivalent of "target 2.0". Basically it means "support every possible platform", where as target 3.0 means "target modern devices". https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html The Standard lighting model uses a simplified, mobile version of the lighting when the shader is targeting 2.0 compared to 3.0 and above. This only has an affect on float values, like how the Standard shader uses it, not textures.
Thanks, bgolus! Adding "#pragma target 3.0" is exactly what I was looking for, now it is 1 to 1. Although, seems wrong that "nicer lighting" gives much brighter results.
Standard using target 2.0 is lambert diffuse with normalized blinn-phong specular. Standard using target 3.0 is disney diffuse with ggx specular and additional fresnel effects. They're very different. GGX has a much wider specular highlight, so at the same relative smoothness values more of the mesh will be lit up from that. And at 0% smoothness, disney diffuse has a very flat and "soft" diffuse falloff curve meaning more of the surface facing the light will appear lit compared to lambert. Lambert & normalized blinn phong is kind of where PBR started off, with it being the first steps toward having the "specular sharpness" (now referred to as glossiness, roughness, or smoothness) be what controls the specular brightness, which is how it works in the real world, rather than having artists arbitrarily tweak them as two different values. Disney diffuse or some other Oren-Nayer like diffuse with GGX is where we are now, and better matches real world measured data than blinn phong, though it's far from perfect.