Rotation optimization, GPU accelerated
An experimental release, with a possible large increase in rotation performance.
TLDR; Rotation will now cost minimal CPU and animation can be paused while rotation will still work. In one case it goes from 25% of CPU to 0% CPU to rotate multiple complex models.
I moved the rotation calculations from the CPU to GPU by using changing the C3 Model/View matrix to Include the x,y,z rotation angles. The rotation calculation is now done in the C3 standard vertex shader in the GPU with no real increase in GPU performance requirement and the CPU performance for rotation is almost completely eliminated (except for the Model/View matrix calculation.)
You can now pause animation and rotation will continue to work. If animation is not required, this is recommended (I may also change animation paused to the default initialized state.)
Note that rotation with Euler angles (x,y,z) still will suffer from gimbal lock, so if possible, pre-rotate your models in a 3d modeling program (like Blender) to reduce the change of gimbal lock.
Note that animation will still continue to run on CPU and will still be somewhat expensive based on the animation rate and the number of vertices/triangles that must rotate. It's not obvious yet if the animation calculations can be done on the CPU, because in the case of skinned nodes, each vertice may have a different blended transform.)
There may be some issues with this new update in terms of the bounding box, z height, since they are not yet updated based on rotation done on the GPU, this may make the 3DObject 'clip' early. I will work on updating the bounding box and z height to match the GPU based rotation of the vertices.
Please leave feedback, if you see performance improve with rotation (w/o animation) or if you see issues in more complex C3 examples (I restore the C3 Model/View matrix, but there could be issues with changing the matrix or with the original matrix being used.)
Files
Get Construct 3 3DObject Plugin - SDK V1 only
Construct 3 3DObject Plugin - SDK V1 only
Construct 3 3DObject, loaded from 3D model files (gltf embedded format)
Status | Released |
Category | Assets |
Author | kindeyegames |
Tags | 3D, construct, construct-3 |
More posts
- Fix vector color for models with vertex color2 days ago
- Fix black color render in r441+2 days ago
- Fix for unbound buffers (init before 3DObject)2 days ago
- Fix for frag light effect with r441+35 days ago
- Fix for r441+35 days ago
- Fix sliders for ssao-cube example48 days ago
- Add SSAO which uses view space48 days ago
- Optimization - create common UBO per model55 days ago
- Fix UBO support for non-skinned meshes60 days ago
- Add UBO support for bones transfer, 256 total67 days ago
Comments
Log in with itch.io to leave a comment.
nice!!!