I'd like to know how to create a powdered sugar sprinkling like the one shown on top of the cake in the image below. If you could provide a picture of the node setup for a material, that'd be great. Thank you! :)
-
1$\begingroup$ Hello :). What have you tried so far and where exactly are you stuck? $\endgroup$– Jachym MichalSep 12, 2020 at 8:39
-
$\begingroup$ I tried a voronoi texture, but I just got dots lol. $\endgroup$– MmmChezBurgerzSep 12, 2020 at 8:40
-
$\begingroup$ Use a noise texture, scaled to around 80 or so, with the roughness turned up to full. You may also want to adjust the detail value. $\endgroup$– Christopher BennettSep 12, 2020 at 8:52
-
$\begingroup$ blender.stackexchange.com/a/193174/2214 $\endgroup$– vkliduSep 12, 2020 at 15:20
1 Answer
Shader Method
I used a Noise Texture with a Color Ramp set to Constant to generate a sugar sprinkle mask.
Then I mixed some noise into Generated Coordinates and separated out the Z axis. I could then apply another Color Ramp to isolate the top of the cake.
Multiply these two masks together with a Math node and you get a mask that you can use as the Factor of a Mix Shader between your cake and sugar. The top Color Ramp controls the size and density of spots of powdered sugar.
Particle System Method
Instead you could "model" a sugar particle by adding an icosphere. Put it somewhere out of camera view. Give it a suitable material for sugar.
Start a Particle System on your cake. Set it to Hair and under Render select to Render As Object and set the Instance Object to your Icosphere.
Since we're emitting from faces you have to worry somewhat about an even distribution of faces on your object. I didn't bother since this is just an example, and it might be useful to someone to see the consequences of it.
I've marked all the settings I changed to get this result. (Note: Hair Length is the same thing as Normal Velocity. In this case it is in effect a multiplier for your object scale.)
I thought maybe interpolated children would solve the problem automatically. It does not, although it may make it easier to deal with in some cases and it provides an interesting result nonetheless. Also beware that at default settings you'll generate 100x the number of particles on render.
If you want to limit to only a certain region, you can create a Vertex Group either through assignment or Weight Paint mode, and assign this as the Density group of the Particle System.