- Home /
Shadows using Point Light
I have a car garage area and I have placed a point light to give lighting and shadows for all objects of the garage area.
I can able to get lights but there are no shadows, I hope you can see in the above screenshot. Here you have light inspector data:
In the same scene, there is a Directional Light too and it can able to generate shadows too. But I want to use only Point Light for my garage area so I have created a separate layer for this.
After this Point Light can't able to generate shadows but Direction Light can able to show shadows in the Garage area too that I have checked. Now guide me to display shadows using Point Light.
As unity manuals for Shadows says:
https://docs.unity3d.com/$$anonymous$$anual/ShadowOverview.html
Each $$anonymous$$esh Renderer in the Scene also has a Cast Shadows and a Receive Shadows property, which must be enabled as appropriate.
Enabling Shadows
Use the Shadow Type property in the Inspector to enable and define shadows for an individual light.
Property||Function:
Shadow Type -The Hard Shadows setting produces shadows with a sharp edge. Hard shadows are not particularly realistic compared to Soft Shadows but they involve less processing, and are acceptable for many purposes. Soft shadows also tend to reduce the “blocky” aliasing effect from the shadow map.
Strength -This deter$$anonymous$$es how dark the shadows are. In general, some light is scattered by the atmosphere and reflected off other GameObjects, so you usually don’t want shadows to be set to maximum strength.
Resolution -This sets the rendering resolution for the shadow map’s “Camera” mentioned above. If your shadows have very visible edges, then you might want to increase this value.
Bias -Use this to fine-tune the position and definition of your shadow. See Shadow mapping and the Bias property, below, for more information.
Normal Bias -Use this to fine-tune the position and definition of your shadow. See Shadow mapping and the Bias property, below, for more information.
Shadow Near Plane -This allows you to choose the value for the near plane when rendering shadows. GameObjects closer than this distance to the light do not cast any shadows.
Enable Cast Shadows by selecting On from the drop-down menu to enable or disable shadow casting for the mesh
Alternatively, select Two Sided to allow shadows to be cast by either side of the surface (so backface culling is ignored for shadow casting purposes), or Shadows Only to allow shadows to be cast by an invisible GameObject.
Cast Shadows and Receive Shadows by default come with ON property as like this example:
Ahh got it! Shadow cascade $$anonymous$$ust be on 4 cascades to work with lighting. Yours is set to no cascades in top pic left
[Edit]This is not Accurate at all, Leaving up though until questioner moves his comment so his example image doesn't get removed also. Will remove when he/she does.
https://docs.unity3d.com/$$anonymous$$anual/DirLightShadows.html
Answer by siddharth3322 · Feb 21, 2019 at 08:31 AM
Now I can able to find help from Unity Forum member. If you have directional light exist and you are also using other types of lights in the same scene then you have to increase Pixel Light Count figure in Rendering section, I have 0 over there and now I set to 1 and now I can able to get shadow over my garage area.
This is the exact reply from the right person:
I hope this reply become useful to other members.
This turned out to be a useful resource, thanks for updating us on how it all when :)
You should update the one photo in original message highlighting where they error is so other find it easy :) just add a red box like i did :)
edit
Also mark as solved in title [Solved], close and this question is complete :)
Answer by zereda-games · Feb 19, 2019 at 04:49 PM
So even with our Unity's being a different version apparently i found the issue. Below are 2 example images as to where the issue was.
NOTE
To be clear, I do not think the first image is the issue, i think it is the intensity only! I simply noticed the warning and thought i should share as it clearly doesn't tell you on older versions of unity in the inspector, this must be a very new feature, as our unities are only a few months apart. Anyway, hope this helps some people out. and @siddharth3322, thank you for letting me help.
Thamas bell @ ZeredaGames and Co.
Trying to copy your setting from the picture and i saw this error/\
Wow, excellent, you found the solution. But feel sad that I can't able to use point light now. Please write proper explanation to your answer so I can mark it as correct.
sorry this didn't work out as expected. But try out second pic and see if That lets you still use it!?
In Point and Spot Light shadows not possible to display, right ??
your Intensity is 3 and default is 600 check that. Umm It says at runtime. but baked and mixed the error goes away. so i don't think that's causing your issue.
I upvoted for your efforts and thanks for your time.
Recogniiiiisssee!! Thank you! much appreciated :)
Answer by bpaynom · Feb 19, 2019 at 01:08 PM
Disable Directional light (for testing), and check the garage is lighted by the point light. Increase the range and intensity. Sometimes the light from the Sun (directional light) brights to much and makes some shadows to be "invisible".
I have disabled directional light and increased the intensity of point light but there are no shadows.
have you read through the manual? have you enabled objects to acutally receive shadows?
That photo doesnt look like there is only one point light. Have you check that there is no other lights? You can check it typing "light" in the search area of the Hierarchy. Also, check ambient light. And what shaders are you using for this? Default ones?
Basically, if I turn off Point light and enable direction light then there are clear shadows become visible. See below image: