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. Dismiss Notice

Question Flip a decal projector?

Discussion in 'Universal Render Pipeline' started by Bankler, Sep 25, 2023.

  1. Bankler

    Bankler

    Joined:
    Apr 10, 2012
    Posts:
    66
    2022.2.7f1

    How do I flip the fish so that the face points to the right? :eek:

    The different decals are taken from a texture atlas, and I use the Tiling and Offset setting in the URP Decal Projector component so that the correct artwork is picked. In my use case, there is a a projector on the left side and one on the right side of the aircraft. I want to horizontally flip the right one.

    I have tried changing the scale mode to "Inherit from Hierarchy" and then setting the scale of the transform to -1 on various axis. Also tried setting width to a negative value, and tried changing Tiling to a negative value. No luck so far.

    I have considered editing the Shader Graph shader. But I can't really figure out what kind of UV tricks that would help me (I'm a novice with shaders). The fact that I'm using an atlas, instead of 50+ individual images for the different artwork, might possibly make it even more challening, but I don't know.

    Thanks in advance!

    upload_2023-9-25_15-45-39.png

    upload_2023-9-25_15-57-43.png
     
  2. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    98
    Hey!
    This is a great feature request! :D I think the correct solution is for us to add some "Flip" check boxes.

    For now you should be able to work around this by using negative tiling values. So in your case you would set the x-tiling to -0.125 and adjust the x-offset.
     
  3. Bankler

    Bankler

    Joined:
    Apr 10, 2012
    Posts:
    66
    Thank you, it worked! My images are collected into an atlas, so just flipping the x-tiling didn't work, but as you touched upon, adjusting the x-offset with some black magic math made it work.

    As you can see in the screenshot, the fish is now very happy.

    upload_2023-9-26_18-12-58.png