Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

3D pixel art shader.

Discussion in 'Shaders' started by Crab Cyborg, Mar 25, 2015.

  1. Crab Cyborg

    Crab Cyborg

    Joined:
    Feb 5, 2015
    Posts:
    3
    I know this must be possible in some way using only a shader.

    I want to be able to feed in a small pixel art image, possibly around 20x20, and have it appear 3D on cube.

    I need it to support transparency, so just doing 6 faces isn't really going to ever make this work, but if a shader can somehow appear like the image is going all the way through the cube I'd be set.

    It just needs to be like a 2 sided quad with a bottom that matched the bottom colours, a top that matches the top colours, etc.

    If anyone is an expert with shaders they'll know more about this than me. For now I'm kind of stuck.

    Thank you,
    Mike, Crab Cyborg.
     
  2. originalterrox

    originalterrox

    Joined:
    Feb 6, 2015
    Posts:
    40
    Sounds like you just need a cube with a texture wrapped on the faces the way you want.
    Front as regular, Back as mirrored, sides as smeared edges.
     
  3. sunmachine

    sunmachine

    Joined:
    Jun 4, 2014
    Posts:
    9
    Yep! Just use any texture, make sure the texture filtering is set to "Point" instead of Bilinear maybe (for a truly gritty pixel aesthetic), and use the Unlit / Transparent shader.

    What you need of the model is really just how you would UV unwrap the object.