-
Notifications
You must be signed in to change notification settings - Fork 150
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
Hair has no skinning #51
Comments
Great! Thank you so much for that!!! Both v_count and v_index values are loaded into character hair structure, when you call addCharacterHair script function. P.S.: Also there is unused hair_vertex_map array in hair structure, it is reserved in case we need hair vertex mappings as well (as I didn't check the order of linked vertices on the "root" hair mesh). In this case, this array should be filled from script in the same manner as head mesh vertex indices array. |
With this change, it is possible to use many more matrices, which will be relevant for hair later (#51). By keeping the weights fixed at 0.5, we can avoid the need for another vertex attribute. Note that in a more complex scenario, we would probably need two. Sadly specifying an ivec2 input isn’t possible in vanilla OpenGL 2.0, which remains the target, so we’re doing this weird vec2 cast to int dance here. Fun fact that I realized while doing this: There is no actual need to keep the weights normalized; removing the 0.5s in that shader works just as well - as would any other number > 0. This actually makes sense if you think about it for a few seconds (hint: How do homogenous coordinates work again?), but I’m currently reluctant to make use of that because it is confusing. Also removed shaders from the copy-to-bundle phase of the Mac build, because they remain in the OpenTomb folder.
This is the penultimate step for #51. The hair is as smooth as anyone could want it to be, in any TR game (except TR1 obviously). The only thing missing is the area between the hair and the head, which is very noticeable in TR4 (especially the tutorial level).
Lara's ponytail in TR4 has gaps instead of being continuous and smooth, because skinning of hair meshes is not yet implemented. (This also applies to TR2 and TR3, but there that was original)
I'm currently working on changes to the skinning code in general (they already work, but broke animated textures again; I'll push them once that's fixed), so I'd like to claim this one. It will probably end up with TR2 and TR3 getting skinning, as well.
The text was updated successfully, but these errors were encountered: