The Xresolver has been on the radar for many months now, and one thing that has been consistent among those who have tried it is the belief that this tool is extremely powerful, and at the same time, incredibly difficult to learn.
A brief introduction
The Xresolver is a shader tune-up for Windows and Mac users that claims to remove all shader “exceptions”, and performs various checks and balances on your shaders to get rid of unnecessary functions, prevent the clipping of hair, correct lighting, etc.
The application was announced in June 2015, and many people immediately noticed that it is quite similar to the work of Otavio Pascoal from the Animatorase blog, whose name has become synonymous with software customisations and performance optimisation.
The application has four key parts: a handy, clean user interface, a professional high-level shader compiler, an advanced CPU-analysis tool, and an advanced power tool.
For a full list of Xresolver features, and to download the program for yourself, check the product page.
Features and limitations
In its pure state, the Xresolver is a shader tune-up which can do basic layout edits, but is nowhere near what the Animatorase duo has built. The Animatorase tools are described on their blog as complex optimisation, more akin to a manual shader patch than something that can just be done by a regular user. They can do lots of amazing things, though, like strip all hair in an image, add shadows, shine, bump mapping and much more.
Using the Xresolver, we found ourselves drowning in possibilities, and trying to squeeze all the magic out of our shaders. We learnt a lot, we enjoyed doing it, and we know that many other developers will have discovered the same joy.
So, what’s the problem?
Although all these features, combined with the utility of the background knowledge of the developer, make the tool so much more powerful than it is described, one thing is especially glaring: this is not the first solution to the “pixel shader abuse” issue in Unity.
In fact, many other tools have been developed by Unity developers to deal with this issue, such as the PSPDFKit, or the ir-Tuner. Unfortunately, all of these tools have one thing in common: they take a manual approach to fixing the issues the tool finds.
The problem with the PSPDFKit is that many people struggle with understanding how it works, and making changes to their shaders that are not required. They cannot copy the correct parts of a shader to save and modify it, and therefore can have an interface that looks like a foreign language, or an unknown code generator from a different language, and end up getting their shaders to work, but not optimally.
The problem with the ir-Tuner is that it has limited support for Unity, and cannot help with many specific issues the Xresolver has fixed. They can correct clipping in many situations, but cannot deal with the quirks of Unity’s hair implementation. We’ll discuss these later.
The problem with the old generation of users of shader tune-up tools is that most of them are still missing features they really need, like blending modes, tile-lines and the like.
The problem with the first generation of the Animatorase tools is that they do not require many changes to the shaders, and therefore, because of their simplicity, they have to extract too much functionality, and therefore slow down the process of fixing issues and making changes to shaders.
That being said, Xresolver does something very special, and we believe it has the potential to be the solution everyone is looking for, but it is not there yet.
Shader Compiler
The tool is built on an SSA-HLSL Compiler that provides complete interface with your shaders, and allows you to modify specific parts of them. If you’re familiar with how Unity’s HLSL compiler works, you can quickly know how well it works.
The Xresolver blends shaders like those which can be found in the Script Editor. It saves your customised shaders in a standard directory of any application. You then can execute the command-line tools of the shader compiler and fix the issue you are trying to address.
In short, the xresolver checks each member of the shader at each code point, and modifies them. So, the more detail you give it, the more precision you can get.
Below is a crude example of the procedure Xresolver does. It will fix a bug where half the hair is clipped off in the “hdr” shader, by clipping the hair into the shadow property in the “hdr” shader. In this case, we only have the shader address for the shadow, but it could be split up into multiple copies, or multiple shadow maps.