-
Notifications
You must be signed in to change notification settings - Fork 113
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
Texture animation with rotation no is good #10
Comments
It's difficult to determine where the issue lies from your brief description. The core of the baking boils down to "SampleAnimation()" and "BakeMesh()", which are UnityEngine functions that take the vertex positions at a specified time and bake them into a new mesh. I don't see any reason why it wouldn't work. Maybe your mesh has offsets or rotations on the root bone? If that's the case, you can remove those offsets/rotations manually. Also there are other repos that are derived from this one (sugi-cho) that do that transform during the bake process. sugi-cho was one of the pioneers of this technique, so a lot of repos are derivatives of his work. Another possibility - does your animation have bone meshes (as in child objects that have meshes)? Those are not supported in this repo. |
hello again, thank you so much for taking the time to reply to me. |
It looks to me like the problem is in the GTA/SimplePfx shader, not the TextureAnimPlayer.shader. I'm not really familiar with that GTA shader, but it appears to be reading the texture and playing back the animation while throwing in some rotations during the process. If sugi-cho made even a tiny change to the texture's format it could easily break NathanJSmith's shader and it looks like NathanJSmith wrote that tutorial on March 23 2020. The last change to the baking code that sugo-cho's made was about 5 months later. In that commit he added support for a tangent texture.... I don't think would affect things - you can just ignore the tangent texture. I'm not exactly sure what tangents are used for. Unfortunately, I think the only way to figure out what's going on would require debugging the GTA/SimplePfx shader with RenderDoc or something and trying to follow the math. Maybe you could show that video to NathanJSmith and he might have some ideas? |
Hello, I appreciate your answer once again. |
Have you tried it with different animated models to see if the issue is specific to your flying bat model or maybe it happens with all models? If it doesn't happen with all models+animations, perhaps you could compare yours with a working one - the differences would tell you a lot about where to look. Maybe you could post a reply in NathanJSmith's thread ( https://forum.unity.com/threads/share-knowledge-how-to-make-3d-animate-particle-effect.564994/ ) and see if someone else there who's used his shader knows. I would try to fix it, but I'm really busy right now. If you have the time, you could try to learn enough about shaders to fix it yourself. For debugging shaders I use RenderDoc. It would probably take you a couple of weeks though. I was in a similar situation myself about a month ago. I wanted to modify sugi-cho's shader so I ended up spending two weeks learning HLSL and by the end I had pretty much written a whole new shader. I'm still far from an expert, but at least now when I look at HLSL I have a general idea of what's going on. Ideally someone else online has either taken that SimplePfx shader and worked with it enough to understand the issue. That would be the shortest fix. Another approach would be to ditch the idea of using a baked texture for particle effects... maybe there are other methods that would work just as well (like a compute shader or something)? |
Hi all, when I have a mesh with an animation that has displacements and rotations, it doesn't bake the texture well and sometimes you see a plane.
My example is a bird turning 360 degrees in animation.
Am I doing something wrong or does not support rotations for this?
The text was updated successfully, but these errors were encountered: