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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Indirect Lighting Cache - there might be a bug

I'm using a weapon system with multiple parts(skel meshes) attached with bLightAttachmentAsGroup == true When attaching it to a character the performance went really low and I figured out the reason.

  1. When creating a PrimitiveSceneInfo of a PrimitiveComponent, it sets its attachment root component as the LightingAttachmentRoot.

  2. When Indirect Lighting Cache is updated ( FIndirectLightingCache::UpdateCachePrimitive() ), it tries to find each PrimitiveSceneInfo's attachment group root and use the root's indirect lighting cache allocation. If it fails to find AttachmentParentAllocation, it calculates the Primitive's indirect lighting allocation from the scratch.

  3. When the multipart-weapon is attached to a Character, all the part meshes' attachment root is the collision capsule, which wouldn't be rendered to a scene.

  4. It always fails to find the AttachmentParentAllocation of the meshes' PrimitiveSceneInfo in 3. case and every parts calc their own cache allocation every frame. (Which takes a huge amount of time)

Is this a bug or there's something wrong with my settings? Thanks for any advise.

I temporarily(since 4.5) modified the PrimitiveSceneInfo's constructor to set the lighting attachment root the highest PrimitiveComponent in the hierarchy which is bUseLightAttachmentAsGroup enabled instead the AttachmentRoot to manually adjust the light attachment group and it works okay for me.

Product Version: Not Selected
Tags:
more ▼

asked Apr 27 '15 at 02:46 AM in Rendering

avatar image

STEIN84
43 5 9 10

avatar image STEIN84 May 07 '15 at 07:15 AM

I just want to know what I think is right or not. Thanks for any advise here :)

avatar image RyanB STAFF May 07 '15 at 04:01 PM

I think you kind of found an edge case here. yes the light attachment group is meant to make sure a group of meshes all light as one, but if the top parent is not a rendered object that falls back to the expensive path. I guess in a perfect world it would know to make a new lightingsample to use but I'm guessing this problem hasn't come up enough yet.

What happens if you try to use one of the rendered chunks as an intermediate sub-root, and only check the bLightAttachmentAsGroup flag for that piece and not the top collision root? The tooltip does say that flag only works on roots so I am not completely sure if this will work.

avatar image STEIN84 May 12 '15 at 02:44 AM

Hi RyanB, sorry for the late answer. What I actually did was modifying GetAttachmentRoot() function to return the sub-root which is bLightAttachmentAsGroup == true. ( temporarily of course. it's okay so far because the function is only used by indirect lighting cache related code)

The outcome, the sub-root makes it's own attachment group and the group elements use the sub-root's indirect lighting cache. Both visual outcome and performance show no problem.

In my opinion, if someone's applying part assemble system to a character or it's weapon meshes, all the meshes' root will always be the collision capsule and therefore have this issue. I'm using up to 15 meshes to a single weapon and can't give up the benefit of using light attachment group.

Thanks for the answer RyanB and I expect there will be a modification later :)

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

0 answers: sort voted first
Be the first one to answer this question
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