- Home /
Create Shaded area Unity2D
Hello, I am trying to get a shaded area in my scene, but I have no Idea how to go about it. My scene is made out of Quads with a Sprite/Diffuse Shader all located at z=0. My main camera is orthographic and it is located at z= -20. The light that I am currently using for illuminating all the scene is a directional light located at z=-30. Here is a illustration of the shaded area that I would like to have ( sorry for the very poor quality ):
Any directions on how to go about this will be greatly appreciated.
Thanks.
Answer by highpockets · Mar 12, 2014 at 05:52 AM
I have 2 ideas.
Use a floating plane (quad) which casts a shadow over the area ahead of the player and make it a child of the camera. This will give you good looking results, but will be much more CPU intensive than my second option due to the lighting calculations.
Use a transparent floating plane (quad) which has a black texture on it and set the alpha of the texture to something that you find is reasonable looking and again, child it to the camera. Place it somewhere between the cam and the gameplay area. This won't be as CPU intensive because there wouldn't be any lighting calculations.
Your answer
Follow this Question
Related Questions
Writing a 2D shadow shader for top-down game 0 Answers
Blob Shadows - Reversing Shadow Effect? 2 Answers
Dynamic objects lighting and rendering (exterior scene) 3 Answers
bake error 1 Answer
Light Bleeding Through Hard Edges on Shadow Casting Object 1 Answer