• Benvenuto in Making Videogames!
  • Dai sfogo alla tua fantasia!
  • Crea il tuo Videogioco!
Benvenuto ospite! Login Registrati




Valutazione discussione:
  • 0 voto(i) - 0 media
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic shadows in Unity Free / Pro, possibly Mobile
#1
Hello! Over the past few weeks I've been working on a shadow volumes implementation for Unity and would now like to get some feedback on it

[Immagine: attachment.php?attachmentid=24038&d=1314312449]

Webplayer demo
Use the mouse to move objects around.

Available now in the Unity Asset Store

Please use the poll above to let me know how it ran, thanks!

Features:
Dynamic pixel-perfect shadows using shadow volumes and the alpha channel
Supports all 3 Unity light types
Works with any closed mesh (each edge has exactly 2 triangles)
Works even when the camera is inside the shadow volumes
Works in edit-mode
Requires no scripting
Tested on Unity Free, should work on Unity Pro
Unity iOS/Android may be possible, see below


The toolkit is not...
a complete renderer
a replacement for Unity Pro lighting/shadows
using the patented depth-fail algorithm (The volumes are drawn 4 times instead of 2 to avoid this algorithm; but it is still very fast)

Since Unity does not expose the stencil buffer, I implemented the shadow volumes using the alpha channel of the framebuffer in a similar way to what Aras did quite a while ago. Unlike the algorithm presented in the papers he linked however, my implementation supports up to 255 overlapping shadows, not only 8. Using the alpha channel is not as robust as using the stencil buffer for this purpose, which is why I decided to have a poll. (In the worst case, the underlying drivers/hardware may break the shadows)

The toolkit only requires a framebuffer with an alpha channel so it should work on most Android phones as well as iOS devices, but it seems like Unity does not enable the alpha channel by default. I can't find the option to specify the framebuffer format on Unity Android but according to Jessy's comment this seems to be possible on Unity iOS, which I don't have a license for at the moment. Any information on this is greatly appreciated

I'm currently creating the example scenes and writing the documentation and I plan to release the package on the Unity Asset Store for 20$ in the next couple of days, if it is approved of course.

Autore: http://forum.unity3d.com/threads/102079-...bly-Mobile

 
Rispondi
  


Messaggi in questa discussione
Dynamic shadows in Unity Free / Pro, possibly Mobile - da Skyline - 20-09-2011, 08:09 PM

Discussioni simili
Discussione Autore Risposte Letto Ultimo messaggio
  Oceano per Unity Free e Pro Skyline 4 2,923 13-02-2016, 01:39 AM
Ultimo messaggio: Valerio
  Bloom in Unity Free ! Skyline 3 1,960 03-06-2013, 01:40 PM
Ultimo messaggio: Skyline
  ShadowGun : Optimising for Mobile Skyline 2 1,290 07-06-2012, 07:42 PM
Ultimo messaggio: Skyline
  "Dynamic Elements" RPG effect pack Skyline 2 2,016 03-10-2011, 05:54 PM
Ultimo messaggio: KillerZ

Vai al forum:


Browsing: 5 Ospite(i)