What to do when setShaderAuto() fails?

Return to Scripting Issues

What to do when setShaderAuto() fails?

Postby wezu » Thu Nov 17, 2011 9:24 am

I've got a problem that I already described elsewhere ( http://www.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 may be totally wrong, cause I'm a dancin' fool.

NameError: global name 'elf' is not defined
User avatar
wezu
 
Posts: 718
Joined: Tue May 19, 2009 1:03 pm

Postby drwr » Thu Nov 17, 2011 12:33 pm

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
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby wezu » Thu Nov 17, 2011 2:30 pm

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).
I may be totally wrong, cause I'm a dancin' fool.

NameError: global name 'elf' is not defined
User avatar
wezu
 
Posts: 718
Joined: Tue May 19, 2009 1:03 pm

Postby drwr » Thu Nov 17, 2011 2:46 pm

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
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby wezu » Thu Nov 17, 2011 4:02 pm

I think I'm lacking in skill and knowlage to make any patches, in other words - I'm too stupid ;)

As I understand it, the error is below panda and there's no way to even redirect the error massage back to panda.
I may be totally wrong, cause I'm a dancin' fool.

NameError: global name 'elf' is not defined
User avatar
wezu
 
Posts: 718
Joined: Tue May 19, 2009 1:03 pm


Return to Scripting Issues

Who is online

Users browsing this forum: No registered users and 0 guests