View Full Version : Change gamma affects Xserver
Myxir
06-27-2009, 05:38 PM
Hi,
When I want to change the gamma of the game it changes the gamma of the whole xserver. This is quite uncomfortable and pretty useless ;)
Can I change gamma somehow for Regnum only?
Mellion
06-27-2009, 06:58 PM
Hi,
When I want to change the gamma of the game it changes the gamma of the whole xserver. This is quite uncomfortable and pretty useless ;)
Can I change gamma somehow for Regnum only?
Can't wait for that.
onemyndseye
06-27-2009, 07:07 PM
This is not a fix but a workaround.
You could start RO like this:
~/regnum/rolauncher.sh
#!/bin/bash
# Change this value to suit you
RO_GAMMA=1.5
## This stores the video mode of my current desktop so it may be recalled later
## since RO doesnt resize the screen for me on exit.
OLD_VIDMODE="$(xrandr |grep "Screen 0" | awk '{print $8 $9 $10}' |sed '{s|,||}')"
OLD_GAMMA=$(xgamma 2>&1 | awk '{print $3}' |sed '{s|,||}')
## Function to wait until RO was exited
wait_game() {
RO_EXIT="0"
while [ $RO_EXIT = "0" ]
do
TMP1=$(ps -U $USER |grep game |grep -v grep |awk '{print $1}')
if [ -z "$TMP1" ]; then
RO_EXIT=1
fi
sleep 0.5
done
}
# Set gamma
xgamma --gamma "$RO_GAMMA"
./rolauncher
sleep 1
# Wait till RO quits
wait_game
## Clean up and revert to old vidmode
##
## Makes sure previous desktop mode is set
xrandr -s "$OLD_VIDMOD"
xgamma --gamma "$OLD_GAMMA"
exit 0
Nightchill
06-27-2009, 08:11 PM
same problem on windows with gamma
Myxir
06-28-2009, 09:27 AM
This is not a fix but a workaround.
You could start RO like this:
~/regnum/rolauncher.sh
#!/bin/bash
# Change this value to suit you
RO_GAMMA=1.5
## This stores the video mode of my current desktop so it may be recalled later
## since RO doesnt resize the screen for me on exit.
OLD_VIDMODE="$(xrandr |grep "Screen 0" | awk '{print $8 $9 $10}' |sed '{s|,||}')"
OLD_GAMMA=$(xgamma 2>&1 | awk '{print $3}' |sed '{s|,||}')
## Function to wait until RO was exited
wait_game() {
RO_EXIT="0"
while [ $RO_EXIT = "0" ]
do
TMP1=$(ps -U $USER |grep game |grep -v grep |awk '{print $1}')
if [ -z "$TMP1" ]; then
RO_EXIT=1
fi
sleep 0.5
done
}
# Set gamma
xgamma --gamma "$RO_GAMMA"
./rolauncher
sleep 1
# Wait till RO quits
wait_game
## Clean up and revert to old vidmode
##
## Makes sure previous desktop mode is set
xrandr -s "$OLD_VIDMOD"
xgamma --gamma "$OLD_GAMMA"
exit 0
Thanks for your help. I play in windowed mode. I did not try it yet but I think this would not change the gamma of the window since it uses xrandr and xgamma.
But it's awesome that you gave us this script. It could help some users here.
Arafails
07-05-2009, 03:23 AM
This is actually a limitation in the way gamma setting works in X11. You'll notice that most FPS games will change the gamma of the entire display as well.
This is because when you set a gamma value of a given window in X11 is changes the gamma for the whole display while that window's focused (in the case of some display drivers *cough* nvidia *cough*, it will continue to have the same gamma even when the window loses focus). The change is made with a request to the display driver. Changing it for one window only would most likely be a (mostly) unaccelerated procedure.
It might be possible to do this with a postpro shader instead for OpenGL apps. Seems like a bunch of extra work when you're talking about what's normally going to be the foreground application though.
Cheers
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.