Monday, July 30, 2012

[UDK/UE3] Blinn vs. Phong Specular Video

Just a short video to compare Phong and Blinn specular. The scene setup is similar to a wet street at night with light from lanterns and neon signs.


Sunday, July 15, 2012

Texture Mask vs. Vertex Colors vs. Material IDs

This is an addition to yesterdays post:
http://oliverm-h.blogspot.de/2012/07/ue3-performance-analysis-material-ids.html

Since the vertex color solution is so expensive I've made a masking texture with the same colors this time, using the second (lightmap) UV channel. The material is identically.


The result is exactly the same as with vertex color blending. Next to the material complexity it's probably the blending of textures itself that is causing a performance impact, no matter if the blending is based on vertex colors or texture masks.
So as long as you don't need smooth texture transitions you should stick with multiple materials or split up the mesh into multiple pieces. However this is for PCs only, if it comes to PS3/XBOX you have to keep an close eye on the total draw call count, according to Epic.

Comparing vertex colors and texture masks, they both have their dis/advantages. Texture masks causes the VRAM usuage to be higher. Vertex colors on the other hand will increase the static mesh mb size, so this might be a bad idea for meshes with a very high triangle count.


Friday, July 13, 2012

UE3 Performance Analysis: Material IDs vs. Vertex Blending

I was always wondering how much multiple materials on a mesh will affect the performance. Theory says that each mesh/material combination will cause an extra draw call and due to common opinion you should always keep the amount of material as low as possible.
So as an alternative I thought of using vertex colors to blend between multiple textures on a single mesh with just a single material.


For the test I'm using a timber frame house model (4448 tris) with 6 materials in total. This model is beeing placed 37 times in a simple level. The lighting is prebaked. To blend 6 textures by vertex colors in a single material this method is being used: http://oliverm-h.blogspot.de/2012/02/how-to-use-vertex-colors-to-blend.html
Here's the performance stats:

 Multiple Materials


Vertex Color Blending



Those screens show a clear result. Though multiple materials causes the draw call count to be 3.75 times higher (750 / 200), FPS are still better. The vertex color material complexity is probably killing the advantage of less draw calls. Also the Unreal Engine seems to handle many objects (and therefore draw calls) quite well.