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

Embedded texture buffer empty #134

Closed
tellypresence opened this issue Apr 5, 2024 · 3 comments
Closed

Embedded texture buffer empty #134

tellypresence opened this issue Apr 5, 2024 · 3 comments
Labels
todo TODO

Comments

@tellypresence
Copy link

tellypresence commented Apr 5, 2024

On branch rendermesh-refactor or dev

When loading model CesiumMan.usdz

render_scene.images[0].asset_identifier is correctly populated as 0/CesiumMan_img0.jpg, but width, height set to-1.

render_scene.images[0].buffer_id field is 0, but corresponding buffer for that (apparently correct) id of 0 has render_scene.buffers[0].size() of 0, i.e. image data buffer empty

@tellypresence tellypresence changed the title [Branch "rendermesh-refactor"] Embedded texture asset_identifier is correct but width, height, buffer ID all -1 Embedded texture buffer empty Apr 6, 2024
@syoyo syoyo added the todo TODO label Apr 6, 2024
@syoyo
Copy link
Collaborator

syoyo commented Apr 10, 2024

Currently TinyUSDZ Tydra only supports loading texture from file, and does not load asset from memory(USDZ ZIP container).

https://github.com/syoyo/tinyusdz/blob/caa6d877ff5448a3b1ca48497e0a07f374b5098c/src/tydra/render-data.cc#L2599

Reading texture asset from USDZ container is todo:

  • Setup AssetResolution to read an asset from USDZ container
  • Use tinyusdz::image::LoadImageFromMemory to load texture

@syoyo syoyo mentioned this issue Apr 13, 2024
40 tasks
@syoyo
Copy link
Collaborator

syoyo commented Apr 15, 2024

tydra_to_renderscene example in recent rendermesh-refactor branch now able to read asset in USDZ.

$ tydra_to_renderscene models/texture-cat-plane.usdz

...

images {
[0] TextureImage {
        asset_identifier "./textures/texture-cat.jpg"
        channels 4
        width 768
        height 768
        miplevel 0
        colorSpace srgb
        bufferID 0

    }
}

buffers {
[0] Buffer {
        bytes 9437184
        componentType float
    }
}

@syoyo syoyo closed this as completed Apr 15, 2024
@tellypresence
Copy link
Author

In recent rendermesh-refactor branch, embedded textures working well

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

No branches or pull requests

2 participants