Hello.
I'm currently exploring Bake Texture ROP and I'm having two problems.
The first one is that I'm trying to bake point colors of a reference mesh into the uv object. I believe that “Surface Unlit Base Color (basecolor)” is best suited for this job because it seems that GameDev Baker uses that and it does work indeed. However when I render it with the Bake Texture ROP itself, mantra outputs basecolor image plane as pure black.
What might be the culprit here?
The second problem happens when I attempt to bake textures of multiple objects (added with UV Render Objects multiparm block). All objects are in the same UDIM tile and use the same material, so nothing special about them. When I bake them, mantra overwrites contents of my output texture file every time it processes each consecutive object, and ultimately leaves me with a texture of the most recently processed object.
Can this can be avoided and how?
A couple of problems with Bake Texture ROP
6949 11 2- ajz3d
- Member
- 478 posts
- Joined: Aug. 2014
- Offline
- jsmack
- Member
- 7809 posts
- Joined: Sept. 2011
- Offline
The bake texture rop can only bake exports that actually exist in the material. If your material does not export ‘basecolor,’ then nothing will appear in that channel. The gamedev baker forces the same material to be applied to everything being baked, and can only bake point color out as the basecolor. Most of the built-in materials export basecolor already, are you using something custom? Perhaps there is something else going on if you are using, for example the principled shader, and it is not exporting the expected value for basecolor.
As for the naming conflict, you have to put the name of the object in the image path, or they will all overwrite each other. see: http://www.sidefx.com/docs/houdini/nodes/out/baketexture.html#object-pattern-matching [www.sidefx.com]
As for the naming conflict, you have to put the name of the object in the image path, or they will all overwrite each other. see: http://www.sidefx.com/docs/houdini/nodes/out/baketexture.html#object-pattern-matching [www.sidefx.com]
- ajz3d
- Member
- 478 posts
- Joined: Aug. 2014
- Offline
Hi @jsmack! Thank you for your reply.
My objects use the following naming convention:
If I enter the following into UV Render Objects multiparm item 1 fields:
Then nothing renders out correctly (even Nt comes out all gray for each object).
That's one problem.
The other one is that with wildcards Mantra bakes textures of each object to a separate file, which is something I do not want.
What I'm after, is an output similar to the internal baker of Substance Painter: while each object is baked separately (Painter's “By Mesh Name” matching), output textures are generated per material/UDIM (ergo number of output textures is independent on the number of objects).
jsmackI had Principled shader assigned to UV objects only. After assigning it also to reference objects, basecolor finally bakes properly. Many thanks!
The bake texture rop can only bake exports that actually exist in the material. If your material does not export ‘basecolor,’ then nothing will appear in that channel. The gamedev baker forces the same material to be applied to everything being baked, and can only bake point color out as the basecolor. Most of the built-in materials export basecolor already, are you using something custom? Perhaps there is something else going on if you are using, for example the principled shader, and it is not exporting the expected value for basecolor.
As for the naming conflict, you have to put the name of the object in the image path, or they will all overwrite each other. see: http://www.sidefx.com/docs/houdini/nodes/out/baketexture.html#object-pattern-matching [www.sidefx.com]Using wildcards produces another two problems on my end.
My objects use the following naming convention:
(object_name)_(retopo|cage|reference)
UV Object 1 : /obj/*_retopo
UV Cage Object 1 : /obj/*_cage
High Res Object 1: /obj/*_reference
Output Picture 1 : $HIP/render/*_%(CHANNEL)s.%(UDIM)d.rat
That's one problem.
The other one is that with wildcards Mantra bakes textures of each object to a separate file, which is something I do not want.
What I'm after, is an output similar to the internal baker of Substance Painter: while each object is baked separately (Painter's “By Mesh Name” matching), output textures are generated per material/UDIM (ergo number of output textures is independent on the number of objects).
- jsmack
- Member
- 7809 posts
- Joined: Sept. 2011
- Offline
The default is to name each texture after the matching object name string. If you need more complex control, you will probably need to look into the shell rop so you can set variables your self to be referenced by the bake texture rop. The wedge rop might get what you need without having to write the scripts yourself, but I find it generally falls short of doing exactly what I need and fall back to the shell rop anyways.
- ajz3d
- Member
- 478 posts
- Joined: Aug. 2014
- Offline
- jsmack
- Member
- 7809 posts
- Joined: Sept. 2011
- Offline
I mean to change the nature of the loop. The bake rop gives an object-centric flow control. Multiple objects are processed independently, the naming follows that structure. To have the naming follow a different structure, you would have to design your own logic.
Processing multiple objects without having the textures correspond specifically to each object doesn't really make sense, since more than one object can share the same material, but will produce different results when baking. If your workflow involves non-overlapping materials, and a single material per object, you could build your own script for naming the output based on the material assigned to the object instead of the object name.
Processing multiple objects without having the textures correspond specifically to each object doesn't really make sense, since more than one object can share the same material, but will produce different results when baking. If your workflow involves non-overlapping materials, and a single material per object, you could build your own script for naming the output based on the material assigned to the object instead of the object name.
- flippingbook
- Member
- 14 posts
- Joined: March 2018
- Offline
jsmack
The bake texture rop can only bake exports that actually exist in the material. If your material does not export ‘basecolor,’ then nothing will appear in that channel. The gamedev baker forces the same material to be applied to everything being baked, and can only bake point color out as the basecolor. Most of the built-in materials export basecolor already, are you using something custom? Perhaps there is something else going on if you are using, for example the principled shader, and it is not exporting the expected value for basecolor.
Was looking for an answer to this and stumbled upon this thread through google. Nice explanation - just realized that my material does not export basecolor…
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
- tamte
- Member
- 8597 posts
- Joined: July 2007
- Offline
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
Here is my take on this problem.
I haven't found a way to get the name primitive attribute inside TOPs.
I am trying to have the name attribute appear on the final render and using another attribute set the resolution of the render so that it is custom for each geo.
i import the geo using the Geometry Import node and use the data extraction tab to bring in the resolution attribute, but it feels like a hack and also when i cook this graph its not working as expected. its a bit confusing, the bake texture rop reads a sop node outside the top network, maybe it should be reading the geo import? i am not sure, but right now when i cook its not working properly
I haven't found a way to get the name primitive attribute inside TOPs.
I am trying to have the name attribute appear on the final render and using another attribute set the resolution of the render so that it is custom for each geo.
i import the geo using the Geometry Import node and use the data extraction tab to bring in the resolution attribute, but it feels like a hack and also when i cook this graph its not working as expected. its a bit confusing, the bake texture rop reads a sop node outside the top network, maybe it should be reading the geo import? i am not sure, but right now when i cook its not working properly
Edited by papsphilip - Sept. 26, 2021 15:13:25
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
-
- Quick Links