Search Unity

3D scene rendered as pixel perfect pixel art. How is this accomplished?

Discussion in 'General Graphics' started by WillCrate, Nov 13, 2018.

  1. WillCrate

    WillCrate

    Joined:
    May 16, 2016
    Posts:
    15
    I recently came across a set of screenshots that made me raise an eyebrow. It appears that the world is setup with depth to take advantage of full 3D lighting but with 2D pixel art.

    I've been banging my head against a wall trying to figure out how to accomplish something similar in Unity. Any thoughts?

    P.S. Also interested if you think this is pointless and that the same advantages can be accomplished within reason in straight 2D.

    Thanks.
     
    Last edited: Nov 15, 2018
  2. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Everything has depth. The 2D mode just changes the camera projection and adds a magical draw sorting order for layers :)

    I think it was the Dungeon of the Endless developers who had an in-depth blog post about similar techniques. Their game is sprite-based, with the characters being somewhat elongated, and changing the projection adjusts them to look right again. So there's probably some camera trickery, plus the sprites shown above might have some special shaders too. You can use 3D lighting on 2D if you don't use the stock sprite shaders, as 2D is normally self-lit.

    Once you start playing with the camera and shaders it might turn out to be easier.
     
  3. WillCrate

    WillCrate

    Joined:
    May 16, 2016
    Posts:
    15
    Thanks a ton for the mention of Dungeon of the Endless and their blog post. I have been digesting their info and have actually had progress with this. And you are correct about needing to mess around with shaders such that my sprites will actually accept different effects. The included Sprite-Diffuse at least gets me going with a scene-lit sprite.
     
    orb likes this.
  4. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    It would be interesting to see what you end up with :)