UMG parabolic distortion effect
I'm trying to make HUD that looks like it is projected on a helmet visor or something like that. So I made a widget and set "parabola distortion" value. But there are two things that I don't know how to resolve:
1) Widged itself intersects with world objects.
2) Widget "suffers" from all post process effects, like motion blur.
So it is kinda useless to make HUD this way. Is there any way to fix this or maybe there is another (better) solution for that goal that I'm trying to achieve?
Thanks and sorry for my bad english! :)
Well, after some research I've found a way to do it. All in Blueprints. It's a bit weird for my opinion, but here we go:
1) Create standart UMG UI, and add inside it all what you need to be shown.
2) Create new BP and in seach field for the base class select SceneCapture2D and set it somewhere in scene (under floor or in any "hidden" place)
3) Add Widget inside this blueprint in components section and apply your UMG to it and set parabola distortion value like 0.3 or whatever you fell ok. Move Widget in position to be correctly shown in SceneCapture2D camera (+you need to rotate it to 180 by Z).
4) Create new RenderTarget2DTexture and set size to 2048 (for best quality) and apply it to your SceneCapture2D as texture target.
5) Select your SceneCapture2D BP in a level and in details tab go to Scene Capture section and open Advanced (little arrow). Turn off all flags except Translucency (so we will get on render target our UMG Widget and nothing else)
6) Create new material (in material domain - user interface and set it translusecent)
7) Add Texture Sample and assign to it our RenderTargetTexure. Connect color -> final color and alpha to opacity (but use "1-x" operator since we need to turn "translucency" to "opacity").
8) Now create new UMG (this will be our "desired" UI), create image inside (set it to full size) and apply to it just created material. This is your final UI, add it to viewport.
9) PROFIT!!! :)
It's a bit complicated in words, but pretty simple in action. Feel free to ask questions if you need some explanations about it.
Well, now pros and cons of this method.
PROS: Since you "rendering" your UMG through SceneCapture2D, you can "break" your UI to parts and align them in front of the capture camera in different angles to get cool effects.
CONS: In the end you showing on screen not actual UMG, but an "image" of it, so adding input for it will be tricky (but possible!)
P.S. I will be happy to hear other solutions how to render HUD in 3D space.
answered Oct 13 '15 at 07:18 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here