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"

Crash in 4.17.2 with instanced static meshes (Unknown RHI vertex element type 0)

Hello, I am using some simple C++ code for creating runtime instanced static mesh components.
My code worked great until 4.17.1, but since I upgraded to 4.17.2 today it just crashes.
Since I was unable to understand much (callstack at the end) I also tried upgrading to 4.18 preview but the crash still occurred.
My project is quite extensive so I don't think I can give exact steps to reproduce but I will include the code that if I comment out stops the crash. This is how I create my component: (this is done at runtime)

 NewComp = NewObject<UInstancedStaticMeshComponent>(this, name);
 NewComp->AttachToComponent(PlanetCenter, FAttachmentTransformRules::SnapToTargetIncludingScale);

and this is how I add an instance again during runtime - commenting this out stops the crash (even if the component is created)

 Comp->AddInstance(FTransform(rot, loc, scale));

I guess that this is common stuff. Now the crash happens in Windows\D3D11RHI\Private\D3D11VertexDeclaration.cpp, line 54 ("Unknown RHI vertex element type 0")
Full stack trace here: https://pastebin.com/HWLvAY3B

I tried switching my mesh just in case my materials were a problem - but it still happens everytime.

I would appreciate any help, even a workaround, since my game is broken atm..

Thanks in advance

Product Version: UE 4.17
more ▼

asked Sep 25 '17 at 10:28 PM in Bug Reports

avatar image

77 4 6 11

avatar image soulsource_ag Sep 26 '17 at 12:27 PM

The funny thing is: If one adds the instanced static mesh component in a Blueprint instead of C++ it just works...

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

3 answers: sort voted first

Hello! I'm having the same problem. Found a workaround, just call the following functions right after the call to RegisterComponent:


It seems the InstanceRenderData is not created before RHI initialization in some cases, leading to vertex declaration referencing NULL vertex buffers.

more ▼

answered Sep 26 '17 at 01:58 AM

avatar image

259 12 15 29

avatar image Semitable Sep 26 '17 at 12:15 PM

Wow! Nice find! Yeah, I could make it work with that! Thanks a lot! Nevertheless, could we have some info about why this is happening? Is this going to be fixed?

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

Hey semitable-

As mentioned in another post here (https://answers.unrealengine.com/questions/709902/crash-when-adding-an-instance-with-instanced-stati.html) this issue does occur in 4.17.2 but has been fixed internally and will be included with an update to the engine.


Doug Wilson

more ▼

answered Sep 26 '17 at 07:12 PM

avatar image Semitable Sep 26 '17 at 07:15 PM

Yes, I saw the post! Thank you, I will be using the workaround mentioned above until said update

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

This is currently fixed in 4.18, so you can have the fix in the next preview.

more ▼

answered Sep 29 '17 at 04:02 PM

avatar image

Michel.Dupuis STAFF
120 2 4 4

(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