5
\$\begingroup\$

I have a wheel model. It's use Reflected Diffuse shader and only one texture and only one material. So it should seen like that, right?

But it's seen like that:

I'm really curious about that. What is the name of this technique? I want to search and learn this texturing technique but i don't know it's name.

When I add black texture on wheel material:

You see, texture is completely black. But why material not black completely? This is the question. What is the name of this technique?

Now we see with original texture:

It's really awesome.

\$\endgroup\$
1
\$\begingroup\$

I wasn't sure if there was a name for the technique, but I was corrected, (Thank you, DMGregory) and a common name for the technique would be having a "specular mask", where a colour channel of a texture "masks" or controls the intensity of the specular reflection. This is demonstrated below in this code which is actually an excerpt from the code of the shader you show in your screenshots.

void surf (Input IN, inout SurfaceOutput o) {
    fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
    fixed4 c = tex * _Color;
    o.Albedo = c.rgb;

    fixed4 reflcol = texCUBE (_Cube, IN.worldRefl);
    reflcol *= tex.a;
    o.Emission = reflcol.rgb * _ReflectColor.rgb;
    o.Alpha = reflcol.a * _ReflectColor.a;
}

The part most relevant to your question are the lines reflcol *= tex.a; and o.Emission = reflcol.rgb * _ReflectColor.rgb; where, first, the alpha channel of your base texture is factored into the colour of the reflective cubemap texture and then that colour is made to be the Emission term of the output. The Unity wiki says that the Emission term shows up even if the surface is in absolute darkness, like it might be if it were in shadow. This also explains why the reflection showed up even if the texture was nearly completely black.

So, you could say that the shininess of the surface depends on where the base texture is or isn't transparent, and if you opened up the texture for the tire in an image editor, you'd see that some sections like the tire treads would be mostly transparent.

\$\endgroup\$
  • 2
    \$\begingroup\$ I usually see the technique of using one channel of a texture to control the intensity of some effect (specularity, reflection, etc.) called "masking" - so in this case, we might refer to the texture's alpha channel as a "reflection mask" \$\endgroup\$ – DMGregory Apr 22 '16 at 3:43
  • \$\begingroup\$ Oh, right. Thanks, I'll edit the answer to reflect that. \$\endgroup\$ – awsumpwner27 Apr 22 '16 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.