Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] oiiotool tile issue with otex and prman #4562

Open
MrLixm opened this issue Dec 11, 2024 · 2 comments
Open

[BUG] oiiotool tile issue with otex and prman #4562

MrLixm opened this issue Dec 11, 2024 · 2 comments

Comments

@MrLixm
Copy link

MrLixm commented Dec 11, 2024

Describe the bug

I have a strange behvior when using oiiotool with the -otex option.

I am trying to export "tex" textures for renderman using oiiotool (and intentionnaly not maketx).
What I found is that I need to manually set the --tile to 32 32 for the texture to be read properly by prman.
However I found that the tile option only works if I force the bitdepth with -d.

OpenImageIO version and dependencies

I tested on 2 oiio version:

  • hoiiotool shipped Houdini 20.5.332 on Windows
OIIO 2.3.14 built for C++17/201703 sse2
  • oiiotool compiled on linux
OIIO 2.5.7.0 built for C++14/201402 sse2,sse3,ssse3,sse41,sse42

To Reproduce

oiiotool texture.exr --planarconfig separate --tile 32 32 -otex:prman_metadata=1:prman_options=1:resize=1 texture.exr

doesn't work the tile size is still 64x64 (inspected with oiiotool -v --info)

oiiotool texture.exr --planarconfig separate --tile 32 32 -d half -otex:prman_metadata=1:prman_options=1:resize=1 texture.exr

now work, the tile size is 32x32

(the same behavior is observed with the -otex:tile=32x32:type=half syntax)

Hints

What I also found is that removing the prman options also seems to fix it, i.e.

oiiotool texture.exr --planarconfig separate --tile 32 32 -otex texture.exr

will work

@jessey-git
Copy link
Contributor

OpenImageIO calculates the prman tile size based on the data format that is used. See here:
https://github.com/AcademySoftwareFoundation/OpenImageIO/blob/main/src/libOpenImageIO/maketexture.cpp#L72

That code would explain why you only get 32x32 when using half etc.

The values used have been untouched for 12 years. I can't quite find any definitive documentation about what tile sizes are acceptable though. Maybe they are out of date?

@pleprince
Copy link

This is not a bug. Prman's texture cache uses fixed-size slots. This is a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants