Humus was written on the GPU pro, many of which were on his website and later mentioned on siggraph12.
The similarities are not recorded. Combined with the document above in siggraph12, it can be said that the amount of gold is quite high and there are many highlights for reference.
Light Index
The Processing Method of Multi-light source is not the deferred series, but the light index method, put the light information in a texture.
The details are skipped.
Shadow
The cascaded shadow map is used, and snapping is used to avoid jitter. In different situations of camera, the range of shadow is automatically adjusted to maximize the utilization.
Here is a great detail. In the transition between different cascade, dither is used instead of blend, which avoids the problem of sample twice.
In PC, a result similar to pcss is also implemented. The sample search is performed in shadowmap using ssao-like methods, and the size of the Shadow kernel is determined based on whether there is occluder.
Shadow of Characters
In the game of justcause2, it is often because the characters are in front of the camera, which leads to poor precision of normal shadow effects. humus tries to add a special shadow buffer for rendering characters, however, it is found that the cost effectiveness is too low. The final solution is light bleed mapping technique of tatarchuk.
This reference is this: http://developer.amd.com/wordpress/media/2012/10/D3DTutorial05_Real-Time_Skin_Rendering.pdf
In the GDC article, it was supposed to be quite cutting-edge. Now it seems that there is a lot of theoretical depth, but it is basically not applicable, and graphics changes are really fast.
Light bleeding is to extend the shadow calculation. Based on the distance between the receiver and the occluder, it is not simply visible but invisible, but gradually decreasing the brightness:
Function diagram of light bleeding:
Function diagram of normal shadow:
Humus made some changes. Natalya uses exp attenuation, while justcause2 uses linear attenuation.
In the end, the shadow of character is more gentle (less visual artifact), which is a method that does not seek merit but does not survive.
AO
There are several types of AO:
- AO with material on the object, and an AO channel with material
- Ssao
- AO volume: in character, vehicles often have
Floating point PrecisionI will not repeat it in another blog. Here I will slightly record how to calculate the precision of floating point. This involves the principle of floating point, this principle has a very low probability of use, so it should be quite normal if you forget it. Our general floating point is a 23-bit mantissa, so if we do the calculation at the level of 8192, the accuracy is 8192/POW (1/1024) =, which is about millimeter level, however, after various rotation operations on the matrix, the error accumulation is amazing. The practice is to first translate, avoid big data, and then perform rotation.
Consistent API
A common cross-platform approach is to have an API in the engine to process various platforms. at the design stage, humus indicates that it will be simpler if we can learn from dx10's State object design earlier.
After dx10, the State is grouped, blend state, and so on. This design is more refined.
Gamma
Justcause2 uses linear space for lighting, but some hardware blending problems on DX9 sRGB bring some troubles.
Another problem is not that technical, but causes a lot of problems, that is, early programmers used 2 as the value of Gamma conversion, rather than 2.2. This is no difference for programmers, however, the difference between the artist and the final correction costs a little.
Memory Optimization
First, justcause used a good feedback to artist & designer, that is, when memory is exhausted, no new textures will be allocated, but an error texture will be used for warning, then, the designer is forced to reduce resources. This is a very effective method although the technical content in the project is not high.
Shdow map uses 16 bit, 1024 resolution, and 3 images.
Vertex Compress
Make a further texture packing, and put the color of texture on the vertex when some permits are made. In texture, only the luminance is kept, and then three pieces are pressed into one dxt1.