Giter VIP home page Giter VIP logo

Comments (11)

MartB avatar MartB commented on May 27, 2024

Thats just how overwatch designed their colors.
I suppose the leds on the razer devices are a little brighter with the specific colors they picked.

from retc.

sekwah41 avatar sekwah41 commented on May 27, 2024

I have recompiled it with a gamma correction function just to light it up a little more. I will tweak it as I go along but if you want to make it brighter solely in overwatch change convertLedColor in CorsairSDK.cpp to

#define gamma (1.0/1.7)

int addGamma(int color) {
	return (int) (pow(color / 255.0, gamma) * 255.0);
}

CorsairLedColor CorsairSDK::convertLedColor(const COLORREF& color) {
	CorsairLedColor ledColor;
	ledColor.r = addGamma(GetRValue(color));
	ledColor.g = addGamma(GetGValue(color));
	ledColor.b = addGamma(GetBValue(color));
	ledColor.ledId = CLI_Invalid;

	return ledColor;
}

Build it in visual studio and put the new exe in the main folder and it should run fine. I need to tweak the gamma functions value but it generally looks nicer for the standard colors and stuff like Lucio and Mercy.

I don't believe this is a feature that warrants being added to the actual version though it could be nice to have a config file for gamma correction.

Also I literally only just started C++ the other day for coding some chips xD Don't judge too harsh but if I'm doing anything wrong with general coding standards feedback would be appreciated.

@TobyMoose if you dont know how to rebuild it you can use this but I personally would suggest editing it yourself and compiling it just so you know what is in it.

Also @MartB the colors seem closer to what are displayed on my deathadder so possibly a gamma function would actually line it up with razer hardware better. Though that could just be this device i have (See photo and video in this link https://photos.app.goo.gl/7HEFz6GhjdydcCjU7)

The main difference you can see is with Moira (In the video the one just before the last which is red)

The changes can be found here https://github.com/sekwah41/RETC/blob/master/server-exe/CorsairSDK.cpp#L384

Recompiled Server x64.zip

from retc.

MartB avatar MartB commented on May 27, 2024

@sekwah41 sounds like a plan!
It really seems to look better.

I will implement something like your gamma correction soon. (adjustable through the config)

Edit:
Code wise it looks fine to me, you could only do some minor optimizations that i personally love doing but they wont matter much haha.

from retc.

sekwah41 avatar sekwah41 commented on May 27, 2024

What sort of optimizations would you personally do? I'm curious :)

Edit: for starters i would convert the divide to a multiply, or does it compile into that anyway? I know java that has a performance difference (well slight but its there)

from retc.

MartB avatar MartB commented on May 27, 2024

Probably the following:

  • make addGamma static
  • rewrite it so it takes colorref and extracts the color itself giving back r,g,b as reference params.
    (sth like void TRANSFORM_COLORS(const COLORREF& color, int &r, int &g, int &b) where r,g,b is the transformed output)
  • pass the arguments by const reference
  • use c++ style casts instead of (int)

from retc.

MartB avatar MartB commented on May 27, 2024

@sekwah41 you can build the latest master and try out what i implemented.
Check https://github.com/MartB/RETC/wiki/Config-options for the required config keys.

from retc.

MartB avatar MartB commented on May 27, 2024

Heh typo madness sorry for the notification spam!

from retc.

sekwah41 avatar sekwah41 commented on May 27, 2024

Its alright, thanks for the info btw :)

from retc.

sekwah41 avatar sekwah41 commented on May 27, 2024

Oh good idea with the lookup table, completely passed my mind to do that :)

Hopefully I get to make some fun projects in C++ too, im going to use what youve done to learn some stuff. Anywhere you would suggest has good examples of C++ or any resources to learn a bit faster? I wanna learn some of the standards because pointers and such rather than randomly messing to get stuff working as i dont feel itll have the same effect as trying to learn in java xD

from retc.

sekwah41 avatar sekwah41 commented on May 27, 2024

Shouldn't this be closed if it has been implemented?

from retc.

MartB avatar MartB commented on May 27, 2024

@sekwah41 you are right, but i wanted to get the original author of the issue to check.
Closing this as this will probably not happen anymore.

Regarding your question about good materials/resources i think learning by doing suits programming/coding best. For the use of (old-school) pointers it should be sufficient to read this page: http://www.cplusplus.com/doc/tutorial/pointers/

If you want a document detailing best practices check out.
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
(keep in mind that its not a definitive guide to good code)

You can also go ahead and dive into the more theoretical aspects of computer science.
(https://introtcs.org/public/index.html) seems to be a good wip book only gave it a quick glance though.

from retc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.