Generic Shadowmapping Shader?

Miscellaneous Forums/General Discussion/Generic Shadowmapping Shader?

There are several things to consider:


Yes, I realise that. I'm not ( at this point ) asking anyone to go off and write it, so I would have a bash at using anything, then if I can't find anything, I will either write one myself or find someone who would be prepared to write one cheaply. At that point, I would obviously be precise about exactly what I want, because I'd be paying for it. At this point, I didn't want to be too specific and avoid people posting something I might be able to adapt easily.

However, since you asked..

- Which shader language

HLSL or ASM is fine. IE: .FX files.

Which format should the rendertarget be in

I generally use rendertargets in A8R8G8B8 format, but I expect I could convert if necessary.

- Which light types should it support

Well again, I can't afford to be fussy at this point. Point, Directional, even spot would probably be fine. Ideally, I suppose a point light makes most sense.

How are light positions and matrices (projection etc) supplied

That really doesn't matter. As long as there's an explanation of what info needs to be supplied, I'm certain I could supply it as vectors, matrices or whatever.

- How should it be integrated with the remainder of the shaders?

I'm not entirely sure what you mean. I can't think of any way it would affect other shaders. Obviously a shader applied to a mesh has to include whatever lighting, etc you're using on similar meshes which don't have this shader or it won't be lit, etc. But I'm not sure what considerations there would be with a shadowmapping shader.

And in general stencil shadows are more widely supported, and do not rely on shaders.

Yes, I know. They're real slow on animated meshes even in hardware though, and in software they're really, really slow. I'm under the impression that shadowmapping is often faster on animated meshes, though I could be wrong.