Go Back   Champions of Regnum > English > Technical Support > Linux

Linux Technical issues under Linux platform

Reply
 
Thread Tools Display Modes
Old 06-27-2009, 05:38 PM   #1
Myxir
Count
 
Myxir's Avatar
 
Join Date: Mar 2007
Location: Germany
Posts: 1,164
Myxir is on a distinguished road
Default Change gamma affects Xserver

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?
__________________
French Warriors of Syrtis: Nessa Telrunya (Hunter) - Myxir (Warlock) - Estra (Conjurer)
In War it does not matter who is right, but who is left.
Myxir no ha iniciado sesión   Reply With Quote
Old 06-27-2009, 06:58 PM   #2
Mellion
Banned
 
Join Date: Jun 2007
Location: Germany
Posts: 288
Mellion is on a distinguished road
Default

Quote:
Originally Posted by Myxir View Post
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.
Mellion no ha iniciado sesión   Reply With Quote
Old 06-27-2009, 07:07 PM   #3
onemyndseye
Master
 
onemyndseye's Avatar
 
Join Date: Jul 2008
Location: South Central USA
Posts: 260
onemyndseye is on a distinguished road
Default

This is not a fix but a workaround.


You could start RO like this:

~/regnum/rolauncher.sh
Code:
#!/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
__________________
RA/Syrtis Hunter LVL50: Elusis
RA/Syrtis Barba LVL50: Artemisia
RA/Syrtis Conju Lvl45: Nellas Miriel
onemyndseye no ha iniciado sesión   Reply With Quote
Old 06-27-2009, 08:11 PM   #4
Nightchill
Banned
 
Join Date: Jul 2008
Posts: 433
Nightchill is on a distinguished road
Default

same problem on windows with gamma
Nightchill no ha iniciado sesión   Reply With Quote
Old 06-28-2009, 09:27 AM   #5
Myxir
Count
 
Myxir's Avatar
 
Join Date: Mar 2007
Location: Germany
Posts: 1,164
Myxir is on a distinguished road
Default

Quote:
Originally Posted by onemyndseye View Post
This is not a fix but a workaround.


You could start RO like this:

~/regnum/rolauncher.sh
Code:
#!/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.
__________________
French Warriors of Syrtis: Nessa Telrunya (Hunter) - Myxir (Warlock) - Estra (Conjurer)
In War it does not matter who is right, but who is left.
Myxir no ha iniciado sesión   Reply With Quote
Old 07-05-2009, 03:23 AM   #6
Arafails
Baron
 
Arafails's Avatar
 
Join Date: Nov 2007
Location: Not where it looks like, to either of us.
Posts: 706
Arafails will become famous soon enough
Default

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
__________________
If you can't detect sarcasm yourself, please pay attention when it's pointed out to you.
Arathael :: Wyrd Sceote :: Gwn M'gerSoul Taker, Imperial Guard of Ignis
Arafails no ha iniciado sesión   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:29 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
NGD Studios 2002-2024 © All rights reserved