Giter VIP home page Giter VIP logo

Comments (13)

dcerisano avatar dcerisano commented on August 15, 2024 1

You can try the above values yourself to verify the tweening requires little endian notation

eg. compare:
msi-rgb FCA84210 FCA84210 FCA84210 Aliased glitchy fade.
to:
msi-rgb CF8A2401 CF8A2401 CF8A2401 Perfectly smooth fade!

And the OP was very correct this is NOT in the docs, and yet is essential to designing effects properly with msi-rgb.

from msi-rgb.

nagisa avatar nagisa commented on August 15, 2024

The problem with this tool’s interface is that it exposes the hardware with least amount of sugar on top of it as possible. That means that the colour specifiers, for example, do not exactly specify a single colour, but rather four of them.

So something like

.../msi-rgb AABBCCDD 00112233 44556677

ends up showing colours #AA0044, #BB1155, #CC2266 and #DD3377 in sequence: i.e. the colour matrix is transposed. It is easy to see if written as a table:

1 2 3 4
R AA BB CC DD
G 00 11 22 33
B 44 55 66 77

transposed:

R G B
1 AA 00 44 #aa0044
2 BB 11 55 #bb1155
3 CC 22 66 #cc2266
4 DD 33 77 #dd3377

Documentation would be much appreciated. If you need help figuring anything out, ping me and we'll figure it out!

from msi-rgb.

willpiam avatar willpiam commented on August 15, 2024

Okay. Good to know.

If you need help figuring anything out, ping me and we'll figure it out!

Will do! Thank You!

from msi-rgb.

YakoYakoYokuYoku avatar YakoYakoYokuYoku commented on August 15, 2024

We can open a pull request if we need it 🐎

from msi-rgb.

dcerisano avatar dcerisano commented on August 15, 2024

@nagisa I notice you are using symmetric tweening values in your example
eg. AA BB CC DD 00 11 22 33, etc.

The SIO chip uses reverse endianity, so symmetric values always give the right tweening, but limits the number of tweens to 4 instead of 8.
To set tweens in correct order, use little endian notation.

Eg.
A0 ==> 0A
13 ==> 31
02 ==> 20

Note that these values are per RGB channel, so they represent brightness of the channel at a given tweening step (of which there are 8, one of 16 possible levels per step).

Also as an aside, I was able to double the colour depth by including half refresh rates which doubles the colour depth without any flicker. This gives much smoother fades and transitions (the default is rather crude and aliased).

I shall submit a pull request with the improved color mapping algorithm at some point.

from msi-rgb.

ixjf avatar ixjf commented on August 15, 2024

What do you mean by "limits the number of colors to symmetric values"? Isn't the range the same - from 0x00 to 0xFF? Even if it were setting the wrong colour, 0xA0 yields a very different colour from 0x0A. Wouldn't it be obvious that it was wrong?

from msi-rgb.

willpiam avatar willpiam commented on August 15, 2024

from msi-rgb.

dcerisano avatar dcerisano commented on August 15, 2024

The context is that the reversed endianity issue is not mentioned in the docs, and is obvious to anyone that has actually tried to get specific tweening out of msi-rgb.

It should be modified to allow big-endian values to be passed rather than forcing users to pass little-endian (reversed) values. Obviously symmetrical values (00, 11, 22 .. FF) are exempt from this issue. At least the help output should mention this.

BTW all x86-based operating systems are little-endian. This boundary issue regularly bit me back when I developed on Sunmicro's Solaris (previous SPARC CPUs were big-endian; don't know what Fujitsu plans to do in upcoming generations).

from msi-rgb.

ixjf avatar ixjf commented on August 15, 2024

Works fine here. Byte order is not the issue. Do note that there are 8 different colours, not 4. Each nibble is a different colour.

from msi-rgb.

dcerisano avatar dcerisano commented on August 15, 2024

The four byte value for each colour channel (RGB) represents 8 tweening steps (one of 16 levels of brightness possible at each step).

You are getting the wrong tweening if you don't reverse the endianity. That means switching the nibble order of individual bytes (2F --> F2), not the bit order.

So a smooth fade to black on a given channel:
FC A8 42 10
becomes:
CF 8A 24 01

Without this your fades will look aliased (glitchy - not smooth).

It is a fine point and easy to miss, but my OCD would not rest until I figured this out.

from msi-rgb.

ixjf avatar ixjf commented on August 15, 2024

So do you have a demo of that?

from msi-rgb.

ixjf avatar ixjf commented on August 15, 2024

That's... interesting. I actually had seen the pattern and had documented it but genuinely thought someone just decided to use weird patterns.

from msi-rgb.

dcerisano avatar dcerisano commented on August 15, 2024

Things get weird this close to the metal. Esp. when the metal is an undocumented proprietary SIO chip.

from msi-rgb.

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.