Why is loader trying to load extra -ao, -glow, -gloss maps?

I’m getting a strange error when setting a shader. Panda3d tries to load extra maps (presumbly for the autoshader) that I did not declare and that I do not want.

:gobj(error): Texture::read() - couldn’t read: /c/pandabin/_Bin/Data/Models/sailtest1/LargeSail_1k_ColorAO-ao.png
:gobj(error): Texture “/c/pandabin/_Bin/Data/Models/sailtest1/LargeSail_1k_ColorAO-ao.png” does not exist.

The error message is repeated for a …-glow.png, and a …-gloss.png.

I’m not sure why the loader is trying to load these non existent maps. I did not turn on the autoshader.

Anybody have any ideas?

It depends on the keywords specified within your shader. If you have keywords that begin with “tex_”, then Panda will understand these keywords request special texture properties. If there is a third token in the keyword, such as “_ao”, “_glow”, and “_gloss” in your example, it specifies a special texture map to load.

So, short answer: you are applying a shader that is requesting these special maps.

David

Hi David,

Thanks for the quick reply as well. I just found the problem on my own. No offense, but I think this is a pretty ridiculous way of doing things. What’s the point of explicitly setting things outside of the shader using TextureStages when you can ‘magically’ call in new textures inside the shader?

What’s also extremely irritating is nowhere in the manual did it state I cannot use variables ending in _ao, _glow…etc. I think this is an extremely dangerous programming style to have magical keywords embedded in variable names. Isn’t the whole point of having semantics like TEXUNIT0 so we can avoid issues like this?

There are certainly problems that can be caused by magic naming conventions such as this, especially when the documentation on the subject is weak. My apologies for your temporary confusion. Would you like to help improve the documentation?

David

lol. You got me. I’ll make the changes to the manual.