www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: MichaelJPCT on July 08, 2020, 09:23:34 pm

Title: performance comparison - Animation , VertexController , shader ?
Post by: MichaelJPCT on July 08, 2020, 09:23:34 pm
Hi Egon,
when i want to move some vertices of an object, the 1st method that comes to mind is using a shader.
but sometimes i dont like to write a new shader.
Animation and IVertexController seem to be my options.
but i worry about the performance.
among the 3 methods, is shader potentially the fastest one?
assuming:
the movements are simple maths.
i need to deform the object in every frame.
the quantity of moving vertices is below 100.
Title: Re: performance comparison - Animation , VertexController , shader ?
Post by: EgonOlsen on July 12, 2020, 12:31:50 pm
Shaders are certainly the fastest, but in a lot of cases, Animation should be good enough. Personally, I never did complex animations using a shader. I only used them for simple stuff like foliage moving in the wind. The IVertexController should be similar to Animations but the code tweaking the vertices is less efficient than the animation code in most cases, because it has a slightly higher level of abstraction.
Title: Re: performance comparison - Animation , VertexController , shader ?
Post by: AeroShark333 on July 12, 2020, 03:50:38 pm
From my own experience:

Pro's shaders:
Shaders are fastest

Con's shaders:
Shaders can produce inconsistent results on different devices
Writing shaders for animations is more complex than creating Java animations
Title: Re: performance comparison - Animation , VertexController , shader ?
Post by: MichaelJPCT on July 14, 2020, 02:59:43 am
thank you both .