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

Divine Divinity Gamma setting gets reset to 1.0 #280

Open
Asdow opened this issue Jan 25, 2024 · 3 comments
Open

Divine Divinity Gamma setting gets reset to 1.0 #280

Asdow opened this issue Jan 25, 2024 · 3 comments

Comments

@Asdow
Copy link

Asdow commented Jan 25, 2024

Pretty much what the title says. When using cnc-ddraw with openGL renderer, adjusting gamma from the ingame settings gets immediately reset back to 1.0 after pressing OK. Does not happen if I launch the game without the wrapper.

@FunkyFr3sh
Copy link
Owner

Yeah, that feature isn't supported yet, only got a few stubs for it right now https://github.com/FunkyFr3sh/cnc-ddraw/blob/master/src/IDirectDraw/IDirectDrawGammaControl.c

Will have to think about a solution for it

@elishacloud
Copy link

Direct3D9 does have gamma controls. But as far as I can tell they only work in exclusive fullscreen mode. This might be a case where shaders are needed.

The same issue happens in d3d8to9 because Direct3D8 allows setting gamma in all modes. Whereas, setting gamma in Direct3D9 only works when in exclusive fullscreen mode.

Last time I checked, WineD3D solved this by using Windows gamma controls. However, that makes the whole screen change gamma, not just the specific window.

I am not sure about the OpenGL renderer, but it may have similar problems.

@FunkyFr3sh
Copy link
Owner

There's now a new shader called "image-adjustment.glsl" included - it will get the job done. Also, latest version can now combine 2 shaders, so you could upscale with one and use image-adjustments as the second shader (rename to same as upscaler and append .pass1)

Not very user friendly yet, but get's the job done. Will try to get a better solution working later

Values that can be changed in "shader-package.zip/shaders/misc/image-adjustment.glsl"


#define ia_overscan_percent_x 0.0  // crop width of image by X%; default is 0.0
#define ia_overscan_percent_y 0.0  // crop height of image by X%; default is 0.0
#define ia_ZOOM 1.0                // zoom factor; default is 1.0
#define ia_XPOS 0.0                // horizontal position modifier; default is 0.0
#define ia_YPOS 0.0                // vertical position modifier; default is 0.0
#define ia_FLIP_HORZ 0.0           // horizontal flip toggle; default is 0.0
#define ia_FLIP_VERT 0.0           // vertical flip toggle; default is 0.0
#define ia_target_gamma 2.2    // the gamma you want the image to have; CRT TVs typically have a gamma of 2.4
#define ia_monitor_gamma 2.2   // gamma setting of your current display; LCD monitors typically have a gamma of 2.2
#define ia_saturation 1.0      // color saturation; default 1.0
#define ia_contrast 1.0        // image contrast; default 1.0
#define ia_luminance 1.0       // image luminance; default 1.0
#define ia_black_level 0.0     // black level; default 0.0
#define ia_bright_boost 0.0    // adds to the total brightness. Negative values decrease it; Use values between 1.0 (totally white) and -1.0 (totally black); default is 0.0
#define ia_R 1.0               // red level; default 1.0
#define ia_G 1.0               // green level; default 1.0
#define ia_B 1.0               // red level; default 1.0
#define ia_TOPMASK 0.0         // mask top of image by X%; default is 0.0
#define ia_BOTMASK 0.0         // mask bottom of image by X%; default is 0.0
#define ia_LMASK 0.0           // mask left of image by X%; default is 0.0
#define ia_RMASK 0.0           // mask right of image by X%; default is 0.0
#define ia_GRAIN_STR 0.0       // grain filter strength; default is 0.0
#define ia_SHARPEN 0.0         // sharpen filter strength; default is 0.0

Latest build:
cnc-ddraw.zip

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

3 participants