Skip to content
ImagineWorld

Constructing a Procedural LED Panel

node_idnode-book_procedural-3d-modeling-using-geometry-nodes-in-blender_chapter-12-constructing-a-procedural-led-panel
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num12
chapter_titleConstructing a Procedural LED Panel
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Chapter 12 — Constructing a Procedural LED Panel

Section titled “Chapter 12 — Constructing a Procedural LED Panel”

In the previous chapter, we learned how to create a procedural wall generator using Geometry Nodes.

We will start this chapter by explaining what named attributes are. You’ll then learn how to create a procedural LED panel by using named attributes. We will need these named attributes to save attributes inside our Blender project so that we can link various Blender workspaces together.

But before that, these are the topics we will cover in this chapter:

  • What are named attributes?
  • How do LED panels work?
  • Creating the node tree
  • Adding group inputs to the node tree

Some figures in this chapter show the full Blender setup, including node trees, outcomes, and parameter settings. For easier viewing and readability, these figures are also available in the book’s GitHub repository.

You can find the exercise from this chapter in the common .blend file in the GitHub repository.

Named attributes can be thought of as variables inside your Blender project. They can store data for you in the form of the different datatypes, including but not limited to Float, Integer, Vector, Color, and Boolean.

As these variables are project-wide, we can use them to link various workspaces together.

A lot of things are controlled using attributes – for example, the Geometry Node editor, the Material node editor, and some entries in the Physics simulator in Blender. In this exercise, we will be using them to link the Geometry Node editor and the Material node editor.

The node that we’ll be using to store these named attributes is called the Store Named Attribute node.

The Store Named Attribute node will store the result of a value on Geometry in an attribute name. The geometry on which this information is stored depends on the Geometry input socket.. In Figure 12.1, you’ll see the Store Named Attribute node:

Figure 12.1: The Store Named Attribute node

The Geometry output of this node will just output the geometry with the named attribute saved.

Now that you know the techniques we’ll use in this chapter, let’s quickly go over the basics of how LED panels actually work in the real world. This will help you better understand what you’re doing once we start building the node tree.

LED panels come in a lot of shapes and forms; you have OLED, AMOLED, LCD, and a lot more variations of each of these. These panels work by using subpixels to mix colors together.

Subpixels are the underlying colors of your monitors, which are red, green, and blue, often shortened to RGB.

These RGB values can be combined into any color imaginable:

Figure 12.2: RGB mixing

Not all devices use RGB, though; most printers use cyan, magenta, yellow, and key (CMYK) color mixing, since mixing light and mixing dyes work differently.

LED panels work by dimming and brightening each of these R, G, and B subpixels to create the desired color. In Figure 12.3, you can see how LCD pixels are arranged:

Figure 12.3: A subpixel array

Now that we know how an LED panel works, we can start making one in Blender using Geometry Nodes:

  1. Let’s start by opening a brand-new Blender project.
  2. Head over to the Geometry Nodes workspace and add a new node tree to the default cube.
  3. Let’s delete the Group Input node, since we won’t be needing it because we’ll be working with node primitives instead.

Once we’ve done that, we can start creating the node tree.

We will create three subpixels that we will instance using a grid. After that, we will extract the R, G, and B channels from an image to send that information to the Material editor to edit the materials accordingly. Then, we will have a working LED panel.

Now that we know about the techniques that we’re going to use, let’s start by building the node tree we’ll need for this exercise.

Let’s start this exercise by creating a single subpixel:

  1. Start by adding a Grid node.
  2. Since we want three pixels on the X axis, as shown in Figure 12.4, we will need to use a value of 0.333 (1 divided by 3). For our Y axis, we’ll use a height of 1.

Make sure to only use two vertices on each axis. Since we’ll be instancing this object a lot, we do not want to put too much strain on our computer.

This is how the node should look:

Figure 12.4: The Grid node for a subpixel

You can connect this Grid node to the Group Output node to visualize this subpixel.

In the next section, we’ll see how we can instance this grid to the shape of an LED panel.

To execute this step, we’ll need to use another Grid node. This time, we’ll be adding a grid that contains 100 x 100 vertices. The size should be the same as the vertex count. Here’s what that node looks like:

Figure 12.5: The Grid node for instancing

We’ll now be using this grid to instance pixels onto:

  1. Let’s connect this node to the Group Output node to visualize it.

We can see that we now have a square. The only problem is that there are no subpixels visible yet.

  1. To get this node to function as we want it to function, we will need to add an Instance on Points node after the Grid node in Figure 12.6. You will see that everything will disappear. This happens because we have not defined an instance yet.
  2. Then, drag the first Grid node (see Figure 12.6) into the Instance input of the Instance on Points node.

