About Store Forum Documentation Contact
Donations:
289$/mo



Post Reply 
Warping Beachball!
Author Message
3DRaddict Offline
Member

Post: #1
Warping Beachball!
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? smile



07-31-2014 06:46 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Warping Beachball!
Hi,

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
07-31-2014 07:00 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #3
RE: Warping Beachball!
Thanks for the prompt reply, Greg

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.)
07-31-2014 07:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #4
RE: Warping Beachball!
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.
08-01-2014 02:20 PM
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #5
RE: Warping Beachball!
If at first you don't succeed, try and try again ! lol

Exactly what I wanted!!!


08-02-2014 11:43 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #6
RE: Warping Beachball!
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.
08-02-2014 04:35 PM
Find all posts by this user Quote this message in a reply
Post Reply