Search Unity

2D alpha sprites in a 3D world. (Paper Mario style)

Discussion in 'General Graphics' started by therobby3, Feb 9, 2019.

  1. therobby3

    therobby3

    Joined:
    Jan 30, 2019
    Posts:
    131
    Ok so I've been messing with this for about a week now and haven't came up a solution. Essentially I am using 2D flat objects (sprites) in a 3D world. You could essentially imagine Paper Mario, however my camera will be more fixed than Paper Mario.

    I'm still newer to Unity, I've been a Flash game programmer for the past 10 years, so I'm used to drawing objects to the screen using the "painters algorithm". From what I understand, the Z buffer cannot work correctly using objects with any alpha. So I'm forced to use a cutout shader, which does the job that I need it to, however I get an ugly aliasing around my objects, so that's not a full solution. If I use a standard transparency shader, I get some bad depth sorting issues. So I'm not really sure what to do. From my understanding, this is just how things are rendered, and it's a complex problem. However at the same time, I have trouble accepting how there can't be some easy solution to this. How can Paper Mario and other games handle semi-transparency? I'd really like to be able to do it without having to manually sort objects on screen through complex scripts..

    I've thought maybe there is some sort of anti-aliasing solution to use with the cutout shader? I've tried setting anti aliasing in the game settings, but that only effects 3D geometry it seems. Please help if you have any ideas! Surely there's gotta be an easy solution to this?