Project

General

Profile

Emulator Issues #726

Gamma setting has no effect

Added by zantezuken over 11 years ago. Updated over 2 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
Category:
GFX
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-7151

Description

What steps will reproduce the problem?
1. Start RE1-0 (for example)
2. Go in the Video Settings
3. Try to adjust brightness

What is the expected output? What do you see instead?
Image should be brighter.
Nothing happens.

What version of the product are you using? On what operating system?
r2619 (doesn't matter actually, it's can be r*)


Related issues

Has duplicate Emulator - Emulator Issues #5354: Brightness Setting Broken, Game is too bright (The Last Story)Duplicate

Has duplicate Emulator - Emulator Issues #5379: Brightness control broken in Pandora's TowerDuplicate

History

#2 Updated by TTnickTT over 11 years ago

did you try putting your screen gamma higher or your main gamma from windows/linux/mac.

#3 Updated by zantezuken over 11 years ago

Lol, yes, of course. It was the first thing which i'd tried.
Obvious, isn't?

#4 Updated by omegadox over 11 years ago

  • Status changed from New to Accepted

Prolly doesn't work because this might be something we have to implement. I know
copy EFB on the real HW can apply gamma to the image which we don't do in Dolphin.

#5 Updated by XTra.KrazzY over 11 years ago

  • Status changed from Accepted to Questionable

A little bit of information here:

Copying from the EFB to the XFB can include filtering on the way. Those filters (from
what we know) are only gamma correction.

I don't really know whether this is a feature that we actually need to emulate.

#6 Updated by zantezuken over 11 years ago

Strange question... Dolphin is an emulator, right?
May be I did miss something...

#7 Updated by death2droid over 11 years ago

Yes dolphin is a emulator!

#8 Updated by XTra.KrazzY over 11 years ago

zantezuken: Imagine even MORE lines of code executing between each frame. It can
severely slow down the emulation.

#9 Updated by XTra.KrazzY over 11 years ago

Change your gamma settings inside the GFX card driver, dammit.

#10 Updated by XTra.KrazzY over 11 years ago

  • Status changed from Questionable to Won't fix

#11 Updated by zantezuken over 11 years ago

Great solution. Now we just wait for the times when we NEED to use a hacked GFX
drivers with Dolphin.
Nice way for emulation progress, indeed.

#12 Updated by death2droid over 11 years ago

Why would you need hacked GFX drivers XD
Dolphin runs fine and the Gamma thing isn't even a real problem.

#13 Updated by zantezuken over 11 years ago

You miss the point. I was being sarcastic about emulation way (if we can call that
way an "emulation") of Dolphin.
It is like:
"Why do we need to proper emulate videosystem? Better to change gamma settings in
drivers!"
and more:
"Why do we need to hard work to emulate this and that? Go and buy wii/gc and don't
bother us with your stupid questions!"

#14 Updated by zantezuken about 11 years ago

r3927 convo:

Comment by Sonicadvance1, Yesterday (39 hours ago)
I guess it not working at all is better than it working better, even if it could

cause some problems

Comment by nakeee, Yesterday (37 hours ago)

hacky code is always an issue

Comment by ChaosCode, Yesterday (37 hours ago)
But it works. Its better then what they had. We can use this till someone else does

better.

Nuff said. Looks like we have here a set of "allowed" and "disallowed" hacks.
<3 double standarts and duplicity

#15 Updated by skidau over 8 years ago

  • Status changed from Won't fix to Accepted

#16 Updated by skidau over 8 years ago

issue 5354 has been merged into this issue.

#17 Updated by Sonicadvance1 almost 8 years ago

issue 5379 has been merged into this issue.

#18 Updated by Billiard26 over 7 years ago

  • Issue type set to Bug

#19 Updated by pauldacheez over 7 years ago

I think the issue here is that lack of gamma/brightness emulation hasn't actually caused any major issues in games (and brightness sliders aren't major), so, as cool as accurate emulation is, the devs don't want to implement a feature just to have it slow games down and potentially break other things.

So, I guess we just need to find a game that's actually broken without proper gamma. :P

#20 Updated by degasus over 7 years ago

When does the GC do gamma correction? I don't think it's done in rendering progress, so it isn't importend for any game.
But maybe it's done on efb->xfb, so a game could use it (but I don't think so), but this easy to implement in real xfb.
Next location is XFB to screen blit, so no game is available so see the results. This is also not hard to emulate but not needed at all.

#21 Updated by skidau over 7 years ago

I took a quick look at this a few weeks ago and I think it is performed by BPStructs.cpp in this section:

// ----------------------------------
// Display Copy Filtering Control - GX_SetCopyFilter(u8 aa,u8 sample_pattern[12][2],u8 vf,u8 vfilter[7])
// Fields: Destination, Frame2Field, Gamma, Source
// ----------------------------------
case BPMEM_DISPLAYCOPYFILER:   // if (aa) { use sample_pattern } else { use 666666 }
case BPMEM_DISPLAYCOPYFILER+1: // if (aa) { use sample_pattern } else { use 666666 }
case BPMEM_DISPLAYCOPYFILER+2: // if (aa) { use sample_pattern } else { use 666666 }
case BPMEM_DISPLAYCOPYFILER+3: // if (aa) { use sample_pattern } else { use 666666 }
case BPMEM_COPYFILTER0:        // if (vf) { use vfilter } else { use 595000 }
case BPMEM_COPYFILTER1:        // if (vf) { use vfilter } else { use 000015 }

Specifically the COPYFILTER0 and COPYFILTER1. The next step would have been to write a quick test program on real hardware but I haven't found the time for that.

#22 Updated by NeoBrainX over 7 years ago

Copy filtering is used for antialiasing, only, and irrelevant for gamma correction. As far as I know, the register values are completely ignored unless AA is enabled.

The BPMEM_TRIGGER_EFB_COPY setting has a field for gamma correction; the GC GPU only supports three possible gamma correction coefficients (1.0, 1.7 and 2.2).

#23 Updated by NeoBrainX over 7 years ago

I think I need to correct myself a bit: The DISPLAYCOPYFILTER registers are the ones which are used for AA only; COPYFILTER is likely used for EFB->XFB copies (since vertical stretching is done there). I don't recall having any gamma field in those registers, however.

#24 Updated by skidau over 7 years ago

From what I could see, the Resident Evil games have enabled AA as they allowed a user configurable gamma setting of 0 to 255 (iirc?). I am aware of the three value EFB COPY one though - it isn't used by the game in this issue.

#25 Updated by NeoBrainX over 6 years ago

If that is indeed true, it would be greatly helpful two have a few fifo logs, each recorded in the same scene but with a different gamma setting. Three logs would be sufficient I guess - using the highest setting, the lowest setting and the default setting (or the "medium" setting if default was one of the former two).

CC JMC? :)

#26 Updated by JMC4789 over 6 years ago

I've seen gamma work in other games, but it indeed doesn't function here. fifologs will work for this, then you shall get fifologs.

#28 Updated by phire about 5 years ago

  • Assignee set to phire

It occurs to me that a game could abusing the AA/Deflicker filtering to implement a brightness filter during the EFB to XFB copy. It is intended that games would use filter coefficients that add up to 100%, but if a game was to use coefficients that added up to less than 100% you would get a less-bright image.

I need to test this theory.

#29 Updated by phire about 5 years ago

Confirmed, BPMEM_COPYFILTER0/1 is changing when you adjust the gamma.

#30 Updated by phire over 4 years ago

I've implemented this for video software in PR 3845.

It's been tested and the brightness slider works. A hardware implementation will follow.

#31 Updated by leoetlino over 2 years ago

  • Fixed in set to 5.0-7151
  • Status changed from Accepted to Fixed

Also available in: Atom PDF