Search Unity

Bug RandomNumber constant , SampleMesh normal bug.

Discussion in 'Visual Effect Graph' started by koirat, Mar 11, 2023.

  1. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    Unity 221.3.11f1

    I was trying to recreate Mesh Position block so I can have additional data ( UV ) of a random position on surface.

    I have created custom subgraph operator for this.

    I got simple vfx shader graph that is basically taking the position and normal from this operator add them together and using SetPosition I'm placing particles. (Imagine extrusion by 1 in a direction of normal from the surface)

    Now as you can see on the picture everything is ok when my RandomNumber node got Constant disabled.
    The moment I enable it the normals are wrong.

    But there is some order in how wrong they are, this wrong ones are actually parallel to the surface they originated from. So after extrusion we got some "Cubes" created from particles instead of "Planes".