Andrew Shpagin

Ptex general description and questions

63 posts in this topic

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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. :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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,

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Can you render something simple like cube? Just to understand correspondence.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

when using ptex on a low rez mesh , will you get better results by subdividing your mesh to a high poly count before painting, or using a larger map or a bit or both ?

thanks for your help

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

i have to say i am really impressed with ptex and coat in general.

Sorry this has been bugging me, you know it's called 3D-Coat right? Some say 3DC even. But just calling it "coat" sounds weird to me. I'm done, please continue.

Share this post


Link to post
Share on other sites

question on ptex export for renderman, and perhaps this is for Andrew if he reads this.

- is this in place in the current version ?

i thought not, but i then found some ptex export options under the texture menu, i tried them but it hung my machine.

thanks !

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now