• 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
#2
Che differenze ci sono con le ombre dinamiche della versione pro ?
 
Rispondi
#3
Nella versione Free non esistono le ombre dinamiche, tramite questo toolkit le puoi avere...

Ovviamente ciò lo possiamo fare anche noi... da quello che ho capito, si possono ottenere le ombre dinamiche nella versione Free con un mix di: Scirpting e Shader. Però non so quanto sia semplice fare tale cosa...
 
Rispondi
#4
si lo so che non ci sono intendo se la versione pro nelle ombre è migliore rispetto a questo kit ?
 
Rispondi
#5
Non lo so... non l'ho comprato.
 
Rispondi
#6
ottimo, almeno la versione free sta diventando quasi pro Smile
 
Rispondi
#7
Eheh, per essere uguale alla Pro, ci vorebbero anche dei rendering differnti etc... xD

Per le ombre dinamiche ce la soluzione, anche per il motion blur si può simulare, ma ovviamente queste "emulazioni" si devono usare con cautela, altrimenti si rischia di intaccare i framerate (almeno credo).

Non vedo l'ora esca la versione 3.5, porta molte novità tra cui anche maggiori prestazioni (anche se già ora, a me che sto senza scheda video i framerate schizzano come nulla fosse)
 
Rispondi
#8
Io l'ho acquistato ed è abbastanza buono.... Per quanto riguarda la 3.5 anch'io l'aspetto con ansia, verrà riscritto la GUI, il particle system e inoltre ci sarà un pathfinding integrato, il supporto per il multithreading ,etc... è veramente una figata!
 
Rispondi
#9
Siccome l'hai acquistato, ci sai dire un po' come funziona ?
In un esempio che presi ieri su internet, le ombre dinamiche sembravano che venivano generate solo su dei determinati colori, questo toolkit invece come funziona ?
 
Rispondi
#10
Praticamente non è come le ombre di unity pro dove devi semplicemente clicca su soft shadows nelle luci, ci sono un pò di cose per settare le ombre, tipo mettere una luce particolare con uno script che ti danno loro, applicare una shadow volume su ogni modello su cui si vuole proiettare l'ombra, etc... Non è molto facile....
 
Rispondi
#11
Ottimo, grazie dell'informazione.

Immaginavo, che non era proprio facile, ma l'importante è avere le ombre dinamiche! Tongue Magari si mettono solo sui personaggi etc... invece su tutti gli elementi del gioco, anche perché se non ce il ciclo giorno\notte, si può benissimo usare le ombre fake su molti elementi o magari esportare dal modellatore 3d un modello 3d con l'ombra, che ovviamente sarà statica ma è pur sempre un'ombra che rispecchia il modello 3d (se non erro si può fare)
 
Rispondi
#12
Certo che si può fare, comunque è abbastanza buono anche il bake di unity!
 
Rispondi
#13
Come si usa? xD (sry for riesumation..xD)
 
Rispondi
  


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

Vai al forum:


Browsing: 1 Ospite(i)