Jump to content
3DCoat Forums

Ptex general description and questions


Andrew Shpagin
 Share

Recommended Posts

This topic is dedicated to general Ptex description related to 3D-Coat

- Ptex is special kind of mapping where texture 2^n x 2^m is associated with each face. Resolution of each face can be changed dynamically.

- Ptex is very close to microvertex approach because of in microvertex approach patch N x M was associates with every face.

- The big advantages over microvertex painting are - not need UV, every pixel on texture correspond to only one vertex on the patch, it results with much better painting quality.

- Ptex is good for subdivision surface but bad for objects with irregular surfaces that become wrong after subdivision. Currently only quads are supported in 3DC, maybe I will support triangles later.

- Ptex can be set in correspondence with UV-mapping approach because all small textures will be placed on several big textures, so 3DC can export object and textures to be used in any other game/render package. Seamlessness is provided because every patch/small texture is placed on big texture with 1-pixel wide border composed in special way to imitate filtering.

- Objects exported using Ptex can be used in games but it is not too efficient now because every face will produce 4 vertices (instead of 1-2) that will be brought to render engine. This is not too critical issue, but anyway it will give some small speed penalty. Of course game engine can be optimised to avoid this problem using geometry shader but it needs some improvements of engines itself. Anyway, it will work in game engines, it is just performance warning. If proper optimisation will be made in game engines this technique can be used to show displaced objects in close look very well. For example if game engine will get on input 3 streams (vertex position + quad indices + patch parameters) instead of 2(vertex coordinates and uv + triangles indices) then rendering can be performed even in more efficient way.

- Objects can be used in any usual render engines/3D-packages without seams due to reason that was mentioned before (specially filtered border).

- If near future native Ptex export/import will be done too but it is not too critical because of seams problem is almost not existing there.

- Ptex is ideal for baking from voxels to painting approach because there will not exist any uv-overlap issues that are just impossible in this approach.

  • Like 1
Link to comment
Share on other sites

  • Advanced Member

Hi Andrew.

I posted this in another thread but I guess this one is probably more appropriate now.

I am trying to get a voxel sculpt which I have retopo'd (with perfect quad's by the way) to work in ptex but I am having issues.

I have tried all of the options in the retopo room "merge model into scene with ptex", "merge hull with ptex", "merge patch with ptex" but they all hate me. :rolleyes::)

The model appears in the paint room as it should with its normal map but when I paint it, it's ugly and shows artifacts.

I opened up the UV room and I noticed a massive cluster of squares didn't exist.

The same process works great with the per pixel painting method by the way but ptex will massively speed up my work flow if it will work in this way as it will cut out any messing around with UV's.

Ptext works amazingly if i import a mesh on its own.

Hmmmmm, I just tested it again with a sphere and quadrangulate and it worked with no issues...... Maybe its my mesh or something I have done in the retopo process.

Thank you for this.

Edited by Marc Wakefield
Link to comment
Share on other sites

  • Contributor

Andrew,I got a question for you regarding Ptex and game engines.

Somebody told me once(a few years ago) that maps that were composed of big number of small tiles should not to be used in game engines because

the camera has problem with the tiles when the model is far away.Is it still relevant today?

Link to comment
Share on other sites

Andrew,I got a question for you regarding Ptex and game engines.

Somebody told me once(a few years ago) that maps that were composed of big number of small tiles should not to be used in game engines because

the camera has problem with the tiles when the model is far away.Is it still relevant today?

Yes, I agree. Mip-mapping really becomes a problem with number of tiles.

The only possible solution that I see there is to use patches (2^n-2) x (2^m-2) instead 2^n x 2^m to avoid problem with mip-mapping.

Other way - try to unify patches whenever possible and avoid existence of too many islands.

Link to comment
Share on other sites

  • Contributor

Yes, I agree. Mip-mapping really becomes a problem with number of tiles.

The only possible solution that I see there is to use patches (2^n-2) x (2^m-2) instead 2^n x 2^m to avoid problem with mip-mapping.

Other way - try to unify patches whenever possible and avoid existence of too many islands.

Alright,Thanks for answer...The industry will probably adapt to this and implement game engine features to go along.

Anyway, within 3DCoat itself its very powerful,its like it was invented to go along Voxels and Quadrangulation. :brush:

Very complementary. :)

Link to comment
Share on other sites

  • Advanced Member

Yes, I agree. Mip-mapping really becomes a problem with number of tiles.

The only possible solution that I see there is to use patches (2^n-2) x (2^m-2) instead 2^n x 2^m to avoid problem with mip-mapping.

Other way - try to unify patches whenever possible and avoid existence of too many islands.

