-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
[Working] Green Screen Chroma Key Passthrough - Enable OpenXR #1881
base: master
Are you sure you want to change the base?
Conversation
If anyone is able to help me make the passthrough appear over the video stream, even just setting alpha to zero doesn't seem to work. I tried changing all the GLSL shaders to set .a = 0.0 to no avail. Tried various GL clear flags etc. Once that works I can write code to toggle it as well as chroma key GLSL code. I just can't seem to make it pass through however. |
I believe you will have to set the alpha channel == 0 for every shader in the compositor. The reason I haven't implemented passthrough yet is because I wanted to rewrite the client compositor since the current OpenGL one is pretty messy. |
It's best to use an epsilon when comparing floats btw or alpha < 0.01. If I understand what you're trying to do here zarik |
@zarik5 I tried that all the glsl I could find and set |
@beiller There are a few shaders: gamma correction, FFR, and one last one to split the image between the two eyes. To be honest the code is very old and quite bad, I can't help you much further unless I dig into that more. |
Thanks for your comments @zarik5 I will try it out. I will think on it some more because I feel there is something higher level than GLSL that is setting the alpha blending. |
It's useful to disable/bypass some code temporarily, for debug purposes. for example in the shader to render to the final swapchains, discard the texture values and always set (0, 0, 0, 0). |
9644be2
to
92e4791
Compare
@beiller, instead of writing raw ffi code in ALVR itslef, are you able to add the passthrough bindings to our openxrs fork? Or you can submit the bindings upstream, Ralith could help you making sure the styling of the code is consistent. |
b5db426
to
9cfd449
Compare
Hey @zarik5 the good news is I don't need all that I guess I was just using it to debug. I have a new working implementation obviously missing a lot and is hard-coded to chromakey green currently. Maybe we can turn it into a feature somehow. |
Need way to toggle and maybe some small cleanup before this could ever be considered.
|
nah not really just search for err or error |
From what i can tell, it compiled shaders just fine and runtime recognized passthrough
|
fb_passthrough is available and being used |
Ah so it is just black where the passthrough should be seen? That is at least "working". If the shader has issue the app just crashes :) I did hack around with it until it works so I think there may be something missing in the code. I can try experimenting with some things if you can help test pico 4. |
Sure thing, i can test it of course |
OK maybe it is caused by |
@Meister1593 I found maybe an issue, the features aren't properly returned. Can you try compiling with this commit and let me know? I think I may have had a different build on my device. With the "if" statements uncommented I got similar black screen behavior that you see. |
just tried, nothing changed, exactly the same thing
|
From brief discussion in the server i've changed layer mode from OPAQUE to ALPHA_BLEND and it started to work. |
d01478e
to
005c4c7
Compare
005f954
to
02320ea
Compare
I just tried this PR with the latest master. Works great, but I had to manually merge graphics.cpp. I just have a major flaw: If the application running in SteamVR is dropping frames (e.g late start frames), the frame gets cleared to paththrough and the rendered content starts to flicker. |
I attempted to add green screen pass-through, and got stuck trying to get the pass-through to be "over top" the "video stream". If I move my head real fast I can see the pass-through in the lags that the video is not covering so I think it's progress.