Search Unity

What is in unity_WorldTransformParams.x, y, z?

Discussion in 'Shaders' started by zhutianlun810, May 26, 2021.

  1. zhutianlun810

    zhutianlun810

    Joined:
    Sep 17, 2017
    Posts:
    172
    Are they useless now? Can I use them to store some custom values?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    Yes.

    No.

    The variable was added some time during first few versions of Unity 5, and AFAIK the first time it showed up it only used the w component. Why? I'm guessing only the person who added the variable knows, and may not even remember anymore. And you can't override it with a custom value as Unity sets it just before rendering, so anything you try to use will get blown away with (0,0,0,1) or (0,0,0,-1).