viro icon indicating copy to clipboard operation
viro copied to clipboard

Chroma key filtering is useless

Open ramicaza opened this issue 3 years ago • 7 comments

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: iOS any useable version
  3. Version: ViroReact version 2.21.1, RN Version 0.64.2
  4. Device(s): physical iPhone

Description

The chroma key filtering is useless, the range of colors it filters is far far too wide. Yes I've tried green, blue AND red screens. I've dug through the code of ViroCore to find the issue and it's in line 902 of VROShaderFactory.cpp.

chroma_threshold_sensitivity is set to a hardcoded value of 0.4 and ideally this is variable from the JS API but at the minimum this should be set to a more reasonable default.

This issue is compounded by the fact the documentation on how to build the whole library is minimal and out of date. I'm sure this project would get an influx of community support if there were some simple dev build instructions!

Update: I've built the library from scratch and confirmed that changing the aforementioned line to a lower value (0.1) does the trick. Issue still stands.

Reproducible Demo

Insert a green/blue/red screen video into AR using ViroReact and observe that too many colors are filtered out.

ramicaza avatar Jan 08 '22 20:01 ramicaza

@ramicaza is there a corresponding issue in virocore you could link?

robertjcolley avatar Jan 20 '22 21:01 robertjcolley

Actually, in PR 63 (not yet merged) I changed the chroma_threshold_sensitivity to a more reasonable default. Would you like me to open an issue over there to address the fact that the value is not settable from the JS API?

ramicaza avatar Jan 21 '22 22:01 ramicaza

@ramicaza I think so. The ViroCore API should expose getters and setters for that. The JS layer is entirely in ViroReact, so there is no need to include any mention of JS in ViroCore.

What will need to happen is:

  1. ViroCore needs to add getters and setters
  2. ViroReact implements (with ViroCore and bridging functions) the getters and setters in ViroReact.

robertjcolley avatar Jan 21 '22 23:01 robertjcolley

@ramicaza PR #63 was merged - should this be closed? or should this be updated to reflect the Feature Request to add a react means of updating this value?

robertjcolley avatar Jan 31 '22 20:01 robertjcolley

@ramicaza thanks for your contribution to this project ! Can you please tell us what to do with this ?

@ramicaza PR #63 was merged - should this be closed? or should this be updated to reflect the Feature Request to add a react means of updating this value?

SamiChab avatar May 31 '22 00:05 SamiChab

Hello is there a way to change the value chroma_threshold_sensitivity through ViroReact?

I need to play with it in order to remove the border color around the character.

gokugen avatar Aug 05 '22 00:08 gokugen

@ramicaza does your PR solve the situation that @gokugen mentioned? I happen to have the same issue.

andresteves avatar May 22 '23 14:05 andresteves