I'm not sure what the equation means, could anyone give an example?

Well anyway I've done testing with it in Blender Game Engine as well as Visual3d.net and I haven't encountered any problems with rendering or noticed any performance issues so far. Works very well, extremely well. Never thought that UV unwrapping would become completely unnecessary.

Link to comment
Share on other sites

  • Advanced Member

I tested it and it works fine... If you will send me the object I will test and find the reason.

Hi Andrew,

I tried the object again and used quadrangulate for ptex and it worked fine. I guess I must have messed up on the retopo somewhere.

Thank you anyway.

There is one thing though... When you quadrangulate for per pixel you get the option to bake a local occlusion map and this produces a really nice result as a base for painting.

Can this be done in ptex? I didn't see the option.

Cheers,

Link to comment
Share on other sites

  • 4 weeks later...
  • Advanced Member

Hi Andrew,

Now that native .ptx is available (thanks!) could you please elaborate on how the poly mapping to Ptex tile is done?

I've tried exporting .obj and .ply but in neither case does the texture apply correctly in the renderer. It seems like the naive polygon mapping (polygon 0 == tile 0) isn't correct?

Cheers,

Peter B

Link to comment
Share on other sites

Hi Andrew,

Now that native .ptx is available (thanks!) could you please elaborate on how the poly mapping to Ptex tile is done?

I've tried exporting .obj and .ply but in neither case does the texture apply correctly in the renderer. It seems like the naive polygon mapping (polygon 0 == tile 0) isn't correct?

Cheers,

Peter B

Correspondence is 1:1 (polygon 0 == tile 0). But you should use same model in 3dc and in other renderer. Polycount should be the same. So if you subdivided the model during import in 3dc, exported ptx, imported source object and ptx in renderer it will not work. You should use same cage in both - 3dc and renderer.

Link to comment
Share on other sites

  • Advanced Member

Hi Andrew,

Yes, this is what I'm doing. The tile count on the Ptex image and the polycount of the geometry are identical when I'm rendering.

It might be that when I load .obj into my package it's reordering the polygons or something. I will see if I can test further somehow.

It might be very useful to have a "diagnostic" output that outputs the tile number on each tile (of course, if the texture is too low res you won't be able to read it!) for helping to figure these types of problems out. I will try something where I paint on a known tile and see where it shows up on the object at render time.

Cheers,

Peter B

Correspondence is 1:1 (polygon 0 == tile 0). But you should use same model in 3dc and in other renderer. Polycount should be the same. So if you subdivided the model during import in 3dc, exported ptx, imported source object and ptx in renderer it will not work. You should use same cage in both - 3dc and renderer.

Link to comment
Share on other sites

  • 2 weeks later...
  • Member

i wanted to start a own thread for this but than i saw this one - hope its right here

aren't uv's indispensable after all?

While Ptex in 3D-Coat is very useful for 3d painting - i dont see how i can refrain from using Uv-mapping for tiled textures

first of all when using uv-maps the texture itself stays at same resolution, while in ptex i would have to increse the resolution of all faces extremly high to nearly lossless tile-paint the texture on the model - which extremly slow's down the computer (even if you have 8GB Ram)

But in the demonstrations video from Ptex they had have an extremly high texel resolution per face and still where able to paint smoothly - am i'm doing something wrong?

also in the video they showed a flatten function for selected faces - is this going to be in the next final release of 3d-Coat?

second - how does ptex handle, or can you even apply procedural textures e.g. Noise, wood, marble?

Link to comment
Share on other sites

  • Member

Hi Andrew and all,

First time poster here.

It's great to see active development for ptex in 3D-Coat.

Is there going to be direct-to-RenderMan support for models created in 3D-Coat (i.e. .rib export)?

I'm asking because when rendering ptex for subdivision surface, RenderMan requires a "faceindex" data on the .rib model.

"faceindex" specifies the edge/face (not sure which) connectivity. If 3D-Coat will have .rib export with the faceindex data, it'll be very helpful.

Link to comment
Share on other sites

  • 2 months later...
  • Advanced Member

Congrats on the update Andrew - just d-loaded 3.3 and it looks great.

I haven't been using 3DC of much late (no call for texture painting on recent stuff) but was having a play with Ptex again. I am not clear on how I can paint using Ptex mode and export to "normal" textures. If I import a model for ptex painting I don't seem to get the UV set on the model, and when I export the texture (texture\export\diffuse map) I can only choose among the ptex sets.

What is the workflow for doing this so I can paint with Ptex but end up with maps renderable in Vray etc.?

Thanks in advance /b

Link to comment
Share on other sites

  • 3 months later...
  • Member

i am finding it difficult to find good documentation on the subject but how does Ptex work in a character animation pipeline? For example would the following work ?

create a voxel model

retopo this voxel model, creating a low rez model with perfect quads

ptex paint the low rez model ( or do you work with high rez ? ?

export to cinema 4d

model would be rigged and animated in c4d, smoothing ( hypernurbs ) would be done in c4d also at render time.

thanks

pete

Link to comment
Share on other sites

Robot Bob:

I have not tested this specifically with Cinema 4D, but, in theory, the pipeline you suggest should work in any 3D application that can read a regular UV map. Andrew has made the UV mapping function so that it converts whatever work you do with Ptex, automatically, to a standard UV map that can be read by any program that uses UV's. I know this works with Blender, flawlessly.

For example, if you run the AUTOPO algorithm on a voxel model that you have made, and, from the Retopo Room, choose "Merge into scene with Ptex", you will enter a dialog that requires you to choose from a variety of resulting mesh resolutions. The choice with the least subdivision is subdividing the AUTOPO mesh, (as it appears in the Retopo Room), only once, and this usually works fine.

Just make sure, for the time being, that you do 3 things before choosing "Merge into scene with Ptex": 1) Turn symmetry on, (if your mesh was created with symmetry). 2) Choose "Apply symmetry to current layer". 3) Turn symmetry off. This guarantees everything will work properly. (Andrew knows that this needs to be corrected and is working on it).

