Created for other purposes but this noise pattern is quite versatile. In the image below it is used for the chocolate sprinkles but bacteria and some forms of dust is what it originally was intended for:
I know the crust in the image above looks completely fake but that was not what I was focussing on, however, I am still trying the improve the display of the sprinkles themselves because although they are displaced, they still look a bit flat. I think I can improve that by reducing the gloss and darkening the difuse close to the edge of the sprinkles as these edges are lower and receive less light, kinda like AO. But I am interested to hear other suggestions.
i do have the OSL enable in render panel
but not certain what you meant with Camera panel var!
most of the other osl shader works well but not this one!
here is file sample
let me know if you find something wrong
If i may - thanks for posting new ideas. It’s interesting to see examples like these.
I have different results out of the file RickyBlender posted - it mostly works - http://www.pasteall.org/pic/44918. By “mostly” i mean it renders, 32 passes of that plane in 5 min which is, well, slow. I might not have the latest hardware tho.
What is not quite ok is that when i start to breathe during cycles crunching this, blender disappears from my screen leaving this in terminal
While at, i can’t figure out what is the meaning of lines :
vector dp = vector(5,7,11);
...
dp *= 17;
in this OSL script.
Could you comment on these a bit, please?
@eppo: got that error earlier as well I am starting to doubt I’ve posted the correct version. I’ll check it out once I am home ( I have a day job as well :-; )
I wasn’t suspicious for nothing Updated the code in the blog article. Turned out a return statement inside a shader definition is a problem. Tested against W7-64 / r 54202. Encountered this earlier: the distance() function not being completely implemented. Meanwhile that is fixwd (making the workaround in this same sprinkles recipe obsolete in fact). Despite all its versatility OSL is still a bit rough on the edges…
@eppo: about that dp business: If you want to have more than one random value inside a cell, it’s useless to call cellnoise() twice with the same parameter. Therefor you might add large vector to your coordinate and get a different cellnoise value. This way you can get a set of random values that is the same within a given cell. To make them appear oncorrelated when you can see many cells this vector offset should be large and if you use a multiplication factor it helps if that is a prime to reduce patterns. However, the implementation of that here is rather sloppy so don’t pay too much attention to it.
@rickyblender: the cylinder shape is because the distance to a line segment is used to drive the bump height, no splines involved here if you want to produce curvy lines (for your angel hair?) you might produce a random set of points, connected by a spline. unfortunately i cannot spend time on that myself now but if you check my leaf veines shader you will find that the veins are implemented as quadratic splines.
i’ll check if i can find some equation that looks like wavy lines for angel hair
it’s a weird shape but an interesting one
never seen it before
sparkles
can you show a render of sparkles on how it i supposed to look at low density
i did some render and it looks to me that some parts are missing but may be normal behavior!
I refactored the code because the bugs in OSL that needed special treatment are no longer there. Per request I also added a separate output with a random number that is unique for each sprinkle, so now it is possible for example to add a unique color to each of them.