Search Unity

normal mapping tilemaps

Discussion in '2D' started by cdhanna92, Apr 3, 2019.

  1. cdhanna92

    cdhanna92

    Joined:
    Sep 30, 2016
    Posts:
    17
    Hi forum, sorry if this is the wrong spot.

    I'm looking to add normal/bump maps to my tiles in Unity 2018.3. I have a custom surface shader that makes use of a bump map, and its working fairly well on its own. But when I set the TilemapRenderer material to my custom surface shaded material, I can't find a way to control the normal texture per tile. It seems like this might just not be supported. I did find this, but it seems pretty limited. https://github.com/Unity-Technologi...pping/Material/Shader/NormalMappedTile.shader

    I'd really like each tile image to have its own normal map.
    As anyone done this? Is it not possible yet?

    My surface shader is pretty much a toon-shader plus a hatching shader. I'm going for a game with a cartoony-sketched vibe. It looks like this, when applied to some sample test art.
    upload_2019-4-2_21-40-39.png
    (for anyone curious, this shader is pretty much 100% stolen for this paper, http://hhoppe.com/hatching.pdf)

    Any help would be greatly appreciated.
    Thanks, world.
    -Chris
     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Sorry, right now you will need to manually atlas your Tiles' textures and normal textures and have them match accordingly in the material as per the NormalMappedTile shader.

    We will be looking into this as part of our workflow for 2D lights!
     
  3. cdhanna92

    cdhanna92

    Joined:
    Sep 30, 2016
    Posts:
    17
    Thanks for the quick response :) I hadn't thought of trying to atlas the texture. So that'd mean that all my tiles share the same texture, but differ in UV coordinates. I will research that when I get home tonight. I'm hoping its as simple as a code tweak... or do you think its more involved?
     
  4. seidgaparov

    seidgaparov

    Joined:
    Jul 18, 2013
    Posts:
    18
    I copy pasted shader and material from github, it doesnt work. Sprite atlas of normals is the same as sprite atlas of tiles. Why?
    upload_2020-9-14_16-37-26.png
     
  5. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,511