Game/App Integrations

Adding SignalRGB support to your app or game is quick and easy. If your project can send HTTP POST requests, it can leverage SignalRGB's vast array of compatible devices.

There are two major ways your app or game can accomplish this: triggering pre-existing effects, or communicating with a custom effect you develop . The first option requires significantly less development time, but is limited to our library of premade effects. While the second approach might be more time consuming, the sky's the limit when it comes to the variety and number of effects you can create.

It is ultimately up to you as the developer to decide which approach is right for your project, but either method can be used to produce great lighting experiences.

Game Effect Library

If you'd rather not develop your own lighting effects, you can take advantage of our wide variety of pre-made effects. Using SignalRGB app URLs, it is possible to install and activate any public lighting effect available for download from SignalRGB.

It is recommended that you install any lighting effects your app or game will activate when it first opens, to ensure that all effects activate quickly.

The following API routes exist to help with this:

Request URIPurpose
signalrgb://effect/install/EffectNameInstall the lighting effect named EffectName
signalrgb://effect/apply/EffectNameActivate the lighting effect named EffectName

Effect names are case-sensitive, and any special characters must be URL encoded. For example, any spaces should be replaced with %20.

If your chosen engine or language cannot communicate with custom URL protocol handlers, you can still use this portion of the SignalRGB API. Simply start the SignalRgbLauncher.exe executable located in C:\Users\<username>\AppData\Local\VortxEngine with --url argument set to the path of the API route you'd like to use. To prevent the app from being brought to the foreground, you can add ?-silentlaunch-.

For example, to install the effect named Azure you would launch the executable with the following argument:

SignalRgbLauncher.exe --url=effect/apply/Azure?-silentlaunch-

Unity

Unreal Engine

The following C++ class can be used with Unreal Engine to install and activate any SignalRGB effect.

SignalEffectApi.cpp
SignalEffectApi.h
Copy

It is recommended that you install any effects you wish to use when your app launches so that effects can be triggered quickly.

The following example shows how you can install and activate an effect using the SignalEffectApi class.

C++
Copy

Custom Effects

Communicating with SignalRGB directly using HTTP requests is easy to accomplish once you know the way that requests are structured. The structure of the request is as follows:

Request type: POST

Request URI: http://localhost:16034/canvas/event?sender=your-app-name&event=your-event

All commands sent from your app should use the same sender variable. The event variable is where the data being passed to SignalRGB should go.

Inside the effect, all data is sent through the onCanvasApiEvent function. Use this function to handle how your effect responds to HTTP requests.

Example Code

This basic example shows how a Unity or Unreal Engine game can communicate with SignalRGB to trigger events in a custom lighting effect. However, any method of sending HTTP requests can be used to control the custom lighting effect. This flexibility means that SignalRGB support can be added to almost any game or application.

Lighting Effect

All events sent to the API route are passed onto the lighting effect via the onCanvasApiEvent function. There are many ways of managing events, but the following example keeps it simple and easy to understand. If you're building something more complex with many events, consider using the state handler method to keep track of the events and their associated lighting.

Javascript
Copy

Unity

A function like the following will allow Unity to communicate with SignalRGB. However, any method of sending HTTP POST requests can be used.

Unity
Copy

Unreal Engine

The following C++ class can be used with Unreal Engine to enable communication via the SignalRGB API. Make sure to change the sender parameter of the request URI to match what your lightscript is using.

SignalApi.cpp
SignalApi.h
Copy

To trigger a lighting effect in your game's code, simply call the SendEvent function specifying the name of the event you'd like to trigger, along with the name your app or game will use to identify itself to SignalRGB.

C++
Copy

You must add the Http module to your Unreal Engine build dependencies by editing ProjectName.Build.cs to resemble the following:

ProjectName.Build.cs
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard