The idea of this plugin is to ease the use of GPU computing power without the need to get into c++.
It strives to be an easy implementation of computing kernels(OpenCL) and shaders(Vulkan) for Blueprints.
Although Unreal Engine also provides the capability to create and run computing shaders through FGlobalShader class, i feel like it complicated to create and modify the shaders.
OpenCL targeted version is 1.2 but can be set to up-to 2.0.
Vulkan targeted version is 1.0 but can be set to up-to 1.1.
OpenCL can also run in CPU mode. In case there’s no dedicated GPU available you can switch to that.
Some current functionality.
In-Editor kernel asset editor
Compile in-editor and check if your kernel has errors.
Pass and retrieve parameters to and from kernel (currently FString, FVector, float and integer and arrays of them)
kernel asset
Full blueprint functionality
Ability to execute kernel assets both at run-time and in editor.
Plans:
UTexture2D Parameters
Ability to find text in kernel asset
Open kernel file from hard-disk.
Running kernels in range work-groups
Create computing shaders and kernels with blueprint graph(probably?)
First of all GREAT job so far keep with the great work and thank you to share it. I’m knew with Opencl stuff, i was looking for a way to apply it in my unreal 4 projects, was searching and i found your plugin and man that made my day, but seems that is not up to date in github, can’t wait to try this update. As i get more used to it i will bring suggestions and if i can i will help with the dev. thank you again.
Thanks for the input. Currently i’m still in some designing phase. I Managed to implement OpenCL Events and event callback and wait for events when issued to an enqueue command. This allows non-blocking operations. It’s very powerful.
I’m still doing some research and testing until i’ll come out with some new info.
Separately i’m working on a vulkan implementation in same manner. using blueprints to construct and an editor to build the shaders(mostly computing).
I also have in mind to implement a graph to build shaders visually.
Still looking forward to decide.
A workflow example of using non-blocking implementation:
Looks awesome! vulkan is another thing of my interest too, i saw that the new OpenCl version that will be released next year will be with vulkan merged this sounds perfect for what you are doing!
i’m mainly interest in Opencl to use in AI, i’m trying to create ai swarms and use the GPU power seems the solution. Congratulations again this initiative is going to change a lot of things for the UE4 community specially when the people realize the power of it and the possibilities that come with it, and be able to use it in BP is absolutely PERFECT.
I’ve removed the OpenCL context object structure and CreateContext node from OpenCL since Vulkan doesn’t have an equivalent of that. Instead, context is self-created during device creation and now only the device should be passed to the other nodes.
Since SPIR-V compiler supports both GLSL and HLSL i decided to do the same. I’m already planning to implement syntax highlighting for both languages.
Thanks for asking. I’m going forward with the project.
New:
Implemented GLSL & HLSL Syntax Highlight
Editor preferences for kernel/shader editor
Some screenshots:
I still need to implement some compiler options for glslang and do more tests with both GLSL and HLSL shaders.
Also i still need to create Vulkan objects(device, queues, buffers, etc).
OpenCL side of this is mostly completed and i’m going to merge them soon.
After a lot of research on glslang and SPIR-V i managed to get the compiler working for GLSL.
I’m using the same workflow path as Epic (Kudos to them for already implementing most of the things in VulkanShaderFormat module).
Getting HLSL to work would require porting HLSL to GLSL using hlslcc and from there compile the code to SPIR-V as usual with glslang.
Glslang and hlslcc are already implemented in the engine as modules which is awesome as i don’t have to compile and implement them myself.
After compilation is implemented i believe is going to be a straight forward process to get Vulkan to blueprints.