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.
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.
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:
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:
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
What do you think @Deltakosh … do you think we can implement this feature… When using a ProjectionTexture … ONLY emit the texture taking into account the texture alpha … and NOT emitting the light… I need to PROJECT a texture on the ground to simulate a fake shadow.
Here is a playground where i need to project this shadow texture on the ground surface (imagine this is the fake shadow i want to project under my cars driving around a race track)
When trying to use the SpotLight ProjectionTexture the light of the actual light (plus other lights like a directional light also in the scene) wash out the shadow texture. So you can barley see the rectangle outline of the car shadow on the ground.
@Deltakosh once mentioned make the light ONLY emit the projectTexture when one is assigned and not the light… Can you please add that… I do not know how.
this is effect i am going for… Notice the shadow blob under the character
Instead of modulating the final spot light color by the projection texture color it is using the projection texture color only. It works by replacing in the shader code a diffuse *= color_from_proj_texture by diffuse = color_from_proj_texture.
The plane outside the shadow looks bright because you have some white color in your projection texture, you should use black color instead and raise the directional light intensity to compensate.
You also need to set the wrapU/wrapV properties of the projection texture to CLAMP, else it will repeat on the ground.