Babylon Projection Texture Support

Hey guys… I am trying to do something like Unity Projectors: Unity - Manual: Projector

Yo @Deltakosh … Or somebody… Can you point in the right direction on how this is done in babylon.

I thought i read somewhere about having to handle this with a special shader… Can someone please explain the details on how i can PROJECT a blob type shadow on to the ground mesh.

I saw the playground:

Looks like it uses a separate light and has a projectionTexture

When a light has a projectTexture so it behave differently than any other spot light ?
Is it still a resource intensive?
How many lights with projections textures can I have in a seen ?

I think would need one light with a projection texture per car sitting right above each car and projecting a blob type shadow on the ground… that is what i am going for.

I just need the details on what is way to handle this kind of thing in Babylon.

Please :slight_smile:

not resource intensive at all. It behaves like other spot lights but instead of having a solid color it uses the texture to get the light color:

Would the separate light for each car in my scene with a projection texture be the way to go to accomplish the same type of thing Unity does with its Unity Projectors

I am trying to place a blob shadow on the ground of my … kinda like how unity is doing with the project and projecting a blob shadow on the ground here:

I think so :slight_smile:

Yo @Deltakosh … I am trying to use a light with projection texture. But you can barely see the projected texture. And it has a big spotlight around the projection. Can you control how dark the projected texture is ?

Or is there a better way to project a shadow texture on the ground. Because realtime shadows do not work that well when the ground plane is very large… Like a race track… even with 8192 shadow map size they still look horrible (unless i am doing shadows wrong). So i thought i can get by with PROJECTING a shadow on the ground for each car on the track. I would put a spotlight (or whatever else i can use) above each car and project a fake shadow on the ground that follows the car around.

FYI: This is what i got so far. But can control how dark the shadow is:

Any thoughts on making better looking projected textures ?


Maybe this will help?

I think we could have a new light model where there will be no actual lighting but only the decal itself. Pinging @sebavan for more thoughts

I guess this could be done and would make sense :slight_smile:

That would be great… I tried a regular spot light with lightmap mode set to shadows only… but didn’t quite work. Still a little light was coming from light when increased intensity enough to see shadow

I hope a projection texture light with no light works a bit better

Do you want to add it and make a PR so that it perfectly fits with your needs, I guess it might be easier ?

I don’t know what or how to make the a projector

Could we not tweak the projection texture to also be impacting ambient ? Cause currently what you see is all the diffuse from the environment I guess.

I down for whatever… I just need to be able to project as shadow texture to help give depth like this:

If you can do whatever you need to be able to produce that shadow blob above… That would be freaking sweet :slight_smile:

At least we should capture the need with an issue on our repo