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"

Can I know whether some actor is rendered or not?

Can I know whether some actor is rendered or not? I tried AActor::WasRecentlyRendered, but it only takes into account the frustum for code based optimization purposes. It isn't the same as occlusion culling. https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/AActor/WasRecentlyRendered/index.html https://answers.unrealengine.com/questions/479184/was-recently-rendered-node-does-not-work.html

I want to know whether some actor(or capsule) is totally occluded by geometry or not. LineTraceSingleByObjectType can check only point to point.

Thanks.

Product Version: UE 4.20
Tags:
more ▼

asked Feb 15 '19 at 06:54 AM in C++ Programming

avatar image

rigmania
24 3 8 13

avatar image Bariudol Feb 15 '19 at 11:02 AM

WasRecentlyRendered does work with objects being occluded by other geometry. But is does not work on a visual way- What the engine does to occlude geometry is checking its bounds (which is generally bigger than the objects themselves). Is very possible that the function is not working as you intend it to work since the bounds of the objects are still visible for the camera and hence actors are still rendered.

What you can do is place a collision sphere with the same size of the bounding sphere of an object, get the closest point to the camera on that collision, trace to it (if you hit it, the bound is still visible, from that same point trace to the center of your mesh, if you dont hit it, its probably occluded). Obviously the more traces you make against an object the more precise the result will be, but due to the way the system works ther is no cheap fast way of doing it.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Do you need this information at runtime? If not you could just use renderdoc to analyse any rendered frame. You could than see if the actor is rendered or not.

Otherwise you can use the console to "freeze rendering" and then move around with your pawn. If you do not see it then the actor was either culled or occluded.

more ▼

answered Feb 15 '19 at 12:20 PM

avatar image

BreakMaker
237 4 11 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Now I'm not sure but maybe you could try using a UE_LOG maybe somthing like auto MyActor = GetWorld()->GetActorLocation().ToString() UE_LOG(LogTemp, Warning, TEXT("%s is location"), *MyActor) in the actors c++ file

more ▼

answered Feb 15 '19 at 12:58 PM

avatar image

Neonzz
7 2 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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