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

Sprite Renderer not working properly with MaterialPropertyBlock and SetPropertyBlock()

Discussion in 'Shaders' started by mhr2145, Jan 30, 2021.

  1. mhr2145

    mhr2145

    Joined:
    Mar 8, 2019
    Posts:
    8
    Hi all! I'm trying to have the same scene rendered differently depending on which cameras are Camera.current. Each object in the scene has the following component attached to it: https://dpaste.org/Hj4X.

    The problem is that when Camera.current is identityCam (see the script), the sprite doesn't display correctly. It appears to have to do with setting properties. Here is a video of the problem:
    . What's going on here?

    Here's the shader script: https://dpaste.org/trv4.
     
  2. mhr2145

    mhr2145

    Joined:
    Mar 8, 2019
    Posts:
    8