Saya Posted September 17, 2019 Share Posted September 17, 2019 Hi, I'm looking for a method to bake foliage like gras patches onto a plane. I know how to approach this within Maya but I haven't been able to do so in Houdini. Ive also looked at the game dev baking node but without succes for baking geometry onto a plane. What are my others options, could someone please elaborate or point me into a direction. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted September 17, 2019 Share Posted September 17, 2019 (edited) What do you mean by baking ? You want to output a displacement map ? If you want to bake a disp map, you need a Bake Texture ROP (OUT context), indicate your high rez object and the low rez object - also called UV render object - (who gets propoer UV), and then check the Displacement or Vector Displacement output in the Images / Main part of the node. You need to tell which rez you wants your map, and you can select various "look up" options between high rez and low rez object (called Unwrap method). I guess yours would be by Trace closest surface but you can use a UV matching option if you work on objects that were created from a subdivided low rez object and that the UV didn't changed (like to get disp map from sculpting details on a subdivided object in ZBrush). Then you hit render button. Hope this helps you a bit, but for grass, I would go with point instancing if that's for rendering. If that's for a realtime render engine and you want to bake a map, of course that's different :-) Edited September 17, 2019 by StepbyStepVFX 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted September 18, 2019 Share Posted September 18, 2019 (edited) Hi Marco, you can build your own planar baking tool inside SOPs and COPs: Scale object to unit size with 1 / max(max($SIZEX, $SIZEY), $SIZEZ) in a transform node. Shoot rays at the mesh from COPs with the intersect() function. Grab the UV coordinates via primuv(). Transfer any kind of texture map values by using colormap(). This also works for geometry attributes such as normals, depth or bounding box info. Here is the minimalist code (to be used in a COP snippet inside a VOPCOP2GEN node): string geo = 'op:/obj/geo1/OUT'; string tex = '/Users/konstantin/maske_rot_Map_Albedo_4K.jpg'; vector pos_img = set(X, Y, 0.0); vector dir_ray = set(0, 0, 1); vector pos_world; vector uvw_prim; int prim_mesh = intersect(geo, pos_img, dir_ray, pos_world, uvw_prim); vector uvw_mesh = primuv(geo, 'uv', prim_mesh, uvw_prim); vector map = colormap(tex, uvw_mesh); vector color = map; R = color.r; G = color.g; B = color.b; A = prim_mesh != -1; baker.hipnc Edited September 18, 2019 by konstantin magnus 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.