camera texture to spot light cookie
Hi folks, I'm quite new to Unity and am loving it but now I'm stuck.
I'm using 3 spotlights (R,G,B) and three grayscale, cookie, images each one generated from the RGB channels of a colour image. The 3 spot-lights successfully project the colour image onto surfaces within Unity.
My next task is to dynamically update the spotlight cookie with the output from a camera.
I am using a RenderTexture to map the output from a camera onto a cube, this works great.
I think I need to do the following, 1) get colorBuffer from the RenderTexture 2) split into RGB channels 3) create 3 Textures from the colorBuffer in (1), one for each colour channel 4) set each texture type to Cookie 5) update the cookie attached to each spotlight
Does that sound like a good approach?
Edit: I've noticed in MonoDevelop there is a DynamicCookie object but I can't find any documentation on how to use it...
Edit: What am I trying to do?
Link the output from a Unity Camera to the Cookie of a spotlight.
I wish you luck on your end-ever. I do not know if unity supports camera image rendering and if so it could be a performance killer. I am guessing that you are making some sort of security camera system but i am not sure.
@Vandive not a security camera - I'll edit my question to try explain more
Your answer
![](https://koobas.hobune.stream/wayback/20220612074358im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Taking a Screenshot and then displaying the Screenshot in game 0 Answers
Problem with textures 0 Answers
How to change camera illumination range 1 Answer
Why is there difference between android device resolution and webcamtexture resolution 0 Answers
Scene and game view in old project became completely black. 0 Answers