Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by moosefetcher · Oct 14, 2016 at 08:57 AM · shaderspecularalpha-channel

Forcing the Standard Shader to use 0 specular

Hi there. I'm trying to make a threadbare carpet material so I don't want any specular reflection. This page...

https://docs.unity3d.com/Manual/shader-NormalSpecular.html

..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!

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Namey5 · Oct 14, 2016 at 10:10 AM 0
Share

So you can't just set the Smoothness value to 0? Is there something different about your material editor?

avatar image Namey5 · Oct 14, 2016 at 10:14 AM 0
Share

Also, the page you linked to is not about the Standard shader, it is about the Specular shader which has since been replaced by the Standard shader and is ins$$anonymous$$d available in the legacy shaders sub-menu.

avatar image moosefetcher · Oct 14, 2016 at 12:28 PM 0
Share

Ah ha! Well, the fact is was from an earlier version of Unity was not obvious to me. So I'm guessing the 'alpha channel acts as Specular $$anonymous$$ap' line doesn't apply. I had also already set smoothness to 0, but the carpet still has specular reflection. $$anonymous$$aybe I can say the home owners have just has the carpet cleaned or something...

avatar image Namey5 moosefetcher · Oct 14, 2016 at 12:34 PM 0
Share

It shouldn't have reflection unless you have set the default reflection source in the lighting menu to 'Custom', in which case it may disregard smoothness settings. Could you post an image?

avatar image moosefetcher Namey5 · Oct 22, 2016 at 06:29 AM 0
Share

O$$anonymous$$, that's good to know. I'll check the lighting menu setting on $$anonymous$$onday. I have smoothness set to 0, but I'm still getting a subtle 'sheen' reflected on the carpet material, so that may well be it.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by JScotty · Oct 14, 2016 at 09:38 AM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

79 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Modifing the Standard Shader (specular setup) and Multiple UV set. 1 Answer

[FOUND] Mobile shader with those mixed effects : Transparency, specular, diffuse, cubemap reflection ? 2 Answers

transparent + reflection shader (river water problems) 2 Answers

Sharp reflections despite material smoothness? 0 Answers

Lighted Toon with Highlight 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges