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

Retro rendering style broken on MacBookAir6,2 #29

Closed
isrob opened this issue Oct 12, 2013 · 23 comments
Closed

Retro rendering style broken on MacBookAir6,2 #29

isrob opened this issue Oct 12, 2013 · 23 comments
Assignees

Comments

@isrob
Copy link

isrob commented Oct 12, 2013

I'm on a MacBookAir6,2 running OS X 10.9 and in Privateer (GOG version) the choice of 'Rendering style: Retro' results in a black screen (music continues, no crash, just no visible graphics).

Let me know what further info would be helpful.

@alinebee
Copy link
Owner

Does this also occur with the "Smoove" rendering mode? And do you have any other Boxer-wrapped GOG apps to test this rendering mode out with?

@isrob
Copy link
Author

isrob commented Oct 12, 2013

Smoove works. Blank screen also on Worlds of Ultima: The Savage Empire.

@alinebee
Copy link
Owner

Interesting that Smoove works and Retro doesn't - that implies a shader-specific bug.

This probably isn't a 10.9 issue per se, as Retro works fine in 10.9 on my MacbookAir3,2. It's more likely to be related to your Macbook model's graphics hardware (though it's possible they also broke something in 10.9's drivers for it.)

What graphics chipset does the Macbook have? And did you try playing these games on the same Macbook on an earlier version of OS X?

@isrob
Copy link
Author

isrob commented Oct 12, 2013

This model has Intel HD Graphics 5000, 1024 MB. Unfortunately I didn't play the GOG variant of the game pre-10.9.

@alinebee
Copy link
Owner

Could you test if this alpha build of Boxer 2.0 exhibits the blank-screen problem in Retro mode also:

https://www.dropbox.com/s/xavh9eewut7p6u8/boxer-2.0alpha-20131012.1.zip

This bug won't be game-specific, so you can just test with a DOS prompt.

