Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
88888888

Is there a way or script that determain max light an object can receive?

Question

Hello again guys. I really hate when my skin shader receive too much light from sun so I'm looking for a script that determain max light an object can receive! for example my directional light amount is 1.2 but I need an object receive only 0.8 amount of light. Is that possible?

Edited by 88888888

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Please login or register to see this quote.

 

Thanks but that's not a wise method! Too much dark tint can cause incorrect result. 

Share this post


Link to post
Share on other sites
  • 0

Use two lights and separate the objects into two separate layer. Render the low light level object using one light and everything else with the other

  • Like 2

Share this post


Link to post
Share on other sites
  • 0

@OcularCash even tho this is kind of a workaround and could get messy when you have multiple objects you want to do that for, i still love this idea cuz its so simple <3 

 

so now... first of all if a pbr material looks wrong but every other pbr material in the scene looks fine the material is most likely wrong and your first thing to to would be to check if all the textures are correct (is the albedo to bright maybe?) 

 

So if you dont care about physical accuracy you can download the standard shader and add a float to the material 0-1 where 1 would be recives the full light and 0 would be none.

There should be a line col = ...  in the function the vertex color gets calculated now just multiply by the float you defined .... shaderlab is a bit tricky i guess you have to declare that you want to actually use the float somewhere and this method is like a tint im sure you can actually calculate the light better but im not a shader pro.

Pro: to this would be that you can set the light for every material differently without the need of an extra layer or light. 

Con: you actually have to understand some shaderlab to get this working (i could do it for you as soon i got time tho.) 

 

edit: 

download shaders from Please login or register to see this link.

and Tutorial on shaderlab Please login or register to see this link.

and especially on how to add a tint to the shader Please login or register to see this link.  (note: im sure there is a better way to do this tho.) 

 

hope this helped somewhat 

 

Edited by Erarnitox
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×