Skip to content

Animate Ramps on ball contact #542

@freezy

Description

@freezy

Real ramps in pinball machines vibrate when the ball passes through, because ramps are not 100% rigid. The goal of this issue is to create a vertex shader that animates the ramp mesh in a natural way when the ball passes through, to emulate this vibration.

The main difficulty is that the ramp mesh doesn't move uniformly but is dependent on a) the ball position and ball velocity and b) on the points where the ramp is attached to the playfield, which are more rigid than parts further away from the attachement points.

a) can be retrieved from the physics engine. For b), a rigidity map will be provided where the black means no vibration and white full vibration. The map can be assigned to the shader.

The animation itself should be sin/cos-like movement for each vertex, in the direction of collision normals betwen the ball and the ramp. It's not wave-like but the whole object is moving, with the strength depending on the rigidity map and a global strength parameter. The frequency is also defined by a global parameter.

Write the vertex shader based on the HDRP/Lit shader, with a parameter of the vibration strength and frequency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededphysicsRelated to the physics enginerenderingConcerns the HDRP or the URP

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions