Dolphin, the GameCube and Wii emulator - Forums

Full Version: 3D Vision patch (v2 !!)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
I don't like to double post, but that post got long quick and I'm kinda hoping that maybe someone who knows more about Dolphins inner workings can tell me what's going on. There used to be a few problems with internal resolution (the fractional stuff), which I believe were all fixed with the last patch. I figured I'd see just how small I could make the patch and now I'm not sure why it still works.

Just wondering, if skid is around, can you see why this makes 3D work with all of the different internal resolution modes?

Code:
        ComputeDrawRectangle(s_backbuffer_width, s_backbuffer_height, false, &dst_rect);

        if(g_ActiveConfig.bUseRealXFB)
        {
            xScale = 1.0f;
            yScale = 1.0f;
        }
        else
        {
            if(Render3dVision::isEnable3dVision())
            {
                // This works, yet the version in the else doesn't. No idea why.
                xScale = (float)s_backbuffer_width / (float)s_XFB_width;
                yScale = (float)s_backbuffer_height / (float)s_XFB_height;
            }
            else
            {
                xScale = (float)(dst_rect.right - dst_rect.left) / (float)s_XFB_width;
                yScale = (float)(dst_rect.bottom - dst_rect.top) / (float)s_XFB_height;
            }
        }

Without this change, the 3D Vision gets disabled whenever fractional/integral are used, but shouldn't "s_backbuffer_width / s_XFB_width" give the exact same answer as "(dst_rect.right - dst_rect.left) / s_XFB_width"? I've got the feeling that I'm making an embarrassing newbie mistake, or that I'm setting some weird random number for the scale... but it looks fine in the games I've tried.
(11-05-2010, 12:49 PM)Uhyve Wrote: [ -> ]Without this change, the 3D Vision gets disabled whenever fractional/integral are used, but shouldn't "s_backbuffer_width / s_XFB_width" give the exact same answer as "(dst_rect.right - dst_rect.left) / s_XFB_width"? I've got the feeling that I'm making an embarrassing newbie mistake, or that I'm setting some weird random number for the scale... but it looks fine in the games I've tried.

dst_rect is the result of ComputeDrawRectangle a few lines preceding. Not sure why 3d vision won't work with dst_rect though. I am going to commit the code in v4. I have moved the checkbox to the enhancements tab above the other 3d option as their functions are related.
Well hello again everyone. I checked back into how Dolphin is doing because I want to play Goldeneye that I just bought. I'm ripping it right now to play. Good work everyone getting 3d vision so much attention. I'm glad to see that my patch has made it into the trunk. I was quite surprised to see enable 3d vision in there without me compiling my fixes into the code. Awesome work everyone, too bad it still crashes horribly, but that is what it did in the old version that most of that code comes from. I didn't really write anything I just patched in a renderer from version 3000 something and put in an if statement to pick which one to use. I then just force the window to be fullscreen. That is why it crashes and you have to turn on background input, because as soon as that fullscreen window gets focus it crashes the program. This is really weird because I know you can make fullscreen 3d windows with wxWidgets. I do it all the time at work.

Anyway this is the true way open source should work. Good work everyone I need to go take a look at the code, it appears you guys made it much cleaner than the hacky job that I did Smile
(11-04-2010, 08:26 AM)fabbex Wrote: [ -> ]hmm..but it seems it doesnt even respond to keyboard because u dont see any connect / disconnect text when push alt +f6

*facepalm*
I just realised why that's happening. None of the keyboard shortcuts are working. Dolphin doesn't seem to check to see if background input is enabled in the plugins when looking to see if a shortcut is being used. That's why I thought screenshots weren't working, that might work fine in fact. I'll have a little look tonight to see if I can confirm, who knows, maybe I'll figure out a fix. Edit 1: Looking into it. Dolphin gathers inputs using a window message loop, I'm not sure if that would care whether or not the window is in focus. Edit 2: It does seem to care. As Skid guessed, it does seem like it's something to do with it being a WS_POPUP window, which seems to handle the Window Message loop differently. Not sure I'm up to the task with this unfortunately, I've trying to figure it out for hours.

(11-07-2010, 03:22 AM)threax Wrote: [ -> ]That is why it crashes and you have to turn on background input, because as soon as that fullscreen window gets focus it crashes the program. This is really weird because I know you can make fullscreen 3d windows with wxWidgets. I do it all the time at work.

Huh, that's got to be fixable. I mean, I'd be fine with needing background input enabled if the window could handle being clicked on.


Edit 1: Yay, you can use the mouse now, shouldn't effect anything when 3D Vision is disabled. Also, I cleaned up the code a bunch. The problem of it not registering keyboard inputs (for Dolphin shortcut commands) is still there, not quite sure where the problem is, that's next on my list though.
Link.

Edit 2: Oops, forgot to delete something. Last version won't compile. New Link.
ector gave you access to the svn repository so now you can commit the patch yourself.

lks92

(10-20-2010, 07:39 PM)Uhyve Wrote: [ -> ]Some people seemed to be wanting a newer revision compiled so:

Dolphin 3D 32bit (r6294)
Dolphin 3D 64bit (r6294)

Thank you very much!
For this I long waited for...
(However, it was hard to find that Version in this many posts.)

Edit: I'm using the above version now, but I have a problem:
Every time I use the new function in Options -> Graphics Settings -> Advanced -> Enable 3D Vision, the Emulator stops when I click with left or right mouse button. An error occours: "Device lost", and when I click OK, it says "Failed to create D3D vertex declaration"! I've tried many different settings, but it's always the same.
[color=#FF4500]Please Help!!![/color]

Adr990

Sweet, I'm gonna try it out.

Hopefully this one works for me. hehe
(11-21-2010, 07:20 AM)lks92 Wrote: [ -> ]Edit: I'm using the above version now, but I have a problem:
Every time I use the new function in Options -> Graphics Settings -> Advanced -> Enable 3D Vision, the Emulator stops when I click with left or right mouse button. An error occours: "Device lost", and when I click OK, it says "Failed to create D3D vertex declaration"! I've tried many different settings, but it's always the same.
[color=#FF4500]Please Help!!![/color]

Yeah, that was an old problem. I committed the fix for that a while back to the main SVN builds. Though there was an update which disabled 3D Vision. I dunno if it has been added back yet, I'll have a check and add it again if it's not.

Edit: You can still activate 3D Vision in the latest SVN build by setting 3DVision to true in user/config/gfx_dx9.ini.
Edit 2: Or just download any SVN build r6474 onwards.

theironman12


Edit: You can still activate 3D Vision in the latest SVN build by setting 3DVision to true in user/config/gfx_dx9.ini.
Edit 2: Or just download any SVN build r6474 onwards.
[/quote]

Using the later builds with 3d enabled, none of the keys, but am able to move mouse without crashing.
With 3d off in the settings menu, the keys config work again.
Dont know why.....
You need to enable "background input" in the input plugins. It's a problem with how the window is made when using 3D mode.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18