понедельник, 27 июня 2016 г.

Unreal: Debugging materials and shaders example

Here is two tips that may be usefull if you want to debug your shader.

There is many ways to debug shaders in Unreal Engine. For example, you can translate your shader into HLSL code and use any software that you like for debug that. Or install a Renderdoc plugin to capture a whole frame in Unreal's viewport and jump to Renderdoc. You can read more about it here.

But sometimes you don't want to dig deeper when debugging and use a third-party software, especially if you are not going to solve something complicated, but want to debug some value or see what shader does after interpretation in hlsl.


среда, 22 июня 2016 г.

How to make text facing a camera in Unreal Engine

Hi, I've found a pretty easy way to do that by writing a shader.

If you deal with a text-in-a-wolrd in Unreal it's most likely that you use the TextRenderComponent. It uses a text material and here we begin. All we need is to change this material.

понедельник, 6 июня 2016 г.

Creating Custom Anamorpic Lens Flare in Unreal Engine

Unreal Engine doesn't have any built-in features for create highly-customized lens flares. By default, lens flares are implemented as a image-based effect, so we deal with engine rendering system. In our game we need custom lens flares that can be blocked by other objects. For example, if we have a light source that shine in camera on a background plane and some object, that blocking this light, lens flare should be blocked. This is the main problem. 

In this tutorial, I described a solution of this problem. Note, that the material, described below works correctly only for cameras without fixed aspect ratio (fixed aspect crops image and mask cropped areas with blackbars) and with fov equals 90. You can get the complex solution, that works correctly for all cases from unreal marketplace: https://www.unrealengine.com/marketplace/custom-lens-flares-material