(Note that if you have an existing copy of Boxer 1.3.2, I do not recommend replacing it with this version - there's a great deal that is missing or broken in alpha currently.)

@isrob
Copy link
Author

isrob commented Oct 12, 2013

Confirmed problem still occurring in 2.0alpha.

@alinebee
Copy link
Owner

OK, this means a fun round of Working Out Why Someone Else's Shader Code Is Broken On A Chipset I Don't Have!

Are you able to build Boxer from source / do you know your way around a GLSL shader definition? If so, I can suggest individual code changes for you to try. If not, then I'll try do speculative changes myself and upload a new build for you to try.

@isrob
Copy link
Author

isrob commented Oct 12, 2013

You mean WOWSESCIBOACIDH isn't your favourite activity in the whole world? ;)

I have Xcode but I must confess I use it mostly for iOS Simulator (web dev) - compiling from source I receive the following issue in two separate files:
'Property 'fileSystemRepresentation' not found on object of type 'NSURL *''

@alinebee
Copy link
Owner

On the contrary, I've been looking forward to another round of it all summer!

OK, the first thing you could try is to open Resources -> Shaders -> crt-geom-interlaced-curved.shader (this is the shader for the Retro rendering style), and find-replace the following text:
const vec2 angle = vec2(0.0,0.001);
with this:
const vec2 angle = vec2(0.001,0.001);

Then recompile Boxer and run it from within XCode.

Also note that if the shader fails to load altogether, it should display a message in XCode's debug output panel - this might reveal a chipset-specific error in your case.

(The filesystemRepresentation warning is just a red herring and can be safely ignored.)

@isrob
Copy link
Author

isrob commented Oct 12, 2013

Forgive me, how do I get past the fileSystemRepresentation issue? The build is failing because of it.

@alinebee
Copy link
Owner

Ah, sorry, didn't realise it was an error rather than a warning. I've fixed it now, so if you pull again it should build properly.

@isrob
Copy link
Author

isrob commented Oct 12, 2013

Just seen your commit - I'm on OS X 10.9, Xcode 5.0 and error remains after pulling latest.

@isrob
Copy link
Author

isrob commented Oct 12, 2013

Ah - typo, ADBForwardCompatibility.h - fileSystemRepresentation not filesystemRepresentation. Compiles now.

@isrob
Copy link
Author

isrob commented Oct 12, 2013

OK, shader modification you suggested didn't appear to change anything. Debug panel shows nothing out of the ordinary.

@alinebee
Copy link
Owner

OK, the fileSystemRepresentation typo is now fixed. I'll take a closer look through the shader code and give you some more suggestions to try later this week.

Just to confirm: you get the blank screen regardless of whether Boxer is windowed or fullscreen, right?

@isrob
Copy link
Author

isrob commented Oct 14, 2013

Confirmed.

@ghost ghost assigned alinebee Oct 14, 2013
@geornov
Copy link

geornov commented Nov 22, 2014

Hi, I'm having the same problem with a black screen on a Late 2012 MacBook Pro with an Intel HD 4000 video card.

Not sure why, but the problem seems to disappear if I change line 68 in shader's code from

float D = d/R + x*cosangle.x*cosangle.y+dot(uv,sinangle);
to
float D = d/R + x*cosangle.x*cosangle.y;

At least it seems to work and look fine after that.

@alinebee
Copy link
Owner

Thanks for poking around with the shader! I took some screenshots before and after the change and the results are visually completely identical, so I've committed the change but won't mark this issue as fixed until I have some more corroboration (Rob?)

What led you to try removing that particular part, by the way? To be honest I can't follow what that part of the shader is even meant to be doing, and I write games for a living. This Is Why We Comment Our Code, People.

@geornov
Copy link

geornov commented Nov 23, 2014

I noticed that the black screen happens only if the CURVATURE macro is defined (it's defined by default). This macro changes only one line in the shader, which calls the transform function.

After that I started to comment out different pieces of code inside the transform function. The problem was with the stretch variable. The variable was initialized with a maxscale function call, which led me to a fwtrans call, and later to the dot product.

Sadly, I have no idea what the dot product is supposed to do exactly and why it causes the problem. I tried to look deeper, but without success, and decided to stop, since the problem was seemingly fixed.

@ciathyza
Copy link

ciathyza commented Feb 6, 2016

I know topic is old but the bug still persists on games purchased on GOG.com. Is there any way to address this issue (without having to recompile Boxer/etc.)? I, too, have a Macbook Pro 2013 with Intel HD Graphics 4000. Retro shader results in black screen. Can anyone post a screenshot of how the retro shader looks? Of what I read is that it looks really good (better than scanlines in Boxer standalone)?

@alinebee
Copy link
Owner

alinebee commented Feb 7, 2016

A quick fix would be to copy the fixed shader file into one of the GOG apps you have. The necessary file is here:
https://raw.githubusercontent.com/alunbestor/Boxer/master/Resources/Shaders/crt-geom-interlaced-curved.shader

(Github makes it awkward to just straight-up download files, so in Safari: right-click on the link above and choose "Download linked file", then rename the resulting file's extension from ".shader.txt" to just ".shader".)

Once you've downloaded it, right-click on a GOG game in Finder and choose "Show Package Contents". Browse to Contents/Resources/Shaders/ and replace the file in there with the new one.

Let me know if the shader works correctly for you!

@ciathyza
Copy link

ciathyza commented Feb 8, 2016

that did the trick, thanks! I had the impression the shader needs to be compiled but that's not the case.

The monitor curving is a bit exaggerated on the Retro shader, though. Do you know which values to change to reduce this? I changed R which seems to do that but the graphics then seem to extend outside the visible screen area.

@alinebee
Copy link
Owner

alinebee commented Feb 8, 2016

Smaller R values should reduce the curvature, kinda surprised it makes it extend further outside the frame. You could try lowering the overscan amounts as well to compensate; or increase d, the distance-of-viewer-to-screen, which should flatten the perspective but might have further knock-on effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants