GLSL Strange Shading

Hi everyone!

I’m quite new to GLSL, and I’ve encountered a strange problem. I’ve imported a model from another project using Cycles. I get this:



But when I add a BGE material instead, I get this:


If anyone knows why this is happening, or how to fix it, I’d be very grateful!

Thanks!

You appear to have forgotten to attach the blend file ensuring ant textures are included .

I guess you have imported the material as well? Open the Node editor and check if the bed still holds any nodes, if so delete them.

I’m not sure what GLSL and cycles have to do with each other. GLSL is a real time …can’t think of the word…used for real time viewing, cycles renders. I model in GLSL, and UV unwrap models etc, but if I choose to render, the output has nothing to do with GLSL.

Materials are materials. I’m not sure there are game engine specific materials, meaning that they will only work in the GE. The reverse is true - some things will only render, like real time reflection, HDRI lighting etc. But I think your problem is nothing to do with a “game engine” material.

Blender has some quirks. I’d just dump the material and start over. Check your usuall suspects - doubled verts, overlapping faces, inverted / inconsistent normals, missing textures etc. Most problems can be fixed by checking those things. But failing that, I’ve learned that throwing 5 hours at a problem often has no effect. Just start fresh. Soimetimes Blender just doesn’t like a material - maybe it got corrupted, who knows.

I guess I should explain a little more.

The problem doesn’t only apply to the bed; the wall also has some lines on it that you can see in the screenshots, and this is caused by the same thing.

I’m pretty sure it’s actually the spotlight. When the ‘Bias’ setting is set to 1, it’s OK:



But when it’s 0.001:

This is also with a new spotlight, so I doubt it’s to do with the materials. It’s happened to a lesser extent in other projects too, so I wonder if it’s something to do with my graphics card.

GLSL Problem.blend (1.19 MB)

EDIT - Okay, I set the bias to .05, and the size to it’s maximum, and that seems to be fine, so I’ll leave it at that. Thanks everyone!

Yeah, the bias influences how easily shadows are projected across surfaces. The smaller the bias, the smaller objects can be while still casting shadows, but lighting errors show up. If you need more accuracy with less errors, I think you could try setting the light frustum size smaller.