The Corsair User Forums

The Corsair User Forums (https://forum.corsair.com/forums/index.php)
-   CUE 1.x and 2.x SDK (https://forum.corsair.com/forums/forumdisplay.php?f=271)
-   -   Keyboard-Ambilight (https://forum.corsair.com/forums/showthread.php?t=163358)

Darth Affe 11-05-2016 08:26 PM

Keyboard-Ambilight
 
1 Attachment(s)
Hey Guys,

lately I implemented an Ambilight-Layer for Artemis.
Since all the capture-logic and stuff could easily transfered, I decided to create a small standalone application providing only this ambilight-feature as a CUE.NET-example.

It's nothing too fancy in terms of UI or error-handling but I thought if someone is interested in stuff like this it might be worth posting it here.
The capture is done by reading the front-buffer of the graphic card, so it works for everything on your primary-screen (windowed-games, movies, idling on the desktop, etc.) not bypassing the front-buffer (a lot of games do this in fullscreen mode).

A note about CPU-usage: 1920x1080 @ 20FPS update rate uses 1-2% on my system (i7 2600K) with default settings. But if you're using higher resolutions or to high settings you might completely eat your CPU. If you run into performance-issues try reducing the capture-rate (down to 10 looks quite good, 5 is bearable), increasing downsampling (4K resolution should use 8 or more) or reducing the mirrored amount.

Usage: After unpacking the zip just start the exe (.NET 4.0 or newer has to be installed) and you'll have a new system-tray-icon. Clicking this icon will open a simple configuration-window (settings are automatically stored).

EDIT: Updated to V1.0.1
- Fixed calculation-error in Mirror-Mode
- Added Min-Lightness-Setting

EDIT: Updated to V1.0.1.1
- Added Gamma-Setting to allow stronger colors without preventing full black keys

EDIT: Updated to V1.0.1.2
- Updated CUE.NET to support the K95 Platinum lightbar

EDIT: Updated to V1.0.1.3
- Fixed an issue with DPI-scaled systems

Download: http://cue.wyrez.org/KeyboardAmbilight.zip (or the attachment of this post)
Source: https://github.com/DarthAffe/CUE.NET...Ambilight_full

Demo-Video (using aggressive settings with high update-rates and no smoothing):

noir 11-10-2016 08:43 AM

nice work, works great on my strafe rgb :)

brainless 11-10-2016 09:54 PM

Getting an error: MSVCP140.dll is missing. :eek:

But I have Visual C++ Redistributable für Visual Studio 2015 and .NET Framework 4.6.1 installed?! :confused:

noir 11-10-2016 11:01 PM

Quote:

Originally Posted by brainless (Post 878597)
Getting an error: MSVCP140.dll is missing. :eek:

But I have Visual C++ Redistributable für Visual Studio 2015 and .NET Framework 4.6.1 installed?! :confused:

Install the VC++ 2015 run-times, maybe you installed the 64bit version, also try to install the 32bit runtime.
https://www.microsoft.com/en-us/down....aspx?id=48145

noir 11-12-2016 07:07 AM

Quote:

Originally Posted by Darth Affe (Post 878114)
Hey Guys,

lately I implemented an Ambilight-Layer for Artemis (coming with the next version).
Since all the capture-logic and stuff could easily transfered, I decided to create a small standalone application providing only this ambilight-feature as a CUE.NET-example.

It's nothing too fancy in terms of UI or error-handling but I thought if someone is interested in stuff like this it might be worth posting it here.
The capture is done by reading the front-buffer of the graphic card, so it works for everything (games, movies, idling on the desktop, etc.) that happens on your primary-display.

A note about CPU-usage: 1920x1080 @ 20FPS update rate uses 1-2% on my system (i7 2600K) with default settings. But if you're using higher resolutions or to high settings you might completely eat your CPU. If you run into performance-issues try reducing the capture-rate (down to 10 looks quite good, 5 is bearable), increasing downsampling (4K resolution should use 8 or more) or reducing the mirrored amount.

Usage: After unpacking the zip just start the exe (.NET 4.0 or newer has to be installed) and you'll have a new system-tray-icon. Clicking this icon will open a simple configuration-window (settings are automatically stored).

Download: http://cue.wyrez.org/KeyboardAmbilight.zip (or the attachment of this post)
Source: https://github.com/DarthAffe/CUE.NET...Ambilight_full

Demo-Video (using aggressive settings with high update-rates and no smoothing): https://www.youtube.com/watch?v=o4t6M25bM24

Can you add an option to keep keyboard lit or dimly lit under completely black scenes (for night), for example when viewing my linux ssh terminal the kb goes black :), making it hard to see at night.

Darth Affe 11-12-2016 08:54 AM

Quote:

Originally Posted by noir (Post 878724)
Can you add an option to keep keyboard lit or dimly lit under completely black scenes (for night), for example when viewing my linux ssh terminal the kb goes black :), making it hard to see at night.

I just created a new version - attachement and links are updated.
Just try messing around with MinLightness. (Note that on keyboards without 16m color-mode you need to set it at least to 12 to have some effect.)

noir 11-13-2016 03:14 AM

Quote:

Originally Posted by Darth Affe (Post 878731)
I just created a new version - attachement and links are updated.
Just try messing around with MinLightness. (Note that on keyboards without 16m color-mode you need to set it at least to 12 to have some effect.)

great works perfect, thanks!

Liquid Cobalt 12-08-2016 02:26 PM

It seems to be impossible to have black keys for black parts of the screen while also having saturated colors on the other keys. When i set MinLightness to low values colors are very washed out. In your Video though this seems possible to get black and strong colors together. Is this due to the new version you made and is it possible then to get the old version?

Darth Affe 12-08-2016 03:49 PM

Increasing MinLightness should reduce the contrast. To get completely black keys you 'll have to set MinLightness to 0.
The saturation of colors (without increasing min lightness) depends highly on the reflected source. (The video I choosed works really good here - that's why I used it: p)

The settings used in the video were really aggressive settings:
  • Update-Rate: 40 (this shouldn't matter as long as there isn't fast, flashing stuff going on)
  • Ambilight-Mode: Mirror (this shouldn't matter at all)
  • Mirror-Amount: 10% [on displays with resolutions > 1920x1080 this should be a bit lower] (increasing this too far might cause the colors to get washed out.)
  • Downsampling: 2 (this is used mainly for performance purposes and shouldn't be a problem as long as you don't max it out on low resolution screens)
  • Smoothing: None (this is important to get sharp edges and colors, but might be a bit annoying in the long run)
  • Min Lightness: 0 (this is important too, since you can't get black with values > 0 [or > 11 if 16.8m colors mode is disabled])
  • From the rest only vertical flip and black-bar-detection bottom is enabled.

But I'm afraid, that the main problem is the lack of strong colors in the source most of the time.
I could try to implement a setting to perform some sort of a simple gama-correction. This might help to get strong colors without reducing the contrast.

Darth Affe 12-11-2016 12:01 PM

@Liquid Cobalt: I just added the gamma-correction I mentioned earlier. Just increase the value to something > 1 - to get stronger colors.

Liquid Cobalt 12-12-2016 05:24 PM

Thank you very much! I think a huge part of my problem was the fact that i had Mirror-Amount set to 100% because i wanted to "see" my whole screen on the keyboard.

Afroasasyn 12-30-2016 04:25 PM

Hello! I'm impressed of your work with this sweet keyboard illumination, great work! With movies or just normal PC usage this app works like a charm, but I have problem with games. When I play for example Batman Arkham Knight/Devil May Cry or any game in fullscreen mode, keyboard LEDs freezes and don't change with picture displayed on the screen. Everything start working back when I change in-game setting to display in window mode (which give me colors of my entire desktop) or when I just exit the game. Is there any solution to this problem?

Darth Affe 12-30-2016 05:41 PM

Oh, I didn't even realize that (I play everything windowed or fullscreen-windowed if the game supports it), but you're right.
This is a limitation coming from the way I capture the screen. Unlike screen-capture software (fraps or stuff like this) I don't interact with the game (and do dll-injection, function-hooking and stuff), but simply ask DirectX for the front-buffer (the last image reported to be drawn). For performance reasons a DirectX-fullscreen-application bypasses all of this management. Instead it draws 'directly on the screen', so I'm not able to get that image.

You can visualize that behavior by running a video and fullscreen the player (the ambilight should work correct now). Now just let the video running and start the game. You'll still see the visualization of the video, even if on your screen the game completly hides the video, which is still the top-most content on the screen for me.

Afroasasyn 01-13-2017 04:41 PM

Hello again :) I just bought a Corsair M65 PRO and I wonder if there is any possibility to use something like lighting link for this Ambilight effect.

Darth Affe 01-13-2017 06:18 PM

Quote:

Originally Posted by Afroasasyn (Post 886477)
I wonder if there is any possibility to use something like lighting link for this Ambilight effect.

No, since lighting link doesn't offer SDK support there is no easy way to integrate it (an own driver will of course always work but is really a lot of work).


All times are GMT -4. The time now is 03:59 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.