Glitchy bump-mapping with shadows on

I think this is a bug. In bump-mapping sample I changed Pointlight to Spotlight, set it as shadow caster and shadows work fine, but I also got this ugly effect:

What could be the problem?

Hmm, if you disable parallax mapping, does it work?

Yes, I also want to know, does it work?.. :smiley:

With parallax mapping off it seems fine.

Have you tried tweaking the parallax settings to produce a less extreme result?

No, I haven’t. I just used everything as is in that sample.

On a side note… Is there any way to make shaders from shader generator compatible with custom shaders? It doesn’t matter for me if it’s hacky.

I’m not sure what you mean by “compatible” in this context.

Well, I mean that when I apply a custom shader to an object it wouldn’t completely override generated shaders, but instead merge with them to provide final result.

I’m not sure how you imagine such merging of shaders would occur. Any shader program takes complete control over the shading process, so there’s no way to simply combine two shaders and get a result that works. You can let an object be rendered twice by different shaders, but that’s probably not what you want.

I see. Then maybe there’s a way to extend shader generator with custom shaders? Is there some API or is it hardcoded?

There’s not a way to extend it, currently. I have some ideas on how to rebuild it in a way that allows for extending it, but it won’t be implemented in the near future. Because there are an infinite number of ways to define how parts of a shader should interact with other parts, it’d require a quite complicated system.

You can, however, grab the shaders that the ShaderGenerator generates and extend them with your own functionality by editing the shader and applying it yourself.

Great. I’ll look into that.

The issue is probably caused by the same thing as with shadow + fog.

What do you mean? I wasn’t aware there was an issue with shadow + fog?

I think this is the shadow+fog issue:
panda3d.org/forums/viewtopic … 8525#78525

The cause of that was that my poor ol’ gpu can handle only 4 texture stages. Fog uses #1, shadows #2 and I had a colour texture (#3), a normal map texture (#4)and a gloss texture (#5). Removing the gloss (or merging it with the normal map) solved the problem.

As far as parallalax maping goes that always looked like that for me, but I blame my gpu, not panda:

Sorry, I forgot to look into that issue because it wasn’t filed as a bug report. I’ll get to it sometime soon.

In any case, it has nothing to do with the texture stage limit. Fog does not use up a texture stage, and the texture stage limit is not relevant anyway when using shaders.

I have gtx 460. It’s not the newest graphics card, but I am sure it should handle more than 4 textures.

One thing I forgot to mention. This happens only to pillar, which is using both height map and parallax map. Other parts, which are only using parallax map look fine. That should narrow it down.