BIQ
Today’s impossible, will be tomorrow’s reality. https://think-biq.com
Image for post
Image for post
Safety first, everyone.

Intro

While intergrating native platform C APIs (e.g. on windows) into a third-party C++ application, I found myself having to make sure that query functions, that allocate and fill results of different data types, are called with the right paramters. And the inquired data is also properly disposed of after the call. This, and the fact that saftey is on the forefront of the collective unconcious, served as the inspiration for this post and the publishing of a small demo, highlighting the architecture proposed in this article. Hope you enjoy reading.

Setup

API example


Image for post
Image for post
Just imagine she is searching for the right strings.

Intro

There are things, that come up time and time again. One of those things is creating a string version of Enum values in Unreal Engine. For this and other cases, we started to condense some of our utility and helper functions into a module. This module can then be used as part of a plugin, or as a standalone game module. In this article, I want to highlight our approach for to stringify enum values.

Setup

API Example

Now press button ‘Make implementation plz!’

Let’s make this happen. …


Image for post
Image for post
Makes sense to show something Apple related here, right.

Intro

Going directly to source is sometimes the right move. On macOS that would be the core libraries using Objective-C. In this example, we use CoreWLAN to ask for information on the current wlan interface connection. You can find the complete source on github.

Setup

Structure

Making our lives easier

WlanInfo.make

In the make target build, the first step is to create a dynamic library called libwlaninfo via the CXX compiler, which we have specified as clang. The -stdlib=libc++ flag ensures that the compiler links against libc++ (heavily favoured by Apple) and -std=c++11 tells the compiler to use the c++11 standard. Next we declare this operation to produce a dynamic library by specifying -shared. To get access to Apple’s core library, we have to link the appropriate libraries, which in our case is Foundation and CoreWLAN. The -fpic ensures that the library has relative address management. Finally we specify the Objective-C++ source file (indicated by the .mm extension) and tell the compile to put the output file in the bin directory. The next step is to compile our program entry (via the main function) contained in Main.cpp, …


Image for post
Image for post
The title picture, selected to impress you with random code.

Intro

Structuring the data in your solutions is a vital part of success. Epic Games has made a quite convenient to integrate custom structs into Unreal Engine’s infrastructure. In this article, we take a look at how we can achieve integration of a custom struct into the Engine’s hashing system. This can be useful for comparisons and more excitingly, using your struct as a key value in a TMap instance.

Setup

Minimal Declaration


Intro

This is the second installment of the UE4 custom shader development series, where we have a look at how to use custom shader code in your materials, as well as build and reference a resuable codebase. In the first part we discussed setting up the environment to house our shaders in a plugin.

Preface

Custom shader code will be embedded in larger framework, autogenerated by Unreal Engine’s shader compiler. The way this is presented to the user of the engine’s material editor, is the Custom Expression node. …


Image for post
Image for post

Intro

As part of an ongoing series about developing custom shaders for plugins in Unreal Engine, we start off by looking at how we setup the environment.

Preface

Unreal Engine’s Material and Shader System is very powerful and fun to work with. If you find yourself in need of some advanced features, or having to extend the default shaders work, you have to dig into the way UE loads and processes it’s custom shader source abstraction. UE shaders come in two varieties, .ush and .usf files. These stand for unreal shader header and unreal shader file respectivly. They are really no different from each other, except that ush files are supposed to contained shared definitions to be included, and usf files actual shading work. The core engine comes with a lot of predefined shader source. …


Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
m

In version 4.23 of Unreal Engine, you will most likely be presented with “/Engine/Generated/Material.ush(1964,56–152): error x3004: undeclared identifier ´TextureExternalSample_Decal`” if you try to sample a Media Texture in a Material configured for Deferred Decals with a Translucened Blend Mode.

To work around this issue, we’ve found, that configuring the Sampler Node to consider Mip Map Level Inputs and overriding the default Level with 0, the material compiles without any issues.

Image for post
Image for post

Originally published at https://biq.solutions on December 24, 2019.


Image for post
Image for post

Unreal Engine 4.21 ships with version 2018.1.1 of Autodesk’s FBXSDK. It’s used when importing or exporting FBX 3D data into your project using Unreal Editor. Sometimes it may be necessary to load or save 3D meshes at runtime. It’s mostly pretty straight forward to integrate third-party software into your packaged builds, but linking with the shipping FBX tends to be a bit more involved.

The shipped version of the SDK coming along with UE4 is located under $UE_PATH/Engine/Source/ThirdParty/FBX in form of an engine module. Adding the dependency is usually done in the build script, e.g. in YourModule.Build.cs

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store