Posts

Showing posts from July, 2019

When to create Blueprint project and when C++ in Unreal Engine?

Working with "pure" Blueprint project is simpler and faster, because you don't need Visual Studio C++ installed on the computer and don't need to compile the project. But if you will need C++-capabilities in BP project, you can add C++ class in the project and you project turns to be C++. So, for simple and test projects I propose to start with BP. For "big" project I propose to use C++ project from the beginning, because actually C++ is currently much more supported when BP in Unreal Engine.

VR settings in Unreal Engine

Image
To set up scale of the world in VR, double click "World settings" - it's root of the World outliner, and change VR - World to meters value:

Working with MIDI in Unreal Engine Blueprint

Image
Unreal Engine 4 have built-in support for working with MIDI using a built-in plugin. We will discuss how to work with it for receiving MIDI events in your UE project. Note: Sending MIDI messages is declared, but it's unknown how to do it with this plugin, so actually only receiving MIDI events working for now. We will see how to obtain MIDI events from sliders, faders and buttons from MIDI controllers such as Korg Nano Kontrol or Novation Launch Pad or software such as Ableton Live into your UE project. Preliminary note: If you need to pass MIDI events from Ableton Live to UE scene in Windows, you need to create virtual MIDI port using free app loopMIDI . On Mac OS virtual MIDI port can be created inside Ableton Live. Working with MIDI in UE is simple, because it has built-in plugin for this purpose. So, let's start. 1. Activate MIDI plugin Go to UE's menu Edit - Plugins and activate MIDI Device Support plugin, and then restart the UE Edito

Forward, Deferred and Raytracing rendering in openFrameworks and web

Image
Currently, there are three basic approaches for rendering computer graphics scenes: forward rendering, deferred rendering, raytracing. 1. Forward rendering It's that OpenGL does, you create vertices, then make faces, and rasterize them, all passing via shaders. The rendering process is straightworward and fast, but rendering shadows, making degree-of-field effect and drawing clouds is hard here. Most of openFrameworks examples use forward rendering. 2. Deferred rendering It's the same as forward rendering, but additionally some extra data is rendered for computing shadows. The lighting pass is performed after the scene geometry is drawn. See detailed explanation here: https://learnopengl.com/Advanced-Lighting/Deferred-Shading Shadows, degree-of-field effect and some kind of reflections are possible with deferred rendering. Unreal Engine 4 and Unity currently (2019) are based on deferred rendering. openFrameworks: https://github.com/perevalovds

Random number generator on GPU

Pseudo-random number generation on CPU is simple - we need to store previous state and use it to generate the next number. On a GPU, it's need more attention, we need to generate random numbers in each instance independently. That is, we need to keep for each instance a state, randomly initialized on CPU, and then update the state, using corresponding functions. The good explanation and particular implementation of good random generator is discussed here: https://math.stackexchange.com/questions/337782/pseudo-random-number-generation-on-the-gpu#answers-header It's about method explained in NVidia's book "GPU Gems", Chapter 37. Efficient Random Number Generation and Application Using CUDA https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch37.html So, here is my code: //-------------------------------------------------------------------------- //Random generator for GPU //Based on //https://math.stackexchange.com/questions/337782/pse