Giter Club home page Giter Club logo

Comments (11)

guillaumeblanc avatar guillaumeblanc commented on August 25, 2024 1

I'll close this as it falls outside of library scope.
Please don't hesitate to share any work / sample that demonstrates hardware skinning with ozz.

from ozz-animation.

jazzbre avatar jazzbre commented on August 25, 2024

Already did this, works great, sadly I can't share the code/project.
To maximise possible bone count I always transpose the 4x4 matrix (on the CPU side) and just use 3 constant vectors instead of 4. Then in vertex shader for x,y,z just do a dot product with the three bone constants.

from ozz-animation.

guillaumeblanc avatar guillaumeblanc commented on August 25, 2024

Thanks for your comments.

Hardware skinning
I think hardware skinning would break the renderer agnostic aspect of ozz library. Hardware skinning is performed on the gpu, using vertex shaders, which requires a setup and a language (CG, hlsl, glsl...) specific to every API (DX, OpenGL...). So not sure there's really a possibility. I have to think more about it to see how this could fit in different renderers.
On the other hand, as @jazzbre has experimented it's quite doable. The good point is that the data input format of ozz SkinningJob is very close to the input format of hardware skinning. Vertices, normals, tangents, weights, indices need to be sent as attributes (via vertex buffer object in OpenGL), in the same format ozz job uses. Skinning matrices (model space * inverse bind pose) are uploaded as uniforms (constants). This can be optimize/packed indeed as the last matrix row isn't meaningful.
I'm not really up to date the gpus, but I think hardware skinning brings a bone count limit indeed, one that cpu doesn't have. Skinning matrices are passed as constants which have a limited size. I'd recommend to split the mesh into pieces that are influenced by a fix/small number of joints, and do a draw call per piece.
Would a "hardware skinning" sample help ?

Dual Quaternion
That's definitely something I want to investigate. There's a conversion stage (from ? to dual quaternion) required at some point of the pipeline, probably after (or while) converting to model space. It should be handled by the library. It would work for software skinning as well as hardware, but at that point I think ozz should still provide software skinning only. I don't know how joint scaling would work though.

Mobile devices
I never had a chance to see ozz working on a mobile, except through web/emscripten samples at least. It should compile properly but would most probably lack SIMD acceleration and fall back to the scalar implementation. Is CPU the bottleneck on those platforms, to justify hardware skinning?

Thanks,
Guillaume

from ozz-animation.

Codewyvern avatar Codewyvern commented on August 25, 2024

A sample would be great yes, it would certainly attract a lot more users to this library, there is hardly any other open source skeletal animation libraries out there. One sample for opengl and one for directx would be awesome. From what I know the GPU on mobile devices is usually a lot faster than its CPU, so hardware skinning is ideal. I would attempt to write such a thing myself but all this math heavy stuff is really not my strong point.

from ozz-animation.

kylawl avatar kylawl commented on August 25, 2024

Add any new features you want, but keep the main components lean. Ozz is excellent because doesn't force a tonne of arbitrary features and systems on you.

from ozz-animation.

Codewyvern avatar Codewyvern commented on August 25, 2024

Well as long as its optional and cleanly separated as an extension to the main library, I don't see a problem.

from ozz-animation.

shakesoda avatar shakesoda commented on August 25, 2024

Hardware skinning is fairly easy to implement yourself - I don't think it's the lib's business and it introduces platform (graphics API) dependence. A sample is a good idea, though.

from ozz-animation.

guillaumeblanc avatar guillaumeblanc commented on August 25, 2024

A bgfx sample using ozz-animation would be awesome to demonstrate hardware skinning. Anyone interested?

from ozz-animation.

Alan-FGR avatar Alan-FGR commented on August 25, 2024

I don't think it's the lib's business

This! We need a focused high-quality lib for animation (that does just animation and does it well). Samples are fine ofc.

from ozz-animation.

shartte avatar shartte commented on August 25, 2024

I've been using Ozz for sampling and Google's filament for actual hardware skinning successfully together.
The skinning aspect just seems highly rendering engine dependent.
One aspect however is object picking, for which CPU side skinning might be needed, but Ozz already has that.

from ozz-animation.

yangfengzzz avatar yangfengzzz commented on August 25, 2024

OZZ GPU-Skinning can refer from https://github.com/ConfettiFX/The-Forge/tree/master/Examples_3/Unit_Tests/src/28_Skinning

from ozz-animation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.