i'm trying to put light and shadows on my 2D character but when i set the material on it to Sprites/Diffuse, it's kinda putting a strange smooth on my pixels.

Without diffuse:

Without dif

With diffuse:

enter image description here

And i saw that with diffuse it doesn't appear any shadow, it's normal?

  • \$\begingroup\$ Completely normal. casting shadows is a property of lights. Set them there. Diffuse lighting will work like this. If you are using point lights, try using directional lights instead( is it called sun in unity?) \$\endgroup\$ Apr 9 '15 at 6:20
  • \$\begingroup\$ I used point lights just to test, the sun lights is the directional if i'm not wrong. The problem isn't just the light, if you notice, when i use the diffuse property, it does kinda an anti alias to my character, that make it weird \$\endgroup\$ Apr 9 '15 at 6:24
  • \$\begingroup\$ The lighting is calculated per pixel/vertex, so the pixels of the sprite that are further from the light receive less light and are darker. No anti-aliasing here. \$\endgroup\$ Apr 9 '15 at 6:28
  • \$\begingroup\$ No, i don't want the antialias, look at the pixels from the diffuse image, and without the diffuse. With the diffuse the engine tries to smooth the pixels and make what i don't want \$\endgroup\$ Apr 9 '15 at 6:34
  • \$\begingroup\$ Looks more like z fighting than anything color related. How are you drawing this? Just a quad? \$\endgroup\$
    – Jon
    Apr 9 '15 at 14:44

Well, I found how to fix. You have to recreate the project, and then before put all the sprites together, you have to unmark Generate MipMaps and change filter mode to point. Do this without creating a new project(inside of the project already done) didn't worked. Then after replacing all the slices, you put the material with Sprites/Diffuse.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .