[SOLVED] Animated texture with cookie light

That’s just too large. At best, you can have a 8192 x 8192 sized sprite sheet but not many devices will be able to load that.

If you want device compatibility, then you are looking at best 2048 x 2048 (especially on mobile).

yes, thats true…must cut the video first, thanks.

so I did wonderful spritesheet 2048px with whole animation. it is now 700kb, great yes. Please could you advice me how I set the spot with that? I am just my first day here…

What do you mean by spot? I don’t understand what effect you are going for?

what i am try to do, is kind of light beam with animation, so it looks like a video projection in movie,
and I see in lamp seting (spot), that I can add the sprite there, but isnt finding my file…and also i need some scrypt probaböly to sett the grid

So there’s a couple of ways to do this:

  1. Does it have to be a light projection? Could you fake it by not having a light at all and just play the animation as a sprite on the wall?
  2. If it needs to be a light, the spotlight cookie parameter only takes a texture, not a sprite asset. You would have to play around with the cookieOffset and cookieScale to manually progress through the frames. https://developer.playcanvas.com/en/api/pc.LightComponent.html#cookieOffset

it ius necessery that it light

because i need to project on complex topology, not just a plane

please. look her https://sheenyfile.com/posk-gallery/ fo fake effect, it looks just horrible

Hmm… The scale and offset doesn’t actually do what I thought it should :thinking:

I can only think of manually switching the textures from one frame to another (so not use a sprite sheet) or dig into the light code to see if you can use just a section of the cookie texture at a time.

do you have example code ?

Nope. Haven’t done it before. Just working off theory.

so, you suggest to make kind of interface/button for switching the texture like it would be a slide-projector? would it work with a spot?

I was thinking of doing it in code.

are you able to code that? would you like to help me to code this? I found this: https://github.com/playcanvas/sprites, it is deprecated. Need some first steps help

I had a quick go and managed to get the video playing in the texture directly: https://playcanv.as/p/4UIh6Riz/

Project here: https://playcanvas.com/project/623407/overview/light-projector

1 Like

Oh, I am soo glad! Hammer. This is what I was ages looking for! Thank you so much. Thank you so much! :slight_smile:

You could also try the VP8 or 9 codecs made from images with alphas. that is also supported now using ffmpg4.

could you provide an example? please go to https://sheenyfile.com/posk-gallery/ to see what kind of effect I do not want. this effect is done with codecs. I need light projection effect correct projected on that corner according to topology. the code dosn’t allow me to manipulate the shader. I did it with wonderful software verge3d, which dosn’t support cookie. So know I try to adapt the script from yaustar to use it in verge3d and when I’ll be not succesful, I must build the model again and import that to playcanvas in case of using above script.
This is my reality :slight_smile: Thank you guys for all your help. I am not a programmer. It is very difficult for me, to write the code.

A post was split to a new topic: How to change light cookie scale?