UE4 dev team, I am in serious doubt as to whether I should continue with my UE4 subscription or not.
I have been doing some research on the forum about hardware skinning support in UE4. So far the results have not been very encouraging.
Let me elaborate a bit.
*I am an indie game developer with C++ skills. But totally new to Unreal Engine 4 though.
I am planning to do a wargame. My game needs hundreds, if not thousands of units to be visible within the view frustum at the same time.
The models close to the camera need to be medium poly (1500 polygons) with normal maps and ambient occlusion. The ones distant from the camera will be progressively lesser in polycount (the plan is to have 3 or 4 levels of LODs). I am thinking of having the final LOD as a simple 2D sprite, say imposters or flipbook animated sprites in UE4 parlance.
The game is set 100% outdoors.
Even though the game has a few barns and buildings on the battlefield, it is guaranteed that the camera will never ever enter the inside of a building. This means no indoor occlusion tests or collision physics inside buildings.
In order to have very large number of animated meshes, my plan of attack is twofold:
-Use LODs and skinned instancing for near to medium distances from the camera.
-Use imposters / flipbook style sprites for far distances away from the camera.
I plan on using the hardware skinning technique used by NVIDIA a couple of years ago.
This involves the use of skinned instancing (only supported from DirectX10 and above) with three levels of LOD. This enables the NIVIDIA tech demo to render around 10000 animated meshes with three levels of LOD using the hardware supported skinned instancing technique.
The hardware skinning workflow goes something like this:
-Load an FBX mesh with animation data.
-Extract the bone transforms for the animations.
-Write the bone transforms to a video texture in VRAM.
-Do a vertex texture fetch of the bone transforms and do the skinning on the character using a vertex shader technique.
The super important question for me is whether UE4 is capable of supporting this hardware skinning / skinned instancing technique using bone transforms written to texture memory?
If the answer is no, then with deep regret, I must look somewhere else. UE4 looks super capable! Without hardware skinning / skinned instancing support though, my game cannot take off.
Unreal dev team, can you please look into the technical aspects of this and post an answer?
Here’s a thought - you can drop your subscription and continue to use what you have. When they add support for what you need you can reactivate your subscription…
Or you could add this feature yourself and sell it on the Marketplace as a plug-in.
VegasRich, thanks for the reply.
No, I am not averse to implementing this feature myself. I have decent C++ skills.
But I have not been able to find out whether UE4 can drive the character animation by reading bone matrices from a texture.
If any of the devs can at least answer this it would be helpful.
Take a look at GPUSkinVertexFactory.cpp. Currently uses a Vertex Buffer to store the bone matrices that are fed into the vertex shader. This is where you would most likely need to make the necessary changes for 2*. Then in the shader GpuSkinVertexFactory.usf is where you would make the changes for 3*
I thought I had the right pointers. But JamesG from the UnrealDev team posted the following answer in the AnswerHub:
“This is a cool and interesting technique, but not one that we really have support for in the engine right now I’m afraid. The closest might actually be some kind of mesh particle emitter. There are probably several other problems that would need to be overcome to make a game with 10,000 independent units in UE4 before the skinning became the bottleneck, such as how to efficiently tick, move, collide with, navigate, replicate and animate them all! These are all interesting problems that we certainly want to investigate further in future. If you decide to dig into some of these yourself, please do let us know what you find!- JamesG”
Pretty disappointing!
Anyways, if I reduce my demands from 10000 characters to 1000 characters will this work out ?
Also can the methods defined in GPUSkinVertexFactory.cpp and the shaders defined in GpuSkinVertexFactory.usf be used to implement the technique that I am talking about?