Search Unity

Read mesh vertices world position real time?

Discussion in 'Editor & General Support' started by whynotme, Jan 5, 2014.

  1. whynotme

    whynotme

    Joined:
    Mar 24, 2012
    Posts:
    54
    Hi all,

    I am trying to do a path tracing with unity. Problem is don't know how to access triangles and vertices world position. I know there is a function to transform mesh's vertices to world position, but I don't want to use it because I think it is slow, and I think Unity must store geometry in world coordination some where to draw it each frame, so I wonder is there any way to access this info without normally transform all vertices of mesh by hand each frame?

    And some of you may say path tracing is slow anyway, but what if I only cast rays on a small part of the screen, and I don't want to use built in ray cast because I want to cast ray by with my algorithm.

    Regards
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    What makes you think that? Also, it's best to actually test things instead of just guessing.

    No, all the vertices are all transformed every frame as necessary. It wouldn't make any sense for Unity to store transformed vertices anywhere when that's something the graphics card does anyway.

    --Eric
     
  3. whynotme

    whynotme

    Joined:
    Mar 24, 2012
    Posts:
    54
    OK thanks

    So it seems the only way is transforming by hand.