Hello Guest

Author Topic: Baked Shadows/Lightprobes with Sprites  (Read 6722 times)

dariuslol

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Baked Shadows/Lightprobes with Sprites
« on: November 18, 2012, 01:34:30 am »
Hi,
I've purchased 2D Toolkit recently and it's a wonderful tool.
But in my project, I'm currently testing some effects possibilities.

Thanks to another thread, I've been able to lit my sprite, but I would like it to project baked shadows, if possible.
For example, if I have a tree sprite, when I try to bake it, what I get is a giant squared shadow. (I expected that).
When I try to bake a Unity plane with the same tree texture, I get a perfect shadowed tree projection.

Is there a way to achieve this effect with the tk2d Sprite?
And about Lightprobes, what's the current 2Dtoolkit compatibility with that?

I use the free version of Unity, if you must know. (no realtime shadows :/ )

Sorry if my question doesn't make sense lol

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Baked Shadows/Lightprobes with Sprites
« Reply #1 on: November 18, 2012, 05:50:55 pm »
The built in shaders don't support lightmaps as they are optimized for mobile performance. You are free to switch shaders to something that supports lightmaps though.

Baked shadow projection isn't possible with transparent materials in Unity. However, you can fool Unity to doing it, by switching the material to AlphaTest-Diffuse or something like that, rendering your shadows, and then switching back.

Lightprobes will work if you switch to a shader that supports it, but I really can't see much benefit in using it. Its lit per vertex and the artefacts you get will be pretty objectionable due to the low number of polygons in the sprites.

dariuslol

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Baked Shadows/Lightprobes with Sprites
« Reply #2 on: November 19, 2012, 01:08:35 am »
Got it.   
I'll see what I can do with custom shaders. Have no experience editing/creating them at all, though.
Thanks :D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Baked Shadows/Lightprobes with Sprites
« Reply #3 on: November 19, 2012, 01:14:15 am »
Just use the built in Unity (not tk2d) ones first, you can always modify them if you need to.