Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiimoteEmu: Improve simulated IR point size accuracy. #11152

Merged

Conversation

jordan-woyak
Copy link
Member

The Wii Remote camera data includes a size for each visible IR object.
Previously the simulated "size" was the just the maximum possible value scaled down based on distance from the sensor bar.

I've measured the values that a real wii remote produces at different sensor bar distances and implemented math to simulate it.
image

I don't expect any games to really use this data and I'm sure this differs from remote to remote, but it's an improvement over the previously completely made up number,

Copy link
Contributor

@Pokechu22 Pokechu22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In your graph, some of the values seem to end in .5, but it doesn't stick to those, unlike with whole numbers. Are e.g. the 1.5 numbers cases where one of the points corresponding to one one of the LEDs in the sensor bar reported a value of 1, and the other 2?

Source/Core/Core/HW/WiimoteEmu/Camera.cpp Outdated Show resolved Hide resolved
Source/Core/Core/HW/WiimoteEmu/Camera.cpp Outdated Show resolved Hide resolved
@AdmiralCurtiss
Copy link
Contributor

There's a comment further down

// TODO: does size need to be scaled up?
// E.g. does size 15 cover the entire sensor range?

Is this obsolete now?

@jordan-woyak
Copy link
Member Author

There's a comment further down

// TODO: does size need to be scaled up?
// E.g. does size 15 cover the entire sensor range?

Is this obsolete now?

It's not obsolete. That comment is related to the "Full" IR mode with 36 bytes of data (that no games use).
I haven't done any testing of typical min/max values for a particular "size".

@Pokechu22
Copy link
Contributor

Asking this again (since it seems like you missed it since it was not associated with a line of code but instead as the review summary comment): What does .5 actually mean on the graph, if the sensor value is an integer from 0 to 15? Does 1.5 indicate that one point was 1 and the other was 2?

@jordan-woyak
Copy link
Member Author

Yes, sorry, it's an average. 1.5 indicates one was 1 and the other was 2.

Copy link
Contributor

@AdmiralCurtiss AdmiralCurtiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code's good, but I found this awkward to test because very little of our input data actually affects the distance to the TV in an emulated Wiimote. I had to hack myself in a distance setting to actually verify this works as expected...

@AdmiralCurtiss AdmiralCurtiss merged commit 06f74bd into dolphin-emu:master Oct 13, 2022
11 checks passed
@jordan-woyak jordan-woyak deleted the wm-emu-ir-point-size branch October 13, 2022 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants