Chroma SDK
Chroma SDK 已不再积极维护,仅在必要时修复重大错误。它按现状提供,并附带本网站上的指南。可在 Discord 获得有限的支持。
- 适用于希望将 Chroma 直接集成到游戏中的游戏开发者
- 自行管理的集成(不使用 Razer Synapse 中包含的外部 Chroma 服务)
- 您需要自行设计 Chroma 动画。对于 Chroma SDK,WYVRN 团队不提供动画设计。
- Chroma 动画必须包含在游戏构建中
- 为 Windows 动态照明、Razer Chroma RGB 以及 50 多个 Chroma Connect 合作伙伴设计 RGB 灯效
- 可在 Discord 获得有限的支持
集成选项
我们为游戏工作室提供两种使用 Chroma 打造沉浸式体验的方式:
-
WYVRN SDK - 我们推荐的一体化解决方案,可简化集成、缩短开发时间并优化工作流程。了解 WYVRN SDK
-
Chroma SDK - 适用于希望直接控制动画过程、显式管理 Chroma 并将动画直接嵌入游戏的开发者。这种方式可定制性更高,但需要更多开发工作:您需要自行设计动画并将其随游戏构建一起发布。Chroma SDK 已不再积极维护。
Chroma SDK 集成
Chroma SDK 的集成流程包括以下内容:
Tools
- The Web Chroma Editor creates Chroma animations and code snippets from several input sources. Designers can create Chroma animations without writing any code. The toolset can use input sources as video, text, camera, web cam, desktop capture, gradients, patterns, images, and blended animations.

Integration
The integration process is a matter of finding game triggers in the game code to find the optimal place to add a call to PlayAnimation(). The Chroma authoring tools create and download Chroma animation sets that are embedded into the game. The typical Chroma integration process lasts 3 - 5 days for a single developer. In most cases for game engines after the game build completes, the Chroma animations need to be copied to the animation folder within the game's content folder.
Performance
Performance Considerations
Avoid Blocking the Update/Rendering Thread:
Calling the Chroma API in the middle of an update or rendering thread can cause noticeable lag if not handled properly.
Two Approaches for Animation References:
- By ID (Synchronous):
- Methods that reference animations by ID are synchronous. These calls can block the thread they run on.
- Recommendation: Use a dedicated thread outside the main update/render thread if you plan to call by ID.
- By Name (Asynchronous):
- Methods that reference animations by name have been modified to run in the background and return immediately.
- This design avoids any performance impact on the main thread.
- Recommendation: It is safe to call these methods directly from the main thread since they won't block it.
GetAnimation Behavior:
- GetAnimation returns the ID of a loaded animation immediately or sends the operation to open the animation in the background if it's not already loaded.
Preloading Animations:
- If yor design calls for using PlayChromaAnimationName during update or rendering, preload animations during level loading to avoid runtime lag.
Performance is a key concern when adding Chroma to event triggers. Calling the API in the middle of an update or rendering thread could cause noticable lag if designed incorrectly. Methods that reference animations by id are synchronous and may block the calling thread. Methods that reference animations by name have been modified to pass the operation to the background and return immediately to avoid any performance impact. SetEventName is asynchronous and is rate limited to 30 FPS. GetAnimation will return the id of a loaded animation immediately or send the open animation operation to the background. Preload animations during the level loading stage when using PlayChromaAnimationName if the design calls from the update or rendering thread. Use a dedicated thread outside the update and rendering thread If you plan to reference animations by id.
Asynchronous Methods:
The following methods have been adapted to work in the background (asynchronously) and can be safely called from the main thread without causing performance bottlenecks.
AddNonZeroAllKeysAllFramesName
AddNonZeroAllKeysName
CloseAnimationName
CopyKeyColorName
CopyKeysColorAllFramesName
CopyNonZeroAllKeysAllFramesName
CopyNonZeroAllKeysName
CopyNonZeroTargetAllKeysAllFramesName
CoreStreamBroadcast
CoreStreamBroadcastEnd
CoreStreamGetAuthShortcode
CoreStreamGetFocus
CoreStreamGetId
CoreStreamGetKey
CoreStreamGetStatus
CoreStreamReleaseShortcode
CoreStreamSetFocus
CoreStreamWatch
CoreStreamWatchEnd
DuplicateFirstFrameName
DuplicateFramesName
DuplicateMirrorFramesName
FadeEndFramesName
FadeStartFramesName
FillRandomColorsBlackAndWhiteAllFramesName
FillThresholdColorsAllFramesName
FillThresholdColorsMinMaxAllFramesRGBName
FillThresholdColorsRGBName
FillZeroColorAllFramesRGBName
GetAnimation
InsertDelayName
InvertColorsAllFramesName
MakeBlankFramesName
MakeBlankFramesRGBName
MultiplyColorLerpAllFramesName
MultiplyIntensityAllFramesName
MultiplyIntensityAllFramesRGBName
MultiplyIntensityColorName
MultiplyIntensityName
MultiplyIntensityRGBName
MultiplyTargetColorLerpAllFramesName
OverrideFrameDurationName
PlayChromaAnimationName
PreviewFrameName
ReduceFramesName
ReverseAllFramesName
SetChromaCustomFlagName
SetIdleAnimationName
SetKeyColorAllFramesName
SetKeyColorName
SetKeysColorAllFramesName
SetKeysColorAllFramesRGBName
StopAll
StopAnimationName
StopAnimationType
SubtractNonZeroAllKeysAllFramesName
SubtractNonZeroAllKeysName
TrimEndFramesName
TrimStartFramesName
UseForwardChromaEvents
UseIdleAnimation
UseIdleAnimations