LGUI (Lex GUI) - True 3D UI System, Event Framework, Prefab Workflow, Tween Animation

For now the prefab can transfer to UE5 EA seamlessly, should be OK for UE5 release version.

Any update on this issue? Do I need to manually copy files to get it to package?

I’m trying to upload a new version LGUI 2.15.3, which should fix the issue you mentioned. Should be ready to download from epic launcher in 1~3 days. Please let me know if the issue still happen after the update.

Also how do you use On Pointer Enter (Message). Trying to get a mouseover event from a UISprite component.

Or is there any way to make the clicks multi-hit? I have buttons in a scrollbox and they keep blocking my scroll box movement.

I’m not sure what you need. LGUI have event bubble, means a event will go up hierarchy until it hits a handler (LGUI’s interface), but you can set the property “AllowEventBubbleUp” to let the handled event go up again so that the event won’t be blocked. The property “AllowEventBubbleUp” exist on “UISelectableComponent” and also it’s children, include “UIButton”.

You’re right. The trigger component had a bubble up checkbox, now it works. Thanks!

Hi There,

I need to render with depth testing enabled. I’ve checked in your code and you seem to not to use depth testing at all. Mostly because you do post processing most of the times.
Do you have any suggestion to render with depth testing? I need to render just a simple cube but it renders on top of everthing because of depth test not being enabled.
I’ve checked the depthstencil state of the pipeline state object and I’ve activated Less and depth write on but doesn’t produce any effect. The triangles on the back of the cube renders on top of the one are in front. Again no depth testing seems to be active at where I’m rendering my stuff.
I’ve overrided from a ViewExtennsion class and I’m doing my rendering inside
PostRenderView_RenderThread member function.
Any help would be appreciated thanks very much. Ah and also this is my pipeline state object:

FGraphicsPipelineStateInitializer GraphicsPSOInit;
RHICmdList.ApplyCachedRenderTargets(GraphicsPSOInit);
GraphicsPSOInit.DepthStencilState = TStaticDepthStencilState<false, ECompareFunction::CF_Less>::GetRHI();
//GraphicsPSOInit.RasterizerState = TStaticRasterizerState<FM_Solid, CM_CCW, false>::GetRHI();
GraphicsPSOInit.RasterizerState = TStaticRasterizerState<FM_Solid, CM_None, false>::GetRHI();
GraphicsPSOInit.BlendState = TStaticBlendState<>::GetRHI();
GraphicsPSOInit.BoundShaderState.VertexDeclarationRHI = GetPKSimpleVertexDeclaration();
GraphicsPSOInit.BoundShaderState.VertexShaderRHI = VertexShader.GetVertexShader();
GraphicsPSOInit.BoundShaderState.PixelShaderRHI = PixelShader.GetPixelShader();
GraphicsPSOInit.PrimitiveType = EPrimitiveType::PT_TriangleList;
GraphicsPSOInit.NumSamples = 1;
SetGraphicsPipelineState(RHICmdList, GraphicsPSOInit);

thanks in advance

Actually I also have tryed depth testing but failed, so I’m afraid I can’t help you.
What I did in “WorldSpace-LGUI Renderer” is, I just use depth render target and sample it in shader, make it looks like depth testing, not quite efficent as direct depth testing, but I can blend depth as I want.

Hi there,

First of all thanks for your reply. I need to use depth in my pixel shader too therefore I’ll have a look at your shader for sure. Is is the mesh shader? right?

If you are interested in using depth test, I’ve managed to use it yesterday. After I wrote you to ask you about it I’ve found the solution.

The Depth stencil in the PSO must be initialized like so:

GraphicsPSOInit.DepthStencilState = TStaticDepthStencilState<>::GetRHI();

and when you want to render you must do:

RHICmdList.BeginRenderPass(FRHIRenderPassInfo(ScreenColorRenderTargetTexture,

ERenderTargetActions::Load_DontStore, SceneDepthRenderTargetTexture, EDepthStencilTargetActions::DontLoad_DontStore), TEXT(“YourPassName”));

RHICmdList.SetViewport(ViewRect.Min.X, ViewRect.Min.Y, 0.0f, ViewRect.Max.X, ViewRect.Max.Y, 1.0f);

// Put your draw call here

RHICmdList.EndRenderPass();

Hope this can help you :slight_smile:

Let me know your thoughts on this matter

thanks

Wow, you do me a great help, thanks!

Hi Lex,

I have a question for you. In your mesh shader you sample the depth like this:

float PixelDepth = input.screenPosition.z / input.screenPosition.w;
float2 ScreenUV = input.screenPosition.xy / input.screenPosition.w;
ScreenUV = ScreenUV * 0.5f + float2(0.5f, 0.5f);
ScreenUV.y = 1.0f - ScreenUV.y;
float ExistDepth = _SceneDepthTex.Sample(_SceneDepthTexSampler, ScreenUV * _SceneDepthTextureScaleOffset.xy + _SceneDepthTextureScaleOffset.zw).x;
OutColor.a = lerp(_SceneDepthBlend * OutColor.a, OutColor.a, step(ExistDepth, PixelDepth));

Why you use z as depth when in UE4 z is the up axis? Shouldn’t you use the x axis as a depth?

thanks in advance

Actually before UE render when calculate view-projection matrix, there is a matrix multiply:
FMatrix(
FPlane(0, 0, 1, 0),
FPlane(1, 0, 0, 0),
FPlane(0, 1, 0, 0),
FPlane(0, 0, 0, 1)
)
this make the view rotated from (x,y,z) to (z,x,y), so z is depth.

Hi Lex,

thanks for your promt response. This explain everthing then.

But shouldn’t be (x,y,z) to (z,y,x)? I thought it was the x axis the depth before the view rotation.

thanks

How to use event system? Documentation is broken link

Specifically where do you get “Event Data” from?
image

I think this tutorual is good for you to understand how LGUI’s interaction works. And you don’t need to call OnPointerEnter by your self, LGUIEventSystem will handle it automatically.
If the link is broken, you can watch the tutorial here.

I have an actor and I am trying to register events but this isn’t working, although the rest of my ui is working fine. I had to create a custom trace to get any of it to work (default visibility trace would not work) but I feel like this isn’t using the custom trace.

image

Any chance to get an example project for making a character selection menu like that on Jump Force and similar fighting games (Injustice series, Mortal Kombat series and so on) ?
Having an example project to modify would make it quicker to then customize it.

How do I implement this in VR? (I am using Oculus Rift S)
Cheers,
Max

Hello,

Is it possible to add UI components directly to blueprints? Do I have to add them always to WorldSpace in World Outliner?

No you can’t add UI components to blueprints. LGUI use actor-hierarchy based workflow, you can use LGUI’s prefab to reuse your UI. Just consider it as a Unity workflow inside UE4.