Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 PJisAnarchist · Mar 27, 2014 at 06:37 PM · shadercustomspecularunlitbump

How to make an unlit shader use spec and normal maps?

Hi all!

I need your knowledge once more. I must create a building with a vray baked texture, a detail map and some normal map and specular. I tried warping light but it is not a true unlit look and anyway, it mess with the bump and specular. It flattens it, wich is logical. I d like to have my constant(unlit) texture, with details texture on it , and a specular affected by a normal map.

Does anyone see how to do that in a custom shader?

Any help is much appreciated. PJ

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Owen-Reynolds · Mar 28, 2014 at 04:58 AM

Sounds like the existing SelfIllum/BumpSpec shader?

The default setting is all white (all illuminated.) Or could delete the line where it looks up the illum map, to make it run a bit faster?

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
avatar image
0

Answer by PJisAnarchist · Mar 28, 2014 at 08:39 AM

Annnnnd... Almost. It could work, but as soon as I activate a light (needed for the specular), it gets illuminated and doesn't act like an unlit basis anymore. I'll try and dig it's code anyway. Thanks. If you have another idea, i'll take it. Cheers.

Comment
Add comment · Show 4 · 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
avatar image Kuba · Mar 28, 2014 at 09:22 AM 0
Share

Where do you want the specular to come from? From a light actually placed in the scene? And you just want the specular contribution and not the diffuse? Should all the lights affecting the object behave this way or just one of them?

avatar image PJisAnarchist · Mar 28, 2014 at 10:08 AM 0
Share

The specular should come from a directional light. Just one. I need the specular to be added to the unlit diffuse. Any idea?

Unlit Texture2D (from a baked Vray). +Detail in overlay or product. +Normal$$anonymous$$ap deformed and alpha masked specular.

avatar image Owen-Reynolds · Mar 28, 2014 at 01:52 PM 0
Share

Hmm...this should be a comment, but now has comments.

A Unity surf shader magically adds one final line, using math to adjust the color (`o.Albedo`) for diffuse and spec, for every light. So the correct solution is to use a non-surf frag shader, where that final line is in the shader already. Then you could remove the diffuse and ambient contribution. But I'm not sure where to find a Unity version of one of those.

Or, a hack. It appears the fully self-illum parts ignore the diffuse contribution of lights, but pick up the ambient light. Setting ambient light to black, in render settings, might work (but only if nothing else in the scene gets regular lighting.)

avatar image PJisAnarchist · Mar 28, 2014 at 02:08 PM 0
Share

"So the correct solution is to use a non-surf frag shader, where that final line is in the shader already."

I'm not sure to understand that, and I don't see how to code it. If you find a piece of code as an example, that'd be great, in the meantime I'll try and hack that self-illum shader. Thx for the head's up.

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

22 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

Related Questions

Specular problem 1 Answer

Bump Specular with Hue Shift 0 Answers

Easy way to make a custom toon water shader 1 Answer

Cutout + Specularmask-shader error: "Material doesn't have a color property" 0 Answers

How To Replicate the Untitled Goose Game Art Style? 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