Search Unity

Deferred lighting - Alien Swarm SDK

Discussion in 'General Discussion' started by maxfax2009, Jun 3, 2012.

  1. maxfax2009

    maxfax2009

    Joined:
    Feb 4, 2009
    Posts:
    410
    http://www.youtube.com/watch?v=bMjXx-KweIo


    This is a deferred lighting implementation that I've created on the Alien Swarm SDK. It's currently offering shadow mapping for directional/point/spot lights, blinn phong and volumetric scattering via light volumes.

    The in-game editor allows you to load from/save to VMF files directly, however parented or named lights (with I/O) will not be editable in-game.

    Hundreds of small lights can be rendered with great performance (on a GTX 260), however as soon as they cover a lot of screenspace or are even drawn fullscreen (intersecting light geometry) they become much more expensive.

    The renderer firstly draws the skybox/scene to the gbuffer (normals+lighting params and depth), performs light rendering via low poly spheres/cones and does a second pass on the skybox/scene that produces the final result. Due to this, all shadows and lights from the world are directly projectable on the skybox, however geometry in the skybox does not yet cast shadows nor can you place lights in the skybox.

    There's currently no hardware filtering support for AMD because I do not own any AMD cards, so I can hardly add that myself. Running this on AMD will either require you to recompile everything with a color based shadow mapping filter (as easy as changing one line of code) or adding fetch4 code - you've been warned.

    Source code and demo build can be obtained here:

    http://code.google.com/p/swarm-deferred/



    -----


    Love the light show :) can this be done in Unity?
     
    Last edited: Jun 3, 2012
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @maxfax2009,
    Part of it yes. Unity already support deferred lighting. There's no support for volumetric point/spot lights right now, neither animated textures as cookies but can be re-created using custom shaders.
    PS: Try to quote the text next time (or at least say isn't you), at first i though it was you the author, till i read your last message. :p
     
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Dayummm those volumetric lights....:p~