Shadow maps and multi-texturing in general

Was working on adding a shadow map to an object. I got it to work using the Lighting.j3md shader, setting the map as the alpha map, and then turning off transparency and changing the blend mode.

Is there another way of doing this? Right now, as far as I can tell, the Lighting.j3md only supports a diffuse, alpha, normal and specular map. If you wanted more then 4 textures what would you do? Just for future reference :slight_smile:

I just need to sit down and become an expert on shaders don't I? :stuck_out_tongue:



For shadows look at TestShadows example in the sources

You’ll need to add a SceneProcessor on your viewport to use shadows.

You’ve got the BasicShadowProcessor which does classic shadow mapping, or PSSMShadowProcessor available here and soon to be added in the core.

Shadows are processed in a post rendering pass

For the lighting.j3md it supports Parallax map too.

kirdel said:

I just need to sit down and become an expert on shaders don't I? :P

This can help yes, but you don't have to.

I did look at the shadow example but I don't really need real time shadows or the performance hit right now. Pre-rendered shadows are just fine for what I'm working on atm.

But I will look at the PSSMShadowProcessor. Just like want to look at the SSOA filter that's been worked on.

My only concern with these like said above is the performance hit.

Basically I was wondering the best way of doing some more multi-texturing stuff.

Like I see a splatting shader in the core but couldn't find any code example that used it.

For the lighting.j3md it supports Parallax map too.

I missed that. Also something called a ColorRamp. Something else for testing.


Ho ok, so you never change the point of view position in your scene?

Well…I think your good to go for your own j3md and shader :stuck_out_tongue:

Or you can keep on doing with the alpha map, but at some point maybe you'll need it to do what it's suppose to do…