Link Light color to pixel of texture

I posted this "MANY" years ago and still have not come up with a solution. Trying again to see if anyone has any insight.

I have a series of lights that I want to animate the color from the pixels of an animated texture/material.

For example if I had a grid of lights 5 x 5 and I had a texture that was 5 pixels by 5 pixels, I would like each pixel to drive the color of the light.

My end file is going to have 5000 lights and up to 5min of animation so I need a way to automate this.

Thank you

D.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
SimonBourgeois's picture

Animated Colored Lights From Image Sequence

Hi Dietrich,
Here is a script to create animated colored lights from an image sequence:
https://www.mediafire.com/file/geprijh0w4uqdho/Colored_Lights_From_Image...

It creates omni lights, if you need an other type of light, let me know i'll modify the script accordingly.

You can change pixel threshold value, at default value it creates one light per pixel, at 2 it will create one light every two pixel etc...
the spacing between lights is based on the resolution, if you are in cm, you would end up with one light every cm, for example if your image resolution is 100x100 pixels, you will end up with a grid of 100 by 100 lights with 1cm between each lights.
You can set the pixel threshold to 2 to create a 50 by 50 lights grid in the same 1m square area.

This script doesn't animate the color of the light but it loads the sequence as a texture instead, then it crops only the needed portion of the bitmap for each light. at first i did a version that was animating the colors but i saw that you had 5min of animation ,it is 7200 frames at 24frame per sec , each frame might take around 10sec for 5000 lamps (71*71 pixels), it would have taken 20 hours to complete the task...that's why i chose to crop the image sequence for eachlight as it is done only once and it doesn't need to get the colors for every frames, the image sequence could be of any length it won't change the time it takes for the script to compute.

I don't know what you are trying to achive, but if it is for a led screen or something equivalent, the image sequence could be directly put in a light material or in a light plane with a tiled gradient ramp with a gradient type set to radial as a mask on top of the image sequence to create the "pixel" led effect it would render much faster.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.