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 elpulpobastardo · Apr 19, 2015 at 03:26 PM · shaderlightinglightmapart

Need a shader that allows shadows, but will not change object colour.

I imagine this has been asked for previously, but I've been searching all weekend and I can't find a thing!

alt text

This is the kind of visual style I am after, as seen on the big grey area in the middle. The game is viewed from an isometric angle, and I wanted to be able to control the colour of each side of the shape. So there is a light, mid, and dark side.

So far, I have set the ambient light in the scene to pure white, and am using coloured quads to get precise control over each faces colour. The main reason for this is because I don't like the tonal values generated by using things like directional lights. This method seems to be better for marrying the in-game scene with the Photoshop concept art.

alt text

The problem is that for a player to understand the spatial construction of each level, shadows are needed. A downward facing directional light was added, and suddenly the additive effect it has on the colours loses the art style. As you can see my light grey tone is now pure white!

What I THINK I need is a shader that allows me to get these shadows appearing on objects correctly, but without affecting the coloured quads. I have tried a bunch and nothing works. I tried making my own, but still no good.

Later on I would like to add some ambient occlusion, so I guess whatever I use also needs to work with light mapping.

A friend suggested using coloured lights to actually achieve the tonal values instead of coloured quads, but I don't really want three directional lights in a mobile game if possible.

I may even just be going about setting this all up in entirely the wrong way, so please put me right if that's the case :)

screen-shot-2015-04-19-at-111301.png (19.1 kB)
screen-shot-2015-04-19-at-111357.png (22.6 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by siaran · Apr 20, 2015 at 02:53 PM

Have you tried reducing the intesity of your directional light?

Comment
Add comment · Show 3 · 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 elpulpobastardo · Apr 20, 2015 at 05:25 PM 0
Share

Yep. It does start to reveal some of that grey again, but even at 0.05 it's way too light, and then of course you lose the shadow! I need to control the colour of each face perfectly whilst allowing shadows to fall in the usual way.

avatar image siaran · Apr 21, 2015 at 06:49 AM 0
Share

Hmm, have you tried reducing the intensity of the ambient light ins$$anonymous$$d of the directional one?

avatar image elpulpobastardo · Apr 22, 2015 at 07:18 PM 0
Share

That has a pretty similar outcome. It really just increases the contrast, i.e the shadows become darker along with the half-lit surfaces, but the upward faces remain really bright. This still doesn't allow me control over the surface colour in the way I want.

I have been trying to learn more about shaders, so I am going to try and write my own soon to get exactly what I want!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

cast shadow - export lightmap from 3ds max to unity 2 Answers

bake error 1 Answer

Shader: Correct directional lightmap decoding in custom lighting function 0 Answers

Mobile BEAST lightmapping shader/lighting question 0 Answers

Static+Real Time lighting in Angry Bots Demo 1 Answer


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