Greg Smith

Link to comment
Share on other sites

  • Member

thanks for the reply, i just had a stupidly fun time painting one of the coat test models, and put it to cinema - it worked incredibly well. colour and displacement. What i was most worried about was working with a low rez model, smoothed in c4d, and seeing seams or the textures not working at all, i do see seams in the normal map, but i remember reading somewhere about MIP sampling so ill look into that.

coat did a fantastic job. I am really liking this program.

Link to comment
Share on other sites

Robot Bob:

Both things will help. Of course, the texture maps really only need be larger than 4K if you plan to use Ptex to "Increase Resolution" on any specific area of the mesh. If you really just want a fast and convenient way to start texturing an ordinary model, then 4K should be sufficient.

I know that normal maps are a problem with some applications, but I'm just not sure if all of the individual problems for each app have been categorized anywhere. So many apps, so few beta testers.

Greg Smith

Link to comment
Share on other sites

  • Member

ok thanks. i have to say i am really impressed with ptex and coat in general. its a pity that normal or bump maps dont work so well until we get .ptex export and can use it in a render-man compliant renderers. for any cinema users that happen to read this be sure to activate the round geometry option in the displacement channel then sub-poly displacement seems to work perfectly. very cool.

Link to comment
Share on other sites

  • Member

first of all congratulations on the 3.5 new release, and apologies that i may be repeating my ptex questions in this thread but i am hoping to look at the ptex to renderman workflow but cant find the answers in the manual and my tests have hung my machine. so my specific questions are below

is there an export option in the standard export settings for ptex ?

or do you export the model and textures from under the texture menu to ptex ? if so do you go thru and export each texture and object one by one ?

is export absolute positions to ptex the correct option to export the mesh ?

and if so would the correct workflow be to work with the low rez mesh during painting ( not subdivided ) on import into 3DC so that 3DC does not export a high poly mesh that is unusable for animation to the ptex file ?

thanks for any help

p

Link to comment
Share on other sites

  • Applink Developer

Hi robotbob.

I have been playing with Ptex in houdini so I don't know how well I can help you in your situation.

What I understand you only need to use basic export model button to get the Ptex model out. Then export

all your Ptex textures out one by one. If this is your first time I would suggest to export one texture and get

it work, like color texture. When you get that to work let's then move on and consider the other questions as well.

It would be nice to have you as a friend of testing Ptex. I have that promlem right now that I'm getting nice color Ptex

but not disp ptex. I would love to hear the result of your test about this issue.

Link to comment
Share on other sites

  • Advanced Member

Well I thought Ptex could only deal with Quads, But hey presto I just loaded, by accident, an object composed completely of triangles. Can Ptex now support Tri's? Or was this just because The characteristics of the object(Sphere) allowed this.

Link to comment
Share on other sites

  • Advanced Member

Oh! Ok, I was thinking they had to be quads before import. :pardon: But Importing Tri models, will this always work, or does there have to be an even number of verticies or something for it to work?

Link to comment
Share on other sites

No, theoretically any model should be fine. See in my little example below. If you start with a triangle surrounded by quads. The subdivision puts a point in the middle of the triangle when it subdivides. So your triangle becomes 3 quads and all of the quads become 4 quads.

2010-09-23_0929.png

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...