Author Topic: performance comparison - Animation , VertexController , shader ?  (Read 2375 times)

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: performance comparison - Animation , VertexController , shader ?
« Reply #1 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.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: performance comparison - Animation , VertexController , shader ?
« Reply #2 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

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: performance comparison - Animation , VertexController , shader ?
« Reply #3 on: July 14, 2020, 02:59:43 am »
thank you both .