Sprite Maps and Light

Hey guys. I’m using a spritemap as the ground for a 2.5d style game. I’d like to be able for light to affect the sprite map as well as the ability for it to receive shadows so I can implement a day/night system. If there is a setting I’m missing I’d love to know about it.

Would it be possible to easily change in the source? Or what are my options? Thanks for your time!

adding our sprite map master @Pryme8

1 Like

Everyone keeps asking for this and I had plans to support it initially. The main concern now will be to add that but not break any backwards compatibility.

If I can find some time here I’ll take a look at what the best options for this are. I was thinking sense it requires fragCoord data the best bet will be to have an RTT that captures once with the normal data then once with the color and transparency data. Then I could just return the two textures which could be bound to material and use all the same lighting processing as a normal BJS element.

Give me a little bit to figure out if it would be better to do it that way, or if it would be better to treat it like a volumetric particle.

Pretty sure I posted a PG not to long ago that shows how to capture the spriteMap as an RTT. If you can find that and anything I said made sense you might be able to come up with a solution before me.

1 Like

Thanks for the reply. It’s pretty far over my head but I’m glad there has been some interest in it.

Maybe for now I’ll try chunking my ground into several larger planes with dynamic textures and see how that performs.

I’d love to see a solution for this though. Sprite Maps are so handy! Do you take paid commissions to have features implemented in the event I absolutely need this feature?

https://playground.babylonjs.com/#YCY2IL#245

Its going to take a hell of a lot of fangdangling… but I could totally make this happen.

And yes I accept commissions if the price is right for my time.

Could honestly make PBR sprites too with this method.

1 Like

Wow, thank you so much for taking the time do that. You make it sound like this isn’t a complete solution but when I get home I’ll try to understand what’s happening here.

@monk
Welp I made a feature request for it.

We will see if it gets approved. If it does at some point here Ill re-haul it all and make this correct.

1 Like

I appreciate you doing that. Do I just keep my eye on that feature request? I’m not too familiar with how it all works.

yeah if @Deltakosh approves it Ill move forward with that in my free time and post the updates on that request.

Figured it will be approved considering how many times people have requested it.

1 Like

Yep this sounds like an excellent idea

3 Likes