double precision accuracy for uvs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
It seems that Maya stores texture coordinates (uvs) internally using single precision floating point (float).
The C++ Class MFnMesh provides several functionalities to get and set these uvs, e.g.
MStatus getUVs ( MFloatArray & uArray, MFloatArray & vArray, const MString * uvSet = NULL ) const
I realize that for many purposes, in particular for rendering, float is accurate enough.
However, I'm using uv's to perform more complicated geometric calculations and for those, double precision is mandatory.
Is there a way to store doubles internally?
I was hoping that at some point, Autodesk will add this ability and allow users to choose accuracy, just like MFnMesh::getPoints have access to both double and single precision storage of vertex positions (MPointArray vs. MFloatPointArray).
I tried to overcome this in several ways but I can't figure out a good way to deal with this.
One thing I tried is to store new component-based node attributes and try to maintain it's updating.
This is a mess and it slows down Maya's UI (in particular selecting a mesh) on large meshes to a point where it's useless.
Another issue is that I want to be able to set and store double precision uvs through the code, but I also want to maintain compatibility with other Maya's tools. For example, I should be able to set all uv's based on some my own algorithm and then use the uv editor to manually tweak some uvs without loosing sync between the internal uvs and the "accurate" ones that I store separately.