Results 1 to 14 of 14

Thread: Random Coloured Lights

  1. #1
    da what? daforum's Avatar
    Join Date
    May 2006
    Location
    Bristol, England
    Posts
    1,687

    Random Coloured Lights

    Hi.

    Is there a tutorial on how to do random coloured lights?

    I'm doing a Christmas animation and just wanted to animate bulbs (objects) changing colour randomly.

    Many thanks.
    Montage Reel, Portfolio, PIN_01, Prime......«« go on, click on a link!

  2. #2
    Curmudgeon in Training Ma3rk's Avatar
    Join Date
    Mar 2003
    Location
    Near Beaverton, OR
    Posts
    1,548
    I don't know of any specifically but search around I suppose.

    I've been doing a lot lately using Luxigons, then linking those to a Master/Slave setup so I can control entire groups at a time, like Kitchen Overheads, etc., not just for intensity but color too. Adapting that to a string of lights would be pretty much the same.

    I can whang together some notes later if you don't find anything to your liking.
    "Never be a cat in a cartoon. Never." Chief Wiggum

  3. #3
    da what? daforum's Avatar
    Join Date
    May 2006
    Location
    Bristol, England
    Posts
    1,687
    Thanks Ma3rk. Yes please i would love to see some notes.
    I've tried using an image map but it doesn't quite work.

    I have text ( letters) with a number of bulbs placed in each letter, so would like to just be able to animate colours changing randomly. Can't work out how to do it!!
    Montage Reel, Portfolio, PIN_01, Prime......«« go on, click on a link!

  4. #4
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    7,980
    Did you try using Node Editor?

    Add Tools > Random Vector, plug to color.
    or better
    Add Tools > Random Integer (or Scalar), plug to Gradient as Input, and set up couple colors in gradient, output plug to color.

    Adjust Seed to change color.

    You can use Item Info index or Clone Item Index in Extended Item Info node from TrueArt's Node Library 2019 http://nodelibrary.trueart.eu
    I used similar technique with Clone Item Index in this video tutorial:
    Last edited by Sensei; 12-08-2019 at 04:04 PM.

  5. #5
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,114
    Which version of Lightwave?
    If you are prior to LW2018, Light Color have only Color RGB Channels.
    In this case Modifier or third party Channel node editor could help,
    but per channel.

    Denis.

  6. #6
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,114
    Depends also how many lights you have to setup,
    because this could be tedious to paste a node setup for R,G and B Channels,
    except if you can position them in a final step.

    If you have both DP Kit and nodeChannelFilter node editor (bottom DP Kit menu on my site)
    you can use this setup, I added flare on a point Light to see the color in render,
    it is varying with the Null X position, you can easily modify the value to speed up or down,
    also the basic light color is random tied to its ID,
    so if you clone the light, each have a random varying color,
    this is a saturated color, only hue variation.

    test_randomlightcolor.zip

    Denis.

  7. #7
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,114
    Hum.. Seems that the above setup doesn't work as expected,
    the light ID is somehow not correct in the in Color channel context,
    not like in a Motion context, will see if I can fix it later.

    Denis.

  8. #8
    Curmudgeon in Training Ma3rk's Avatar
    Join Date
    Mar 2003
    Location
    Near Beaverton, OR
    Posts
    1,548
    I'm sure there are a number of ways to do this, but this has been working for me anyway. Let's see if I can 'splain this. It's really much easier than it looks & sounds.

    Once I have scene set (volumetrics, etc.), I take the object that's going to have lights into Modeler so you can break out a layer that will have your luxigons, so name the new layer accordingly. If they're going to be "aimed" lights like a spot, area or ies, you need to create a poly so it's normal is pointed correctly. Linear Lights use a 2pt poly where you want the tube to be. For Points & sphericals, a single point converted into a 1Pt. poly is all that's needed.

    In my example, the chandelier geom had a weird poly for the filament. I isolated them then individually killed the polys & used OD_WeldAveClean to weld them to a single point then converted to 1Pt. polys. I then used Add Luxigon set as Point, Saved object & sent to Layout.

    Click image for larger version. 

Name:	Select Filaments.jpg 
Views:	21 
Size:	193.9 KB 
ID:	146364 Click image for larger version. 

Name:	Filamen Coverted to 1Pnt Poly.jpg 
Views:	14 
Size:	290.1 KB 
ID:	146365 Click image for larger version. 

Name:	Convert to Luxis.jpg 
Views:	14 
Size:	153.4 KB 
ID:	146366

    In Layout, then make one new light using in my case a spherical & set the basics of size, color, etc. & name it accordingly Like ChandFilament & move this way off set & usually make a black enclosure. You'll see why in a bit.


    ENABLE ENVELOPE by clicking the "E" buttons for both Color & Intensity. You'll rename this one after it gets cloned to something like _MASTER.

    Click image for larger version. 

Name:	Create Envelopes.jpg 
Views:	18 
Size:	171.1 KB 
ID:	146368


    Clone the light & rename the original so now you should have your light name_MASTER and the clone.

    Click image for larger version. 

Name:	MakeControlLights.jpg 
Views:	13 
Size:	120.1 KB 
ID:	146367

    Select the clone & shift-click the "E" (to clear it)then set the lights color to 0,0,0. Click the "E" again & add a Channel Follower Modifier.

    Click image for larger version. 

Name:	Set Clone Props.jpg 
Views:	14 
Size:	167.9 KB 
ID:	146369

    Using the generously sized postage stamp box, navigate to the appropriate channel on the MASTER light. It's ususally at the bottom, but as the scene grows ... Do this for the other two colors & close the Graph panel.

    Click image for larger version. 

Name:	Set Channels to Follow.jpg 
Views:	15 
Size:	179.4 KB 
ID:	146370

    Shift-click the "E" next to the clones Light Intensity & set Intensity to 0. Click the "E" again, add a Modifier but this time set it to MASTERS Intensty value. OK & exit Graph panel.

    Now comes the fun part. Select the Luxigon layer, Find Convert Luxigons on the Setup Panel & click. Select your Clone & in a couple seconds, you should see new lights where the filaments were.

    Click image for larger version. 

Name:	Select Filament OBJECT Layer.jpg 
Views:	16 
Size:	234.1 KB 
ID:	146371 Click image for larger version. 

Name:	Set up Luxis.jpg 
Views:	12 
Size:	246.6 KB 
ID:	146372 Click image for larger version. 

Name:	And OK.jpg 
Views:	15 
Size:	255.7 KB 
ID:	146373

    If you need to change the size of the lights (as I needed to do here), clear them but leave MASTER and (1). Make changes, manually dupe those to (1) & go again with the Convert step.

    Click image for larger version. 

Name:	In Position.jpg 
Views:	20 
Size:	284.4 KB 
ID:	146374 Click image for larger version. 

Name:	Glowing.jpg 
Views:	18 
Size:	172.9 KB 
ID:	146375 Click image for larger version. 

Name:	ChangeColor&Intes.jpg 
Views:	18 
Size:	173.1 KB 
ID:	146376

    Make all of your changes to the MASTER. Disable the Envelope, make the changes in the Panel, the Re-enable the Envelope.

    Proceed then to make other sets with different colors. You'd want to do this even if you set a random or noise mod to the colors or Intens.
    "Never be a cat in a cartoon. Never." Chief Wiggum

  9. #9
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,114
    Quote Originally Posted by dpont View Post
    ...the light ID is somehow not correct in the in Color channel context..
    This was caused by some kind of latency in Layout when cloning Light or Camera item only,
    I delayed the id detection in nodeChannelFilter, updated all versions,
    so the above scene with cloning action works now.

    Denis.

  10. #10
    da what? daforum's Avatar
    Join Date
    May 2006
    Location
    Bristol, England
    Posts
    1,687
    Thank you everyone for contributing to the solution
    It's going to be a bit like the way Sensei shows in Post #4.

    Can it be done without a CSV file? More so done simply with a Null running left to right on repeat so the cloned objects that are representing the lights just change color probably repeating the same colour sequence so I only have to render a certain number of frames?

    I have to add I'm not using Layout Lights just objects to represent light-bulbs with a Luminosity that needs to change color randomly.

    Again, many thanks for all the possible solutions. There is a wealth of ideas here for other users too.
    Last edited by daforum; 12-10-2019 at 07:12 AM.
    Montage Reel, Portfolio, PIN_01, Prime......«« go on, click on a link!

  11. #11
    da what? daforum's Avatar
    Join Date
    May 2006
    Location
    Bristol, England
    Posts
    1,687
    Quote Originally Posted by dpont View Post
    Depends also how many lights you have to setup,
    because this could be tedious to paste a node setup for R,G and B Channels,
    except if you can position them in a final step.

    If you have both DP Kit and nodeChannelFilter node editor (bottom DP Kit menu on my site)
    you can use this setup, I added flare on a point Light to see the color in render,
    it is varying with the Null X position, you can easily modify the value to speed up or down,
    also the basic light color is random tied to its ID,
    so if you clone the light, each have a random varying color,
    this is a saturated color, only hue variation.

    test_randomlightcolor.zip

    Denis.
    Thank you Denis.
    I haven't tried the setup in the zip yet but can it be applied to objects, ie: an object representing a light that is cloned?
    Montage Reel, Portfolio, PIN_01, Prime......«« go on, click on a link!

  12. #12
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,114
    Quote Originally Posted by daforum View Post
    Thank you Denis.
    I haven't tried the setup in the zip yet but can it be applied to objects, ie: an object representing a light that is cloned?
    Random Color on surface of Object is far simpler,
    so you don't need RGB channel, just go the Surface node editor.

    If you want the same random color on a object,
    you copy this node setup in the surface node editor,
    for light the R, G and B channels have the same setup except the final Vector Scalar node set to X, Y and Z,
    in the surface you can plug directly the Color output of Color Tool or Gradient to the root,
    leaving the ItemInfo set to "Self".

    if you need both Object/light, the Object should have the same type ID
    than the Light, this is the case in an empty scene, first Light and first Object
    have the same type ID, then you can parent the light to this object,
    clone with hierarchy.

    In my setup Color animation is fading smoothly,
    or by step, selecting Step mode for the X Position of the Null reference.

    Denis.
    Last edited by dpont; 12-10-2019 at 07:59 AM.

  13. #13
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,114
    Also if your bulb objects are identical,
    just use instancing, replace Item type ID with Instance ID.

    Denis.

  14. #14
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,827
    As Denis said, this is easier with a "base" bulb which is instanced. The Instance Info node's ID or Random Scalar can be used to generate a random color per instance.

    I've attached a LW2019 sample scene which changes the bulb color over time. The Instance ID is used to generate a "frames per change" for each instance, which is then used to multiply the Random Scalar generated from the Instance ID. The multipled value is fed into a plain Random Vector node, which is scaled up to increase the saturation of the generated color and fed into both the Surface's Color and Luminous Color. The Surface has a fairly high Luminosity.

    Click image for larger version. 

Name:	Final_Render_234.jpg 
Views:	19 
Size:	160.5 KB 
ID:	146391

    ChristmasTree_RandomLights_GeometryInstances.mov MOV File

    Click image for larger version. 

Name:	ChristmasTree_RandomLights_GeometrySurface.jpg 
Views:	19 
Size:	1.24 MB 
ID:	146387

    To get more consistent colors for the bulbs, use a Gradient node fed by the multiplied value rather than the Random Vector.

    Prior to LW2018, the Time node wasn't available, but you can use a 3rd party node, or a Scalar Constant with an Envelope, setting the Envelope's value to a simple Expression:

    Click image for larger version. 

Name:	PreLW2018_CurrentFrameNode.jpg 
Views:	22 
Size:	1.41 MB 
ID:	146388

    If you're on LW2018 or after, good luck with the "fireflies" produced by all the luminous surfaces!!

    In my sample scene, I used a random set of points from the Tree's perimeter for the Instancer points layer in the Object. This could be a random set of points (or a regular set of points) from the text you're trying to animate with bulbs.

    mTp

    P.S. I used SkyTracer in the background (F8) to produce a sunset, but when you close the sample scene it will give an error "Scene must have at least one Light" - which is consistent for scenes where the only Light is the SKT_Sun.
    Attached Files Attached Files
    Last edited by MonroePoteet; 12-11-2019 at 08:07 PM. Reason: Add MOV file; P.S. on SkyTracer Light error; Random Vector not Make Vector

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •