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

Mangohud and SDL games #122

Closed
joan31 opened this issue Dec 20, 2022 · 2 comments
Closed

Mangohud and SDL games #122

joan31 opened this issue Dec 20, 2022 · 2 comments

Comments

@joan31
Copy link

joan31 commented Dec 20, 2022

Hi,

OBS-VKCAPTURE works fine, but Mangohud does not appear...

For example I try this with CS GO :

obs-gamecapture VK_ADD_LAYER_PATH=/usr/share/vulkan/implicit_layer.d VK_LOADER_LAYERS_ENABLE=VK_LAYER_OBS_vkcapture_64,VK_LAYER_MANGOHUD_overlay mangohud %command% -vulkan

The gamecapture work, but without mangohud in obs...

I try with an Opengl and SDL games like the old counter strike 1.6

obs-gamecapture mangohud %command%

The game appear on OBS but mango hud not.

However, with Apex Legend, all work like a charm :)

@joan31
Copy link
Author

joan31 commented Dec 21, 2022

I've modified the "obs-gamecapture" script (really I created the same name of this script but on my .local/bin/) to this :

#!/bin/sh
# VK layers (MangoHUD workaround) for VK_Capture OBS function 

if [ "$#" -eq 0 ]; then
    programname=`basename "$0"`
    echo "ERROR: No program supplied"
    echo
    echo "Usage: $programname <program>"
    exit 1
fi

exec env LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}/usr/\$LIB" \
    LD_PRELOAD="${LD_PRELOAD}${LD_PRELOAD:+:}libobs_glcapture.so" \
    OBS_VKCAPTURE=1 \
    VK_ADD_LAYER_PATH="/usr/share/vulkan/implicit_layer.d" \
    VK_LOADER_LAYERS_ENABLE="VK_LAYER_OBS_vkcapture_*" \
    "$@"

As you can see, I added this two environment variable :

VK_ADD_LAYER_PATH="/usr/share/vulkan/implicit_layer.d"
VK_LOADER_LAYERS_ENABLE="VK_LAYER_OBS_vkcapture_*"

So I use it on steam option launcher :

obs-gamecapture mangohud SDL_VIDEODRIVER=x11 %command% -vulkan

(SDL_VIDEODRIVER=x11 it is because I'm on wayland but CSGO need to bee launch on xwayland).

So this solution work for all games using vulkan (CS GO too). I can see in the obs the game and mangohud.

But, for opengl games, the problem is still here. Game is captured, steam overlay too, but not mangohud.

@nowrep
Copy link
Owner

nowrep commented Jan 11, 2023

As you can see in #14 it depends on the order of loaded layers (eg. vkcapture needs to be loaded last to be able to capture what the layers "before" it rendered).

@nowrep nowrep closed this as completed Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants