Search Unity

Question Painting on quad (solved)

Discussion in 'High Definition Render Pipeline' started by valarnur, Feb 5, 2021.

  1. valarnur

    valarnur

    Joined:
    Apr 7, 2019
    Posts:
    440
    I would like point lights to affect wall painting. But if I set wall painting as Default, I can't drag it on Unity scene.
    I can do it if I set it as sprite, but then lights don't affect painting.
    I tried to use quad with base albedo material but then painting is not stretched as it should.

    How can I set material quad to painting fits on it?

    d21.JPG
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    As a first, simple option: You can just scale your quad so it's wider, and that will stretch the texture...
     
  3. valarnur

    valarnur

    Joined:
    Apr 7, 2019
    Posts:
    440
    That seems to work only how can I know the exact number when painting fits ? Painting are in different resolutions.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    The image itself has a resolution, let's say it's 800px by 600px. You'd just need to make sure that your x/y scale ratio is the same ratio as the resolution of the picture. You can do that manually, or you could do it in code by getting the width and height of the image. If this is a one-time thing, I'd just just do it manually.
     
    valarnur likes this.