4

I am new to blender and want to create a series of light sources that are scattered across a spherical mesh. I then want to animate the colors of the lights so that it looks like the colors are sweeping around the lights.

So far, I have the instances spread out on the ico-sphere. What do I have to do now to get the instances to change color based on their position on the sphere? Preferably I would like the color to revolve around the sphere.

enter image description here enter image description here

Keyek33
  • 41
  • 1
  • 1
    Look at this post " https://blender.stackexchange.com/questions/248236/send-geometry-nodes-value-into-shading-tab " and play around with "geometry proximity node" or this " https://www.youtube.com/watch?v=-f2HXGtVUpo&ab_channel=WannesMalfait ", if it doesn't look like you want it to :). I will post the solution in a few hours, when have time to write it. – jst kiko Apr 15 '22 at 13:11

2 Answers2

3

I would like to add to "LuckyOne"s solution. As I see it you want the colors to rotate around the sphere origin. The base idea is still the same, make geometry nodes output some values, that you can then use in shading nodes.

Example: enter image description here

enter image description here

Which produces:

enter image description here

The problem is the points at the top are closer together so they do not follow right colors. (But it is still a nice effect, which might be what you want).

The second way to get a similar result is to create a Cartesian to spherical conversion coordinate system node. This way you can get exact angle from origin which produces the following effect.

enter image description here

The nodes for this example are slightly more complex:

enter image description here

Where the spherical cords is basically just math from https://en.wikipedia.org/wiki/Spherical_coordinate_system. The nodes look like this:

enter image description here

The output of this node is going to be a field of values between -pi and pi, but ColorRamp fac wants values between 0 and 1. So we need to remap this array. With some simple math we can also make an offset, so that we can animate the movement: enter image description here

jst kiko
  • 681
  • 5
  • 18
  • "The base idea is still the same, make geometry nodes output some values, that you can then use in shading nodes". I'm trying to understand how the value of attribute distance from the geometry tree of the 1st picture is recovered by the shader of the 2nd picture. Because distance appears nowhere in the shader, instead the shader attribute node refers to new attribute...? – mins Jun 05 '22 at 22:49
  • In the geo-nodes modifier tab you add a name to output atribute, you use that name in the atribute node of shader editor. Look at 2nd and 3rd picture of LuckyOnes solution. – jst kiko Jun 06 '22 at 08:48
1

I am not sure how exactly you want to change the color, but with this easy GN nodes setup:

enter image description here

and this shader node setup:

enter image description here

and this modifier:

enter image description here

you get this:

enter image description here

LuckyOne
  • 721
  • 2
  • 11