Hot answers tagged

25

I've spent the past week or so working on basic logic gate implementations in Blender Shader editor. I'm sharing these with the community so anyone who would like to use similar nodes can easily find how to make and use them. They allow for a little more advanced Shader Node behavior without having to resort to OSL or python scripting. Here's an overview of ...


12

Welcome to Blender.SE, UlfR. Finding out a property in Blender is relatively easy. Make sure, you have python tooltips enabled (in the user preferences). Then hover your mouse cursor over the property (in this case the color). A tooltip containing the python command will appear. The property you seek seems to be outputs[0].default_value. def_rgb = bpy....


11

Fract returns the fractional part of a floating-point value, as described by @Merlin, but its treatment of negative fractional parts is not actually the same as Blender's implementaion of Modulo. If you want to see what a mathematical chunk of your shader tree is doing, it can be quite handy to make it generate a graph. Fract: This plane is 8x8 units, ...


10

I divide this Repeller Effect into parts: Offsetting the locations with multiple-object effectors. Changing the direction of arrows with respect to the effectors' location. Part-1: Idea is, we offset the locations (grid-points) using the first effector then use those offsetted grid-points for next the effector with the help of reinitializing option of the ...


10

In order to explain to sockets and their numbering I'll have to explain how Cryptomatte and some aspects of path tracing work. The Idea Cryptomatte generates ID mattes which try to preserve for each pixel of the rendered image what elements of the 3D scene contributed to it. For instance in a render with motion blur, pixels where the moving object and ...


9

A noise texture which fac is clamped by a less than reduces the influence of the second input of the add rgb. More generally: A noise texture is kind of random pixels, specially at high scale. From that, if we clamp its result by a less than or greater than (or colorramp), then you will pick a partial amount of this randomness. In particular here, that ...


9

You can directly undistort footage in the Sequencer, once you have it set up correctly in 2.8. Open up the movie clip editor and open your footage. To properly choose some distorsion value, we will have to be able to preview the result. Go to the top right of the movie clip editor, click on Clip Display and check Render Undistorted. This will give us the ...


9

A Fresnel node can be used as factor for a Mix Shader between a Transparent BSDF and Emission Shader, in order to achieve the glow at grazing angles. The Facing socket from the Layer Weight node allows to add a slight glow for the angles in between. Finally the Is Camera Ray output from the Light Path node is used to only show the emissive material to the ...


8

To have consistent scale, create an Empty in your scene and make it control the texture scale. Create an Empty Edit your material by adding an Input>Texture Coordinate, using the Object socket and linking it to the Empty in the "Object" dropdown Scale (, Rotate, Move) the Empty to make the feature the size you want. This will apply in a coherent way to ...


8

As you already found you way to the node tree, the "Copy data path" option is generally very helpful: Right click on the field you want to access and use the "Copy data path" option. bpy.data.materials['MyMaterial'].node_tree.nodes['RGB'].outputs[0].default_value You can also look at the answers here and here


8

You are using Eevee, the pointiness output only works in cycles atm.


8

This tree divides the UV space into XY cells, and samples the sine of X at every cell to stagger the position of the Y cells. This results in a modified UV space which looks like this: (X->R, Y->G, 0 at the center of each cell) This space can be used to tile any UV-dependent texture in a sine-wave pattern. In this case, we use the output vector as the '...


7

The Bricks node puts out a random-per-brick blend of the two input brick colors, biased at Bias = -1 to Color 1, and Bias = 1 to Color 2. So you can quantize the blend, and map it to colors, as much as you like: I've added a tree which uses the range of colors to switch between completely different textures:


6

You cant set a different texture for array's duplicates. However, you can shift their UVs: As you can see here, I have a texture of 1/3 ratio. Each third has a different pattern. My array is set to make three different duplicates, and to shift their UVs of a third (1/3= 0,333...) on the V axis. The result is quite usable. All you have to do is a texture ...


6

They are default Value nodes (Add> Input> Value), just renamed by user to make node-tree more "understandable". Original node: To rename any node open N-Panel in Node Editor window (press N) and type anything in Label field. Renamed:


6

