x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to make an object visible which is blocked by other static mesh object?

I want to show x, y, z arrows, just like unreal engine, to adjust object positions. I use three arrows to simulate it. alt text alt text

The result is like this: alt text

The problem is that: part of the arrows are blocked by the cube. How to make the arrows visible, no matter they are blocked or not?

I think it is the same problem as: how to make an object show in front of anything?

Product Version: UE 4.11
Tags:
arrow.png (220.9 kB)
3arrows.png (297.8 kB)
result.png (222.4 kB)
more ▼

asked Jul 27 '16 at 06:56 AM in Rendering

avatar image

zhanchenxing
1 2 2

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Hi Zhan,

Just like what UE4 editor, You need to get the Primitive in C++ and call UPrimitiveComponent::SetDepthPriorityGroup(). Normally, all primitives are render in SDPG_World, but all UI or highlight primitive should render in SDPG_Foreground. You can search these key words to see how it works in UE4 editor code.

Cheers, Jin Yaping

more ▼

answered Aug 01 '16 at 05:55 AM

avatar image

Yaping.Jin
1 1

avatar image zhanchenxing Aug 01 '16 at 12:34 PM

Thank you for your reply, really. We just tried with the code below. But it's not working.

I searched the web and found something related to this: https://forums.unrealengine.com/showthread.php?931-How-to-use-SetDepthPriorityGroup

It seems like that SetDepthPriorityGroup does nothing in UE4.

Is there any other way to do this?

avatar image zhanchenxing Aug 01 '16 at 12:37 PM
 void UZM_FunctionLibrary::ShowActorInForeground(AActor *actor)
 {
     USceneComponent *scene = actor->GetRootComponent();
     if(scene == NULL) {
         UE_LOG(LogActor, Error, TEXT("scene is NULL"));
         return;    
     }
 
     UPrimitiveComponent* priComp = Cast<UPrimitiveComponent>(scene);
     if(priComp) {
         UE_LOG(LogActor, Warning, TEXT("priComp is NOT NULL!"));
         priComp->SetDepthPriorityGroup(SDPG_Foreground);

     } else {
         UE_LOG(LogActor, Error, TEXT("priComp is NULL, cast failed"));
     }
 }
(comments are locked)
10|2000 characters needed characters left

Aha, sad news. It seems UE4 don't have any official solution about this now. But you can try this ( https://answers.unrealengine.com/questions/118403/how-can-you-render-3d-objects-on-the-hud-that-are.html ). That means you need use render target for it and add a postprocess to blend with original scene. Also, you can try 3D widget. It's experimental but still you can try it. I am not sure if it come to stable in latest UE4.12.5.

Cheer, Jin Yaping

more ▼

answered Aug 02 '16 at 04:05 AM

avatar image

Yaping.Jin
1 1

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question