Instantly share code, notes, and snippets.

Embed
What would you like to do?
Converts pixel coordinates in a texture to UV coordinates in Unity3D.
Vector2 uv = new Vector2((float)myMarker.pixelCoords.x / (float)renderer.material.mainTexture.width, 1f - (float)myMarker.pixelCoords.y / (float)renderer.material.mainTexture.height);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment