I've gotten a few requests lately for direct UDIM support in OIIO (and, 
transitively, in OSL).

The way I figure this will work is that you pass in the UDIM u and v texture 
coordinates (which may extend outside [0,1], with each [i,i+1) block indicating 
a different texture region tile), and for the filename you will give a generic 
name such as "myfile.<UDIM>.tx". For the particular texture lookup, the u and v 
will be assessed and the "<UDIM>" will be replaced with the right tile number 
(let's say "1013" for u=0.25, v=0.12).

Don't worry, I know a way to do this so that there is no actual string 
searching or construction happening per call. So the expense of this will be 
very very low.

But I want to make sure everybody is happy with the way of signalling this, so 
I have a few questions.

* What text should indicate that it's a UDIM texture and which will be 
substituted with the tile number? "<UDIM>"? "%04d" or some other explicit 
format indicator? Something else?

* Does everybody agree that UDIM tiles are 1-D (i.e. a single tile number, not 
a separate u and v tile in the filename), start with 1001, are 4 digits, and 
always have 10 tiles in the u direction? Can this be hard-coded, or does it 
need to be an option to the ShadingSystem (that could be overridden on a 
per-site/per-product basis), or does it need to be something that can be 
specified separately for every texture?

* Because the filename you pass is "virtual" -- that is, "foo.<UDIM>.tif" 
doesn't actually exist, it's only turned into a proper existing filename in the 
midst of a lookup for a particular u,v -- this means that 
TextureSystem::get_texture_info which lacks uv coordinate parameters must 
necessarily fail for most queries, since you don't know which individual 
texture region file should be used. Does that sound reasonable for those 
queries to fail?

* Are there any properties that you feel strongly should or should not be 
constrained to be identical for all of the individual region files for one UDIM 
texture? I assume we want to allow the region tiles to have differing 
resolutions, say. But should/can we assume that they must all share the same 
number of channels? Are there any cases I need to be aware of where differences 
are nonsensical? Any cases where differences are inevitable and I need to 
ensure that such flexibility is allowed?

Let me know if you have opinions. As well, even if you are fine with the 
proposal but are keen to try out the UDIM support as soon as it's available, 
let me know so I can ping you for feedback when it's ready to take for a test 
drive.

        -- lg


--
Larry Gritz
[email protected]


_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to