How to make this glitter material?

Hi guy! I have problem in making this material for cosmetic product!

Here is the original:


and this is my node setup!




I can see the glitter effect but it is not nice, shiny and obvious! I tried to add a bit of bump because as you can see the glitter effect is not flat in original!

Could you please help me out with my node setup :frowning:

Thank you for your time :slight_smile:

1 Like

You might need to add some glare in compositor.

Is there any improvements i can make to the node? because, i believe that the glare will effect the glass as well! (which is something that i donā€™t want)

It depends on what you set your threshold to be on the glare node. Iā€™d also use the ā€œstreaksā€ option.

You could try pushing the RGB values of you glitter above to make them brighter - that way they should outshine the glass reflection when you add the glare node with a high threshold.

I think glitter and glints are a difficult thing to simulate properly. This guy has done a lot of research on such things - take a look down his list of publications. Hopefully some of this stuff may make it into Cycles in the future.

http://people.eecs.berkeley.edu/~lingqi/

First thing to do is to remove the emission shader from the setup! The material youā€™re trying to make is not emissive, itā€™s just reflective! And therefore, the glare intensity should come from the enviroment and not from the material itself.

For this type of materials, I normally use a similar setup as this:


The lightblue node is used to control the scattering of the glitter. Low values make the glitter very soft and compact, high values make it more scattered.
Thought this is a simplified version, some other improvements and details can be used.

5 Likes

Awesome material Secrop :smiley:

Itā€™s not so different from the snow material I posted some time ago. The technic is the same, using the voronoi cell to make the small flakes.

You could add some control on qty of sparkles with a greater node then after the texture

have fun

happy cl

Great! thanks! Although i am not sure if i understand the Combine XYZ, Subtract, Add, Normalize nodes :eek:

tnx for the suggestion

tnx for the suggestion

The output color of the voronoi.cell texture has the particularity of each component (red, green and blue) to be uniformly random between 0 and 1. In this setup I use that color as if it was a vector. If we subtract a new vector (the combineXYZ) with [0.5, 0.5, 0.5] from the output of the voronoi, we get a new vector that has a range that goes from [-0.5,-0.5,-0.5] to [0.5,0.5,0.5]. This is quite usefull, because each cell color is turned in to a random vector that has a direction that can fall in any direction from the origin.

But this alone is not enough, as we donā€™t want vectors that are pointing in the negative direction of the Normal (they would render as black). Thatā€™s why I add the Normal to it, and then normalize it. In the end, the result is a vector that is randomly distributed around the Normal, as the glitter flakes normally are.
The factor of the Add node serves to control how much from the random vector is added to the normal vector.

If I was just to add the voronoi output to the normal, then the result would be pointing mostly to the positive X, Y and Z directions - which is not a very good randomness.

I know the logic may seem a bit strange (mixing colors with vectors, etc), but mathematically speaking it makes sense, and thatā€™s why the result works.
I can later illustrate this, if anyone wants (donā€™t have the time now, but itā€™s fairly easy to do it).

nice math behind this
but I would like the sparkles to be more like emission I guess
brighter
right now looks more like flat color only

but still nice work with vectors
happy cl

Awesome man :slight_smile: thanks for quick reply! now it makes much more sense! also the illustration might be really helpful too (whenever you get a chance)!

If itā€™s not brighter enough, than the problem is with the light. Cycles materials (with some exceptions) should be light independent. Forcing a material thatā€™s not emissive to emit light is not a good approach! It makes the material unusable (without tweeking) in any other scenes.

@alborz, hereā€™s a simple illustration of what is happening: :wink:
http://pasteall.org/pic/show.php?id=119406

oh nice one,i try this as carpaint sparkle :yes:

Yes! thatā€™s my problem as well! that is why i tried to add emission and bump to my original material! But maybe the best way for these materials is post processing in Photoshop (to add extra glare?)

Iā€™ve tried the emissive setup in the past, but no success. One problem with flakes that cannot be solved (if they have very random normals) is that no amount of retroreflectiveness can be simulated, and multibounce between flakes before it reaches it eye would rely on heavy caustics calculations - not something for cycles. Doing any kind of retroreflectiveness at all requires you to actually model it, afaik.

The only semisuccessful attempt Iā€™ve done was doing the voronoi -> anisotropic tangent trick, which can sometimes be added to regular sparkle reflections to get concentrated ā€œcircular highlight of higher intensity sparkleā€. Search for concentric scratches and itā€™ll probably lead you somewhere. I can not wrap my head around why that actually works though :slight_smile:

Another approach might be to render the sparke separately, then increase its contrast before adding it back (in post). Sadly we can not do any tricks to the output after the shading process.

Awesome! thanks man.:cool:

Nice illustration, but what are the vectors like at the start (the textured cube is shown - but the vectors are only shown after they have had 0.5 subtracted).