Comments (11)
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.
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.
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.
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.
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.
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.
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.
A bgfx sample using ozz-animation would be awesome to demonstrate hardware skinning. Anyone interested?
from ozz-animation.
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.
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.
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)
- how to view bvh animation? HOT 7
- examples on how to integrate with OpenGL? HOT 2
- What CLI options did you exactly use to create the media/bin/*.ozz animations from FBX files? HOT 4
- Animation Playback HOT 25
- gltf2ozz issue HOT 2
- Trouble getting Skinning to work. HOT 3
- Make a new master release HOT 3
- glTF and FBX skeleton difference HOT 1
- The 'install' -target for make tries to change permissions on existing directories HOT 4
- The 'install' -target places some files in the installation root directory HOT 2
- Feedback/Suggestion: the exclusion of mesh data in ozz tooling makes the library less confortable to use
- Decoupling SamplingJob from file format HOT 2
- Skinning job doesn't preserve tangent handedness HOT 1
- Log adds a dependency on the standard C++ library for runtime HOT 2
- Failed to build on MSYS2 MINGW64 HOT 7
- gltf2ozz is not filtering out non joint nodes HOT 1
- How to define pole vector for two bone IK? HOT 4
- Discover projects using ozz-animation HOT 7
- AnimationOptimizer too eager to early out ? HOT 1
- Can't build samples after adding fbxsdk folder to the FindFbx.make
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ozz-animation.