If you want to set this up per material, you can use the Light Path node to make a material transparent to shadow rays: (Note the Geometry node is not relevant to this first example) with this result... ...but as you can see from the shadow on the floor plane, this is transparent in both directions. If you want to fix that, you can wire in the Geometry ...


6

I'm not sure I can justify every node here mathematically.. top row power node, adjusts variance in star size, multiply node maps into the threshold given by the color ramp... they all interact, but I've found it quite controllable... ...but it's the bottom row, which colors the stars and multiplies the color with the greyscale generated by the top row that ...


6

If you use the Shader to RGB node combined with Greater Than node. You can differentiate between light and shadow to create a cell-shading effect. Simply add a texture to the original Diffuse BSDF, to texture the transition between light and shadow. This is how the effect looks in motion. You can sharpen or smoothen the shadows edge by decreasing the ...


6

Here is how I would solve this problem. I would convert the texture into black and white using a color ramp in the node editor, where the water is black, and the land mass is grey or white (This is because white is the value pops out, black doesn't). You might need to make slight adjustments to the color ramp. (The noise texture in the demonstration should ...


6

Mathematically it should return the fractional part of the number i.e the non whole-number part, but the blender implementation is artistic in it's implementation. For non-negative numbers this is equivalent to using the modulo with a factor of 1.0 For negative numbers it is equivalent to using modulo with a factor of -1.0 The equivalent node setup of the ...


6

If you are wanting to keep their scales relative you could use the math node and multiply each scale value by a factor. For example below, I am doubling the scale of each texture, where the first math node is my factor (highlighted in yellow), and each of the next math nodes are my scale of each texture. Just change the factor in the first math node to ...


5

There is just one trick for this kind of effects: Scene-referred workflow. (i.e. using physically plausible values for emissions and forget). Instead of going through so much contortions, the most effective path is to treat a lightsaber as what it is supposed to be: a saber. of light. So it only takes a high intensity emission shader, using the colour you ...


5

You can add a scalar multiple of cosine of the angle that the vector makes with the x axis to the x component, and similarly with the y component but with the sine of the angle, this will produce: Higher scalar values means more line-like distortion. A radial distortion can be done as follows:


5

Small code that can bring the indication you need. import bpy # Clear all nodes in a mat def clear_material( material ): if material.node_tree: material.node_tree.links.clear() material.node_tree.nodes.clear() # Create a node corresponding to a defined group def instanciate_group( nodes, group_name ): group = nodes.new( type = '...


5

That's a beautiful node setting. I will try to explain some problem first: You shouldn't use emission shader for your output, if the output is Color and you want that color directly show on your screen, please directly connect the Color socket to Output Surface socket. This post elaborated more detail of color output setting What you mean too fast? Human ...


5

You can attach an image to the scale factor. It works pretty fine. "..or into the scale factor of a mapping node, if the texture doesn't have its own 'scale' input" – Robin Betts


5

The Checker texture is 3D. It divides the given texture space into blocks. The Brick texture is 2D. It's calculated in U and V, but just projected through W. So you can map the checker in a 3D space, (here, Object space) but the bricks need some kind of mapping onto 2D surfaces to look like bricks. The default UV map of a cube will do, here. If you'd like ...


4

To wrap a 2d texture seamlessly the 2d coordinates need to become circular in higher dimensional space. Think of it like painting a torus and then cutting it open and folding it flat, only without the distortion. Fortunately the OSL noise functions support more than 3 dimensions. By taking the X and Y components and remapping them we can sample 4D noise in ...


4

2.80 Version. Creates a random grey-scale color and assigns to vertex color for each mesh loose part. Each component of the rgba vector is the same. Can be plugged into factor sockets individually. Sets the face material color of each part to the active material index. Example material used in image above, for the greyscale plug the color attribute node ...


4

I played around a little bit and came up with the following setting for the plastic and the fluid, I think it comes close to the real anti-frost fluid/container and by changing the settings slightly you should get what you want. I would also make the walls thinner, in the corners you can see that there is still quite a lot of plastic


Only top voted, non community-wiki answers of a minimum length are eligible