What to do when setShaderAuto() fails?

I’ve got a problem that I already described elsewhere ( panda3d.org/forums/viewtopic … 8521#78521 ). In short I’m using shadows, fog, per pixel lights, normal and gloss mapping… and apparently that’s too much for my hardware (the shadow+fog combo is the killer). The application spits out errors, then the nodes that had shadows+fog are rendered without shadows and normal mapping but with fog (I presume that’s rendered with the fix function pipeline).

Is there any way I can catch the shader error before it all goes haywire?

If the end-user hardware can support both shadows and fog then great, I don’t have to worry about a thing, but if it fails like mine, then I’d rather turn off the shadow casting light or try to use a post process fog filter… or do whatever, but do it in a controlled way.

I don’t think there’s any way to automatically detect this failure, and I agree that’s unfortunate. Still, even if we did report catastrophic failures like this, there might be other kinds of failures (like weird rendering errors) that are impossible to detect.

As a workaround, I suggest you create a “graphics options” page where the user can select whether to enable these features or not. Most professional games have to do this too.

David

Maybe the shader generator can have a return value? Say an error code?

If there would be an error we could change some settings and maybe even restart the game with some safer options if it’s too late for a quick fix… or do nothing… or give the player a pop-up warning that something went wrong and suggest to change graphic options (or buy better hardware).

The problem is, the error is discovered by the low-level renderer, not by the setShaderAuto() call. So there’s no easy way to send an error message back to the application. There’s no single Panda call that has failed! It just wasn’t able to render the scene.

It would be possible to work around this, but it would be complicated. I’m not opposed to solving it, but it’s not going to happen in the short term (unless you’d like to offer patches?) In any case, it still wouldn’t solve every problem; and that’s why I suggest just punting anyway.

David

I think I’m lacking in skill and knowlage to make any patches, in other words - I’m too stupid :wink:

As I understand it, the error is below panda and there’s no way to even redirect the error massage back to panda.