ID:2085297
 
Resolved
BYOND Version:509
Operating System:Windows 7 Home Basic
Web Browser:Firefox 46.0
Applies to:Dream Seeker
Status: Resolved

This issue has been resolved.
Descriptive Problem Summary: Lighting in Goonstation is broken to me, it only shows a rainbow overlay over every tile. (http://i.imgur.com/bff1GhA.jpg)

I have tried:

- updating my graphics driver
- getting the Direct X 11 and Direct X End User
- toggling "use graphics hardware for displaying maps" a few good times
- upgrading to the latest 510

I am using a T400 Thinkpad, with the Intel Integrated Graphics 4500MHD. Maybe it got too old for BYOND?
The rainbow overlay means your graphics card is, for whatever reason, doing something very wrong with the shaders. There's another report on this same issue in another thread.
Is there something I can do to fix it?
I'm not aware of anything that would fix it, unless there's something wrong with the shader code that I'm not understanding. I'll keep looking, though.

This issue appears to be fairly Google-proof; all I've found is suggestions on how to debug the shader, but that's useless unless it's being done on a machine that has the problem, with the shader being compiled in software emulation mode for debugging.
Lummox put a bug in my ear over this issue. Have you attempted to update your Intel graphics drivers to the latest version?

He showed me the shader code, and I did some googling of my own, and it's entirely possible that what's happening is that the shaders are failing due to an old bug in the drivers for your Intel graphics accelerator. Apparently they struggle with shadermodel 2.0 support even though they support up to 3.0 and 4.0 on most of their later models.

Intel's knowledgebase says that this issue has been resolved in a later driver package, so try updating those drivers and see if the issue persists.

Otherwise, there might be an issue where the shader pass information isn't being accepted properly and the shader is falling back. That should prevent rendering though. You should get a black screen if that's the case, so it would take further research to figure that out and the Intel knowledge center is on maintenance mode right now.

https://downloadcenter.intel.com/product/81503/ Intel-HD-Graphics-for-Intel-Core-Processors

^Get yer drivers here, bub.
I'm not using Intel HD Graphics but an even older integrated graphics card. Driver's up to date.

I have just tested http://www.byond.com/developer/Nadrew/LightingTest and it worked fine, thought, seems like it is specific to Goon's lighting.
Nadrew's lighting test probably uses planes. Goon's lighting uses color matrices.

I get the same thing, also on an Intel GPU, but a newer one: HD4600. IIRC, if I ran BYOND on my discrete Nvidia card, I got a black screen instead.
Right, it's the fact of the matrix that's throwing your video card off. The lighting stuff in 510 doesn't need shaders, but color matrices do.

From what I can tell, your card is taking the matrix variable in the shader and using row by row of that as four different color values for the vertices in each displayed quad. The vertex shader isn't supposed to do anything to the vertex color, and yet on your card it is. The way I see it, either I overlooked something really fundamental when I wrote the shader--something that as far as I can tell, other shaders don't do either--or there's something very wrong with your card or driver. Or it could be something in between.
Can you run dxdiag (open the run prompt and type dxdiag), and take a screenshot of the system and display tabs?

I'm confused as to what onboard graphics you are running. If you aren't running the IGA4500, I'm deeply confused as to what you are actually running.

Showing the dxdiag would help me to figure out how to make better assumptions.
@Lummox JR

Can you recommend some BYOND friendly graphics cards to me, then? I don't really do any gaming other than BYOND, but I think I can spare a few moneys for a computer which runs SS13 properly.

@Ter13

http://i.imgur.com/0W2p6F6.jpg

Here it is.
Can you recommend some BYOND friendly graphics cards to me, then? I don't really do any gaming other than BYOND, but I think I can spare a few moneys for a computer which runs SS13 properly.

http://pcpartpicker.com/p/nFCRNG

Modify to your heart's content. That build won't be terribly powerful, but you should be able to handle most modern games at 30fps. It'll be overkill for anything BYOND related.

<$700 after rebate including monitor, OS, case, thermal paste, and fairly crappy KB&M combo.

The reason I went for 16GB memory is because you get better performance on dual-channel. The price of springing for 2 8GB sticks is more than worth the performance bump you are going to get out of it.

That i3-4150 is a cheap CPU, but it outperforms anything in its price range ATM. The Mobo is not going to take kindly to any kind of an SLI setup owing to the single PCIx16 slot.

You can save yourself $100 (Bringing price to $588) if you don't bother buying an OS and find other means of going about that.

If you've never built a machine before, don't panic. Youtube. It's like legos and about as expensive.


EDIT: Also, yeah, your Onboard graphics have reached end of service lifetime. If it's not a problem with the shader, it's not gonna get fixed by Intel.
In response to Lummox JR
In this particular case it's more like the matrix isn't even being applied; the way Goon's lighting works is by having each of the corners of the square assigned a color channel (RGBA), and using color matrices to multiply that channel into an overlay. That multiplication isn't happening, so we see the raw texture rather than the intended smooth lighting transitions.
Hrm, I'd have to see the lighting code to know what you mean there.
In response to Ter13
Althought food sure is cheap in the jungle and I like the tropical climate, getting $700 and building this computer would take me four months of working and not spending a single cent. Won't a slightly better notebook with an Intel HD Graphics 3000/4000 or a computer with the GT 720 graphics card do it? :B
In response to Lummox JR
Lummox JR wrote:
Hrm, I'd have to see the lighting code to know what you mean there.

I'll whip up a demo some time today, it won't be pretty but it'll show the problem.
Demo: http://gn32.uk/f/goon-lighting-demo.zip
Expected: http://nyx.gn32.uk/i/2016-05-18_08-54-11.png
Actual in HW mode: http://nyx.gn32.uk/i/2016-05-18_08-54-25.png

Goon uses a smoother texture than this and uses overlays in BLEND_MULTIPLY, but it's the same principle; the output should be monochrome squares, half a turf offset from the grid in both directions (ie centered on the corners).

// test.dme - this is in the zip above, sans comments
/world
maxx = 10
maxy = 10

// This bit is so the corners that touch have the same brightness; this isn't particularly relevant to the bug; all that matters is that this function returns a float in [0,1)
/var/list/tbright[11]
/proc/get(x,y)
if(!tbright[x])
var/list/L[11]
tbright[x] = L

if(isnull(tbright[x][y]))
tbright[x][y] = rand()

return tbright[x][y]

/turf
icon = 'corners.png' // Red top left, green bottom left, blue top right, transparent bottom right
New()
..()
var
g = get(x, y) // Green channel to output
r = get(x, y+1) // Red channel to output
b = get(x+1, y+1) // Blue channel to output
a = get(x+1, y) // *Transparency* channel to output

color = list(
r, r, r, 1, // r_rgba
g, g, g, 1, // g_rgba
b, b, b, 1, // b_rgba
-a, -a, -a, 1, // *subtract* the alpha, since alpha is present where the texture is *not* transparent
a, a, a, 1 // add it everywhere, then take it away again where there's alpha
)
Okay, this clears up a big point of confusion for me. What I didn't realize was that the rainbows were an intentional part of Goon's lighting, and that the point all along was to simply replace those colors with the appropriate light values at the corners.

So it isn't that the vertex shader is malfunctioning in a specific way--it's that your card is having some kind of issue with the shader in general and not using it at all.

This is actually a really important clue. For this I would recommend you download the DirectX SDK (June 2010) and use PIX to run Dream Seeker on your demo, after configuring PIX to catch everything from the first few frames. From that point you should be able to look at the output and find where the shader was compiled, and that should tell you whether there was some kind of error in the compilation.

I'm adding something to the next release that will output a debug message to the Options & Messages window. However, the next release is likely to be the stable one, so any fixes for 510 would have to come in a maintenance release after that. That's if this is fixable at all and not just a problem with your card, that is.
I'm not tech savvy and I don't know what happened here, but I've installed the SDK, joined Goon's through PIV and the lighting started working, as magic! (http://i.imgur.com/UfnkkAb.jpg)

Ginja's demo shows tiles in grayscale, too.
All's well that ends well.
Lummox JR resolved issue
Page: 1 2