This is how the current node tree should look if you’ve executed these steps successfully:

Figure 12.6: The current node tree

If you take a look at the Viewport, you can see that we have rows of pixels:

Figure 12.7: Rows of pixels

This will be your red channel. In the next section, you’ll be making the green and blue channels.

Let’s now create a channel for every subpixel. We already have the red channel; let us now create the green and blue ones.

Creating the other ones is not as difficult as you might think. We only need to copy the Instance on Points node twice. Don’t forget to connect the two Grid nodes to their respective inputs as we did for the red channel.

Figure 12.8 shows how that should look if you’ve executed the steps correctly:

Figure 12.8: Three Instance on Points nodes

We don’t see anything happening yet; that’s because the other Instance on Points nodes have not been outputted to the Group Output node yet.

Let’s fix that by adding a Join Geometry node to combine the three Instance On Points nodes, as shown in Figure 12.9:

Figure 12.9: Joining the Instance on Points nodes

You will see that, still, nothing is happening.

This is because the three Instance on Points nodes are intersecting with each other. To solve that, we can execute both steps:

  • Drop in a Transform node of 0.333 on the X axis after the second Instance on Points node
  • Drop in a Transform node of 0.666 on the X axis after the third Instance on Points node

This will make the three channels move away from each other in the way that represents an RGB array. Since every subpixel is 0.333 on the X axis, moving them by 0.333 each time will put them side by side.

Figure 12.10 shows how the current node tree should look:

Figure 12.10: Final base mesh node tree

And now, we have the base mesh for the LED panel!

Figure 12.11: The base mesh for the LED panel

In the next section, we will be setting up the named attributes to transfer the color data of each R, G, and B channel to the Material editor.

Storing the RGB values in named attributes

Section titled “Storing the RGB values in named attributes”

So, let’s begin the process of storing the RGB values:

  1. To get started, we first want to use a Realize Instances node to convert the instances we’ve generated to a usable mesh. This is mainly done to avoid issues with storing data on Instances; the Realize Instances node will convert these instances to actual geometry.
  2. Drop in a Realize Instances node after every Instance on Points node.
  3. Let’s now add an Image Texture node. This will allow you to import images into your Geometry Node editor.

Figure 12.12: The Image Texture node

  1. To open an image, you can press the Open button that can be found on the Image Texture node.
  2. You have probably already noticed that this node has a Color output. This output consists of three sub-values: Red, Green, and Blue.

We can separate these values using a Separate Color node (also called Separate RGB in older versions of Blender). We will need to separate these to spread over our R, G, and B channels correctly.

Let’s connect the Image Texture node to the Separate Color node, as shown in Figure 12.13:

Figure 12.13: Image Texture to the RGB values

Now that we have each Red, Green, and Blue value as a separate output, we can put these in the correct named attribute to send this value to the Material editor:

  1. Right after every Realize Instances node, let’s add a Store Named Attribute node. This will allow us to store values.

Figure 12.14: The Store Named Attribute node

  1. You’ll notice that the Store Named Attribute node has a Name socket. This is the name that we’ll use to reference our value to the Material editor. You can think of it as adding an attribute name to your Blender project.

Let’s add the initials shown in Figure 12.15 as the names for each of the Store Named Attribute nodes:

Figure 12.15: The Store Named Attribute names

  1. Make sure that your Store Named Attribute node is set to Face and not Points. This will make sure it uses Face as a guide for where to edit the materials. If you don’t change it, the LED panel won’t work.
  2. When you type in the letters, you’ll see a plus (+) symbol appear. Make sure to press it; otherwise, it won’t be saved as a named attribute:

Figure 12.16: The plus symbol

  1. Lastly, we’ll need to connect the Red, Green, and Blue outputs from the Separate Color node to the Value input of the respective Store Named Attribute nodes. Do this for each of the three channels.

If you have followed these steps correctly, this is how your current node tree should look:

Figure 12.17: The current node tree

Now, we have everything set up to start work on the materials.

Now, it’s time to create materials for our subpixels.

To do this, let’s head to the Shading tab. You might notice that there is a default material called Material. We will not be needing this, so you can remove it using the X button:

Figure 12.18: The default material

Let’s also open the Material Properties panel, which can be found on the right of your screen:

Figure 12.19: The Material Properties panel

Let’s create three materials: Red, Green, and Blue. For each of the RGB materials, follow the following steps:

  1. Delete the default Principled BSDF shader and change it with an Emission shader.
  2. Connect this Emission shader node to the Material Output node.
  3. Set the color of the Emission shader to the color of the subpixel: Red, Green, or Blue.

This is how your Material Properties tab should look:

Figure 12.20: The Material Properties panel

Once you’ve executed these steps correctly, head back to the Geometry Nodes workspace to link these materials to the subpixels:

  1. Drop in a Set Material node after every Store Named Attribute node. This will allow us to set the material of each subpixel separately.
  2. Let’s also select the corresponding material for each of these nodes: Red, Green, and Blue.

If you’ve followed all these steps correctly, this is how your node tree should look:

Figure 12.21: The final node tree

Now, you should be able to see the subpixels of your image, but you might notice that nothing of color appears. This is probably because you’re likely still in the Solid view. To switch your renderer, press the button (marked red) at the top of the screen, as shown in Figure 12.22. This will allow you to switch your view to the Rendered view.

Figure 12.22: Switch to the Rendered view (marked red)

We will now see the subpixels appear. The only problem is that we cannot see our image yet. This is because we still have to link the named attributes to our materials. We will do this in the next section.

Linking the named attributes to the materials

Section titled “Linking the named attributes to the materials”

Let’s now link the named attributes to the materials:

  1. To do this, let’s go back to the Shading workspace and add an Attribute node. This will allow us to read out an attribute.

Figure 12.23: The Attribute node

  1. In the Name socket, add the respective channel name; this will be either r, g, or b, depending on which of the materials you are editing.
  2. After that, all you have to do is connect the Fac (factor) output of the Attribute node to the Strength input of the Emission node:

Figure 12.24: The Material node tree

Do this for every channel. Once you have done that, you can see that your LED panel works!

Figure 12.25: The final result

Our LED panel is now done. We are not totally finished with this exercise, though; we can still add group inputs to make the node tree easier to use.

Now that you’ve successfully made an LED panel, it’s time to add group inputs to your LED panel. This will allow you and end users to easily change and adapt attributes in your Geometry Nodes project.

For this LED panel, we will create group inputs for the most used values in this project. These include the following attributes:

  • Size X
  • Size Y
  • Brightness

Let’s get right into adding these group inputs:

  1. The first step in adding group inputs is, of course, adding the Group Input node. This will allow us to add easy access to the most used attributes right in the modifier stack.
  2. To add the Size X attribute, we just have to take the gray node connection of the Group Input node and drag it to the Size X field of the Grid node (see Figure 12.26).
  3. You’ll see that a new entry will be created on the Group Input node. Take the node connection of this new entry (Size X) and drag it to the Vertices X field as well.

We do this to ensure that Size X and Vertices X are the same value, which is very important in this project because, otherwise, we’ll have overlapping pixels.

Figure 12.26: Size X in Group Input

  1. Now, let’s do the same for Size Y. Drag the gray node connection of the Group Input node to the Size Y field of the Grid node. This will, once again, create a new entry in the Group Input node. Drag the node connection of this new entry to the Vertices Y field as well.

This is how that should look:

Figure 12.27: Group Input resolution

And that’s how you add the option to change the resolution of your LED panel.

Now, let’s add an option to change the brightness:

  1. We can use a Vector Math node, set to Multiply, between the Image Texture node and the Separate Color node.
  2. In the top socket of the Vector Math node, we’ll put the Image Texture node’s Color output.
  3. For the bottom socket, we’ll drag the gray node connection from Group Input to the bottom socket.

If you’ve executed these steps correctly, this is how the Group Input setup should look:

Figure 12.28: The Group Input setup

And that’s how you add group inputs to the LED panel!

If you now take a look at your modifier stack, you’ll see the values that you’ve defined appear:

Figure 12.29: The Geometry Nodes modifier

There is still one more thing we need to do; we need to rename the Vector value Brightness. Along with that, we also want to convert it into a single-value field instead of a three-value field.

To do that, head to the Group options by opening the right-hand side of the Geometry Node editor (which can also be done by pressing N) and clicking on the Group tab.

Let’s select the Vector entry and change its name to Brightness. Let’s also change its data type to Float.

And that’s all there is to it! That’s how you create an LED panel in the Geometry Node editor!

In this chapter, we’ve learned how LED panels work and how to create them in the Geometry Node editor.

We started by creating a pixel array consisting of an R, G, and B row and giving them independent color values using a Store Named Attribute node.

In the next chapter, we’ll take a look at some tips and tricks we can use in the Geometry Node editor. These tips and tricks will show you small operations you can do in the Geometry Node editor to advance and enhance your workflow.