Single-Material MacBeth Chart?

You want a traditional color chart in your scene, it’s probably gonna be a MacBeth Chart – well documented, easy enough to grab or make an image texture. What if you don’t want an image texture? That’s simple, a subdivided plane, twenty-four faces for the color patches and then some borders.

screenshot.2024-07-29 20.31_600x380

MacBethChart_001.blend (161.2 KB)

Now all you need are twenty-five different materials, ack! And it’s not like we can put 'em in collections, they’ll all be in the materials list, all for one card object.

:point_right: Is there a way that a single material can assign twenty-four specified colors to twenty-four specified faces of a single object? Or some other way to accomplish this? Without so much processing bloat that I might as well give up and pack an image texture?

Edited to add: final (as of this edit) material in the blendfile in here, frankenodetrees from rigoletto’s and sozap’s contributions. Special mention to pixelgrip for recommending the Diffuse BSDF.

  • Make a very small image texture that contains nothing but a small sample of each color (rather than the whole chart) and use UV mapping to map each square on the correct color.

  • Do it using vertex colors.

Requires an image texture (however small), which I’m trying to avoid if feasible.

That hadn’t occurred to me! Trying it, I’m reminded that the problem with Vertex Painting is that it paints vertices, not faces, which means the color patches have very blurry edges. My previous experience with Vertex Paint is all mask-making, in which this effect is often helpful. More mesh density will constrain it, maybe enough for what I need – thanks!

More ideas welcome though.

To specify vertex colors, you can separate the edge of the part where the color will apply.

sdgsd.blend (143.1 KB)

How did you do that? 'Cause my attempt uses long 0.000010 m wide faces around each of the color patches to constrain the blur:

MacBethChart_006.blend (189.2 KB)

Ah, I think I figured it out – you ripped each of the color patch faces?

gds

That’s right.
We have separated the square area where the color will fit.

With some math it should even work without vertex colors, only a colorramp.


color_chart.blend (119.4 KB)

That’s the kind of answer I was expecting, a nodetree. However, to be a Macbeth Chart, this needs these specific colors in the arrangement that @oo_1942 Kim and I (and the Wikipedia article) have shown on a rectangle roughly the same aspect ratio as 35mm film. I haven’t figured out a way to get this from Color Ramps. I was also thinking of indexing the faces of the 24 color patches and assigning each a color from maybe 24 RGB nodes (a slog, but I’d only have to do it once), but I can’t figure out how to do it in the Shader Editor (Geometry nodes would, but I’m looking for a single material solution on a single object).

At this point I’m thinking etn249’s Vertex Paint idea is the way to go, although if there’s a better way to get sharp edges on the color patches from that than we’ve come up with so far I’d be interested.

Hello ! That was a fun exercise ! I expanded upon @rigoletto 's idea…

It’s using a single plane with it’s UVs (could use generated coord as well)

Then we snap the UV to form a grid :

Then we can separate X and Y, remap X to a coloramp :

And use Y to isolate the row :

Then add each rows together…

Finally generate this pattern :

And use a greater than on that to create the borders :

Chart.blend (159.0 KB)

Now it’s just a matter of filling the proper colors and you should be good to go unless someone find an even better method !

There we go! I was pretty sure there had to be a way to do that, but I couldn’t wrap my head around the math well enough. Render tests on both this and mine show it renders faster in my startup setup – I’m thinking this is gonna get the checkmark, thanks!

Playing around with it, I’m not finding how to set the border color (I’m going with hex 444444, the photos in Wikipedia show it’s between the values of the last two color patches, but it’s not specified in the docs).

Hum, you can replace the last node with a color mix, the grid thickness as mix factor, one of the color slot at the chart and the other as the dark value you’re after ! You’ll tell me if you need any more help with that…

Could be cool to share the final material, I guess some people might find that useful !

Yep, that’s what I did:

Just what I was thinking:

sozapTest_MacBethChart_007.blend (153.1 KB)

Thanks again for your help, much appreciated! :clap: And everybody here, great ideas, thanks!

I thougt over it and this might be a more simple solution with just two map ranges, by draging the colorramp i can verify it should work.


simple_version.blend (109.1 KB)

Clever ! Looks much more efficient ! Well done !

Okay, this attempt starts with rigoletto’s single-ColorRamp version here. Took some fiddling with both of the Map Range nodes to get a 6x4 grid with indexing that reached the upper right corner (if that can be done better I’d like to see it, I twitched various values until it worked, then stopped). Then a 25-stop ColorRamp, Constant interpolation (last stop is a FF00FF Fuschia warning, only shows up in the color patches if something’s gone wrong).

The patch and card borders are from sozap’s here, although I simplified (IMHO) the card border by reusing some of the patch border nodes.

This isn’t intended to be particularly flexible given that the MacBeth Chart is a standard, but both the Color Patches and thier borders are scaled/positioned off of the same Mapping node, with the card border on its own in case more padding (or whatever) is wanted. The single-face plane object is scaled to a traditional 13 by 9 inches.

MacBethChart_009.blend (173.8 KB)

@sozap , sorry but I think I’ve gotta scrub your checkmark, current hope-this-is-the-final version has too much from both of you. Wanna say again that I appreciate the ideas and help from everyone in the topic, thanks!

Awesome ! I must admit I’m delighted to see how much we can iterate with that simple idea and each time it gets more cleaner and complete !
Well done everyone !

Testing vs an image texture (made it in Inkscape, packed), black World and Emission, orthographic camera, Raw view transform, 16bit Color Depth, tiff and tiff (no compression, so I’m not posting the 5,626k render): according to GIMP’s Color Picker the Color Ramp patches are a perfect match to the rendered image texture.

MacBethChart_010.blend (157.8 KB)

Yeah, me too – couldn’t’ve done it without you guys, thanks again!

Anybody here know the specular IOR of “matte paint applied to smooth paper” on a cardboard backing? Asking the duck hasn’t helped. :duck: Or should I use a Diffuse BSDF node like @pixelgrip has kindly suggested?

Quick reminder that the colors in the ColorRamp stops are copied’n’pasted hexcodes from the Wikipedia article – reasonably accurate, but this thing’s not intended to be more than a familiar but lite check-card that can be added to several hundred material test blendfiles with minimal bloat and without an image texture that could get lost. I don’t mind making it as accurate as feasable, but don’t wanna go overboard.

On that note:

My earlier nodetree vs image texture test seems to indicate that Blender handles any corrections the same for both – if that’s true then it doesn’t seem like I need to worry 'bout this, yes?

I have made tests years ago.If you type in Hex values into Hex color input or if you colorpic sRGB values with the colorpicker then they get corrected by Blender to linear.
The linear RGB values you put in are linear.

But dont get confused.If you want a grey card 18% grey,then just put into the RGB values 0.18,0.18,0.18
If you have CM set to Display sRGB with maybe Standard view.then your view does OETF like a gamma curve.So that your 0.18 linear RGB value now get displayed as middle grey 0.5,but is still linear 0.18 as you put in.

If you export you render as EXR then it stores your render with work space linear rec709,and a white point of D65.
You can if you want overwrite this setting if you want to store a EXR with the CM tonemapping baked in.

There are many different kinds of paint, made from different materials, so likely no single correct answer. Also, I wouldn’t be surprised if different colors had a a slightly different value because the pigments are made of different materials. But, I would think values in the 1.4 - 1.5 range would be the most plausible, as that’s where you find plastics and lots of similar materials.

If you are going for realism, I wouldn’t use a diffuse BSDF, as that is an incomplete material with no reflections (diffuse, glossy etc. are bricks meant to be assembled together to make more complex materials.).