Search Unity

Not working URP material for 3D terrain while using 2D renderer

Discussion in 'General Discussion' started by garadosix, Oct 15, 2022.

  1. garadosix

    garadosix

    Joined:
    Oct 10, 2020
    Posts:
    1
    I am creating a game that uses 2D sprites in 3D terrain. I am using Universal Render Pipeline and 2D renderer to use 2D lighting. These 2D objects are placed on 3D terrain to create a game similar to "Don't Starve Together" where everything is at an angle so it creates an illusion of 3D space of 2D objects.

    To be able to use 3D terrain with the 2D renderer, you need to convert every single material and texture, this is done easily. For the terrain to work with, you need to create new material and attach a URP shader to it (Universal Render Pipeline - Terrain - Lit). And here comes the problem, the terrain is suddenly completely invisible and I am not able to paint on it. According to tutorials, this should work perfectly fine and in the videos, it does.
    Material problem.png

    After 2 days of searching, I found nothing so I had to think of my own ideas. I have got one that is not working. My question is if you have seen some similar problem before and know how to solve it, how to solve that material issue, or how to be able to get my idea working.

    Idea:
    I have got an idea if it is possible to use 2 cameras at once, one that would be using a 2D renderer on 2D objects and a second one that would be using URP renderer for the terrain. The terrain now has a terrain layer. The one with the 2D renderer ignores the terrain layer and the one with the URP renderer ignores everything except the terrain layer as you can see in the pictures below. But for some reason, it still is not working.

    Cameras.png

    Camera 1.png

    Camera 2.png

    Any help would be appreciated.
     
    Pawciu likes this.