Not getting BakeTexture to work with PTEX

   2562   4   3
User Avatar
Member
123 posts
Joined: Jan. 2015
Offline
Hello

i'm trying to get the BakeTexture to bake out PTEX, but get allot of issues with the faces not showing the correct texture from the bake. If i bake on a sphere from Houdini i get a different result from when i bake on a Sphere exported from Maya and imported as OBJ file.

Baked texture on a sphere made with Houdini. (PTEX on the left)




Baked obj from Maya, (PTEX on the left)



The image under is the same sphere and ptex map used with xgen.





There just so much funky business going on with ptex baking, i have now idea what can be wrong at the moment.

anyone got any experience with PTEX baking here, that can guide me in the right direction? or is this just bugs with PTEX in Houdini?

I have made a example file that's in the attachment
Edited by Heileif - Aug. 24, 2018 09:52:09

Attachments:
sphere_from_maya_in_maya_applied_with_xgen.png (379.0 KB)
sphere_from_houdini.PNG (454.8 KB)
sphere_from_maya.PNG (388.2 KB)
Bake_Texture_Ptex.hip (495.1 KB)

User Avatar
Staff
418 posts
Joined: Sept. 2016
Offline
Due to the requirement that all ptex faces must be quads (http://www.sidefx.com/docs/houdini/shade/ptex.html), mantra will split non-quads into quads when baking into ptex, ending up with different number of faces than the original mesh. Unfortunately GetPTextureID VOP simply returns primitive index if the object is not subd. So when you use ptex texture on an object that has triangles, primitive index won't match up with what's inside ptex and the renders will appear incorrect.

A workaround is to enable subd on the object being rendered (using “Mantra catmull-clark” style).
User Avatar
Member
123 posts
Joined: Jan. 2015
Offline
dlee
Due to the requirement that all ptex faces must be quads (http://www.sidefx.com/docs/houdini/shade/ptex.html), mantra will split non-quads into quads when baking into ptex, ending up with different number of faces than the original mesh. Unfortunately GetPTextureID VOP simply returns primitive index if the object is not subd. So when you use ptex texture on an object that has triangles, primitive index won't match up with what's inside ptex and the renders will appear incorrect.

A workaround is to enable subd on the object being rendered (using “Mantra catmull-clark” style).

Thank you for the help!

Your workaround fixed some of the issues i had, it's total fix with a sphere made in Houdini.

Houdini sphere before Render Polygons As Subidivision (ptex to the left)

Houdini sphere after Render Polygons As Subidivision (ptex to the left)

But with a sphere imported from Maya(obj) there are issues again i have tried to delete all the attributes on it, but not the uv, still not working.

The same thing happens when people are using Houdini Engine to bake PTEX maps in maya with a tool i made. The textures are going to get used with Xgen. I have no idea whats going on

Really appreciate all the help i can get.

The sphere from Maya is in the attachments, and updated hip file if it helps.
Edited by Heileif - Aug. 27, 2018 11:54:03

Attachments:
sphere_from_houdini_02.PNG (364.6 KB)
sphere_from_houdini_03.PNG (370.4 KB)
sphere_from_maya_02.PNG (271.1 KB)
sphereUV.obj (50.0 KB)
Bake_Texture_Ptex_02.hip (481.1 KB)

User Avatar
Staff
418 posts
Joined: Sept. 2016
Offline
Texture VOP is using UV coordinate as face S/T when UV attribute exists, even for PTex. You can delete the UV attribute to get around the issue, or (if you need to keep the UV attribute for other uses), you can wire shading global's S/T into Texture VOP's UV input (using Float to Vector VOP, set S as first component and set T as second component).
User Avatar
Member
123 posts
Joined: Jan. 2015
Offline
dlee
Texture VOP is using UV coordinate as face S/T when UV attribute exists, even for PTex. You can delete the UV attribute to get around the issue, or (if you need to keep the UV attribute for other uses), you can wire shading global's S/T into Texture VOP's UV input (using Float to Vector VOP, set S as first component and set T as second component).

Thank you for the help again!

Your fix to rename the uv attribute worked like a charm in Houdini, but when i use the same Digital Asset in Maya with Houdini Engine the artifact appear again

It happens in Maya when importing geo straight with a objectMerge node.

I also tried to build a rop_alembic inside the tool that export out an Alembic file. Then the file is imported again, with a wrangle step that renames uv attribute, last step is a baketexture that will make the PTEX.

The PTEX bake only works if i do the alembic export step in Houdini, and import it inside Maya and press bake texture.

But if i do all the steps inside Maya with the Digital Asset the PTEX file wont work, just get a constant color on each face like earlier.

so now i'm stuck again


Do you have some wisdom to share again? or is it some kind of limitation with how Maya sends geo to Houdini that makes this hard to do?
  • Quick Links