Home Technical Talk

Bake to Vertex Colors without UVs?

polycounter
Offline / Send Message
Davision3D polycounter
Just to clarify I do not want to bake vertex colors to a texture. I want to bake passes like AO and Curvature to the Vertex Color. So the Red of the Vertex Colors could be AO and the Green of the Vertex Colors Curvature and B and A for something else.

I found a Blender plugin but it still needs a UV for the baking process and it freezes forever when it try to use lightmap generated UVs with 500000 polys. This is for importing ca 10 million polygon meshes to UE5 and only using the Vertex Colors to setup a material, using AO and Curvature to do something similiar you can do in Substance Painter with Smart Materials.

Any ideas which programm could do this or what could be a workaround here?


Replies

  • Eric Chadwick
    Hmm I wonder if Knald can do this? I do know it's super fast, GPU accelerated, etc.
    https://docs.knaldtech.com/doku.php?id=knald_release_1_2
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Zbrush seems like the most sensible option for meshes of that density
  • Davision3D
    Offline / Send Message
    Davision3D polycounter
    Hmm I wonder if Knald can do this? I do know it's super fast, GPU accelerated, etc.
    https://docs.knaldtech.com/doku.php?id=knald_release_1_2

    Does not seem to be the case from my search in the dcoumentation.

    poopipe said:
    Zbrush seems like the most sensible option for meshes of that density

    Yea, I tried that. Problem is you are stuck with the masks that Zbrush can generate which are mostly low quality and I'm not sure if the Smoothness can even count as curvature. Also, there is no way to put something in a color channel, just Fill color which will then overwrite the other channels at least partially.
    Or am I missing something?


  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Meshlab might be worth a poke - there's python bindings for it so you can script up a sequence of actions once you've found the ones you want. 

    There's not much out there that'll handle meshes of that size in an efficient manner - largely because there are much more effective ways to get results (i.e textures)
  • kio
    Offline / Send Message
    kio polycounter lvl 16
    you can bake to vertex colors with cycles - no need for an addon/uvs. not really used this so far - but on a quick test it seems to be okayish.
    Guess with this you can basically dump any material color output into vertex colors.

    but yes zbrush might be easier and probably faster ;)
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    @kio how would one set this up though ? There has to a be a spot where on specifies that the attribute to be written to is Col. But how ?

    @Davision3D : otherwise, assuming that you can get the desired pass to show up in Zbrush (for instance by loading it up as a texture), you can definitely bake it to Polypaint there, and then get the information back to Blender by first writing it out as OBJ (to which Zbrush will add the unofficial vertex color data chunk) and then converting it to PLY in Meshlab. And then Blender can import the vertex colors from that (IIRC).


  • kio
    Offline / Send Message
    kio polycounter lvl 16

    @pior pretty simple actually:


  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Well, that tells the object to display the Eevee AO pass as Emit - but how does that relate to baking down this information (or any other color information for that matter, be it either from a texture or anything else really) to vertex color ?

    I feel like there is some sort of hidden feature here (leveraged by the texture to vertex color baking addon that showed up recently), as some documentation refer to a way to toggle the baker from texture mode to vertex mode but I can't seem to find how. Maybe something gets triggered when switching the object to Vertex Paint mode ?

    It's especially odd considering how easy it is to do the inverse operation (baking from vcol to texture).

    BTW @Davision3D, if your goal/need is *only* about vertex color AO, then FAOGen is a great solution. It's very fast, gives great results, and lets you save the AO pass either as texture or as vertex data. And the FBX files it writes are readable directly by Blender. If you have a sample object you'd like to see processed feel free to link it.

    Now whether or not you'll be able to pack things up per RGB channel (to also store curvature) is another question. Blender can generate a decent-ish curvature pass natively but I am not sure how you'd then combine it with the AO pass without having some way to bake things down somehow (assuming that UE can only read one vcol channel. But if it can read multiple just like Blender does, then you could maybe have as many as you need as opposed to RGB packing)
  • kio
    Offline / Send Message
    kio polycounter lvl 16
    You missed half of it, if you look at the render settings (right side top panel) - on the bake tab you can see how it's setup.

    The popover is just to show that it's just vertex colours only, the object doesnt even have a uv channel.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Heya - this seems to be a recent addition, as this Output option ("target : vertex")  is definitely not in 2.91 or 2.83LTS unless I am missing something. Are you using 2.92 or above by any chance ?
  • kio
    Offline / Send Message
    kio polycounter lvl 16
    Yes this is 2.92
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Working perfectly with the latest 2.93 build. Really good to see that they added it in !



    https://www.youtube.com/watch?v=daukdTFRF9o
    (I probably should have used a CombineRGB node rather than a MixRGB/Add but hey, same thing really)
  • Davision3D
    Offline / Send Message
    Davision3D polycounter
    Oh, that works! Thanks for the video!

    I didn't know that is Curvature hidden there, I thought it was just some cavity from the tooltip.

    I guess the only downsides are that I can't make use of the Alpha channel of the Vertex Colors and baking with Cycles is always really slow.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Glad to hear it's working !

    Regarding speed : well, if anything it is always possible to generate the source passes with any other external tool (using textures if needed, with automatic UVs) and then bake that down as vcols later. EZ Baker can even communicate with Toolbag to get the bakes done and imported back in : https://blenderartists.org/t/ez-baker/1245869

    And then as said there's also FAO gen, and Zbrush/3DCoat. Not sure if Xnormal can write down its GPU AO pass as vcols.

    Good luck !
  • Davision3D
    Offline / Send Message
    Davision3D polycounter
    Automatic UVs will be the main bottleneck with meshes that have million of polys. But yea if Cycles gets too slow I'm gonna try using FAO gen.
  • kio
    Offline / Send Message
    kio polycounter lvl 16
    Blender does support alpha in vcol, afaik it's just not really exposed - I've used it on some asset on one of our projects at work. I think I used some add-on for this, but yeah was the usual lowpoly stuff...
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    @kio Can you share what addon you used to bake to alpha? Did you require uvs for this?
  • kio
    Offline / Send Message
    kio polycounter lvl 16
    @melviso I don't think you can do it directly - I used this add-on: https://github.com/andyp123/blender_vertex_color_master

    (Don't know of it works with current blender version)

    Back then I just edited the vcol alpha channel.. but it looks like you could bake to rbg and swap channels around with this?
  • gnoop
    Offline / Send Message
    gnoop sublime tool
    Not sure I understand how  it works in UE5    but aren't UV and baked textures  still necessary for degrading an object in distance?    Isn't  UE still turning  hires geo  into low res in distance  where only vertex color would be no more enough?  in such case  the material would be visibly "live" and moving.      Just asking , never  had a chance to try it yet.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    @kio Thanks a lot for the info. Found this videos on youtube. Just going to leave them here for anyone who might find them useful:
    https://www.youtube.com/watch?v=rnuZF7ayjFk
    https://www.youtube.com/watch?v=ln2TOz_TDpA

    @gnoop Yeah, In the second video towards the end, he shows why it may not be the best approach to use and it's something to be mindful of. Works best from a distance if the vertex color is blurred.
    But if you take a look at this video here.
    https://www.youtube.com/watch?v=frkTqxMPJmQ
    https://80.lv/articles/discussing-the-possibilities-and-drawbacks-of-unreal-engine-5-s-nanite/

    The vertex colors seem to be holding up fine and its obvious the vertex colors has been blurred to hide the vertices shifting. With a detail texture maps, it can even be taken further.

Sign In or Register to comment.