1
$\begingroup$

I made a Donut in Blender and I did the Sprinkles with Geometry Nodes.

As Base for the sprinkles there are 5 deformed Cylinders which are placed randomly on top. The Material for these Cylinders is equal and is set to choose a random color, which it does perfectly, as you can see.

I want to export the whole thing as a single mesh for using it in unreal engine. My problem now is, that I actually cant get it to work. If I export the Donut as it is right now, the Sprinkles arent there in the fbx file. If I apply the modifier (which isnt really the sense of it, since I want to make changes later), the sprinkles disappear inside Blender.

I can make the Instances real, which works perfectly fine. I can export now, but of course have then more then 500 different Models, and also the sprinkles havent got any color, which is weird. If I join them (CTRL + J), I have a model in Blender which looks like this:

It seems to have distribute the random color not on the different cylinders, but on each of them.

Does somebody knows what there is to do? If somebody wants to see it, here is a picture of my Geometry Node System

And here of my Shader

If somebody could help me and probably some others since the feature is relativly new, I would be very grateful.

Thank you!

$\endgroup$
2
  • $\begingroup$ Hi! Welcome. For future reference, it pays to link the tutorial you're following. However, because this one is so famous I think you'll get away with it. In fact, it being so famous is the sole reason I know you've followed it ;) $\endgroup$
    – Onyx
    Mar 16, 2022 at 12:10
  • $\begingroup$ Yes, everyone knows it :D But alright, link it anyway, its from BlenderGuru, Blender 3.0 Tutorial on youtube. youtube.com/… $\endgroup$
    – debaser36
    Mar 16, 2022 at 12:12

4 Answers 4

1
$\begingroup$

It's not possible at the moment. I wanted to suggest using UV for this task, but this issue prevents this: https://developer.blender.org/T85962

So as workaround, I suggest creating several objects for sprinkles with different colors and move them into separate collection. Then you can use this collection to distribute different colors:

enter image description here

Full node setup:

enter image description here

This is the easiest way to solve the problem as for now.

$\endgroup$
3
  • $\begingroup$ Thank you very much. So the actual problem lies within the random color I assign? $\endgroup$
    – debaser36
    Mar 16, 2022 at 13:17
  • $\begingroup$ Only thing that you can save in FBX is UV maps. You cannot save attributes, they are not existed is FBX format. $\endgroup$
    – Crantisz
    Mar 16, 2022 at 13:19
  • $\begingroup$ So as soon as I work with "randomness" in my shaders, it wont export them? $\endgroup$
    – debaser36
    Mar 16, 2022 at 13:33
0
$\begingroup$

Here's what you can do:

  1. Add realize instances geometry node to make sprinkles part of mesh
  2. apply modifiers (backup glazing if you want to modify it later)
  3. go to edit mode and separate sprinkles from donut (AA --> P --> Loose parts) (this step is to fix sprinkles sharing same color)
  4. after separation parent everything to donut base and export - as all parts of mesh will be parented to donut base it should be easy to use in game engine
$\endgroup$
1
  • $\begingroup$ Thats actually better then anything ive got so far. But the Cylinders are still colorless when exported. Is there some setting I have to use? I also tried joining them (even I am not exactly sure what this is, I thought its combining all the polygons into one mesh, is that right) But when I join them, the cylinders are just green inside blender! $\endgroup$
    – debaser36
    Mar 16, 2022 at 13:07
0
$\begingroup$

You can bake the sprinkles as a texture and a bump map, that way you can get them exactly how you want (colorwise) without the added load of millions of polygons

$\endgroup$
1
  • $\begingroup$ Could you elaborate or maybe link some tutorial to this? I am relativly new. But thank you! $\endgroup$
    – debaser36
    Mar 16, 2022 at 13:19
0
$\begingroup$

I watched some more tutorials and actually found a very elegant solution. Its the one, josephhasen proposed earlier, but I want to explain it more precise, so that it may help some "newbies" like me!

  • In geometry node setup, make sure, that there are Instances on the points, not just references.
  • For easier handling, make a new collection and store your mesh inside it.
  • Select the mesh, search (F3) for make instances real, click it
  • All the instances on your mesh will be under your mesh
  • then you can bake: In shading add 2 image textures, one for normals one for colors, dont connect them with anything, create new images in the right size (1024*1024 or products of that, base 2)
  • select the node where you want to bake your first texture
  • goto scene settings, select Cycles, goto Bake, for Colors select Bake Type "Combined", for Normals "Normal"
  • under Selected to Active, find good settings, for me it did good on 0.05m for Extrusion and Max Ray Distance, and 2px for the size.
  • Hit Bake, save Picture (UV Editor), connect Nodes properly.
  • of course make sure, that you UV unwrapped the mesh!

Baking takes a while, its will get a lot faster, if the selected Tile Size in Performance is set equally to the resolution of the Texture. Lower samples will also reduce the time needed, but Quality will get lost.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .