Is it possible to dynamically distord meshes?

Hello everyone,

  • I try to distord meshes dynamically to a fisheye-style-view around my pointer’s position (vive controller). unfortionally, it seems to be very difficult to distord every mesh actor surrounding the hitpoint of the controller’s linetrace in a defined radius.

  • I’ve already tried to spawn a lens-shaped mesh but this does not affect surrounding meshes (especially, it simply performs some kind of pseudo-distortion inside the lens).

I think I have to use some kind of shader?

Any other suggestions?

What you are looking for is Post Processing.

You can see a simple example here: Barrel Distortion Using Post Process Material (UE4) - YouTube

And the full api here: Post Process Effects | Unreal Engine Documentation

In fact you are not distorting meshed, but you are distorting the camera view that see the meshes, if you are looking only for visual effects (not collision or any other stuff involving space) this shall be perfect for you.

Thanks, but I also need collision - is it still possible with post processing / shaders?

I’ve found [this][1] demo code (pixel shader) which seems to do exactly what I want - but, unfortionally, there is no “howto” nor any kind of good documentation on implementing shaders by code in UE as far as i know?

221075-unbenannt.png

Especially, I need the distortion only to “be” at a specified location instead of the “whole-camera-barrel-effect” (sorry, I’m an UE-Newbie): I want to have some kind of fish-eye-lens around my coursor.

You will have the normal collision from the mesh current form. If you need the collision to go crazy too, you will need to create other meshes and use morph targets as in this link:

I don’t think this is what i ment. I attached a video below that shows the way of distortion I am trying to explain, here.
I want to point around and only where I am pointing at there should be a distortion but the distorted object still needs to be selectable. but this is not an animation (like in morphtargets), it is some kind of dynamic mesh, i guess?