Specific vertex animation methods seem to be lacking in the Esenthel Engine.
As this will be required in some of my projects, I've attempted to devise a workaround. Not 100% ideal, but might be ok until specific methods are introduced into the engine.
The workaround I'm using extracts the vertex data from the original Mesh, and then reassembles the data using the supplied Vertex Index Buffer methods.
The main problems I'm having are that the resulting "mesh" cannot rotate (I can only translate it), I cannot produce a representative shadow, and I can
only apply a plain texture (no bump mapping, or specular). There is a "static void shader ShaderTech *shader); // set custom shader" method, but I am unable to figure out how to apply it...maybe Greg or another member could enlighten me on this?
The best way would be to do vertex animation in a custom shader.
However the simplest way is to adjust MeshBase and call MeshPart.setRender to create MeshRender and draw that.
Or a faster way - just directly modify the vertex buffer of MeshRender using vtxLock/vtxUnlock/vtxLockedElm
I'll investigate your suggestions... starting with simplest!
EDIT:
I've just found the "Engine Shader Tutorial" thread: http://www.esenthel.com/community/showth...p?tid=6672
It looks quite comprehensive, so I think I'll firstly jump in on the best option of supplying a custom shader.
(This post was last modified: 07-31-2014 10:11 AM by 3DRaddict.)
I've managed to add a custom shader which animates the vertices as before (but better and more smoothly). The warping mesh can now rotate as it "rolls" along the ground.
However, it still casts no shadow which duplicates its changing shape, even though I'm using
Code:
case RM_SHADOW:
{
ball.drawShadow(MatrixIdentity);
}break;
I've noticed the same thing occurs in the Shader Tutorial example "Shader with Parameter" when testing it with an added drawShadow() function.
Hmmm.... I have something similar, but mine is all done via CPU(and PhysX). I've not messed with shaders before, so I'm curious as to whether it would be worth going to a vertex shader such as that.