Jump to content


Notice about Feature Requests & Bug Reports

The bug reporting and feature request forums (except for the Urgent Help section) are going away soon! Please use Mantis to report any bugs and feature requests. the link to Mantis is:
3d-coat.com/mantis/

Read more about it HERE.

Photo

Ptex general description and questions


  • Please log in to reply
62 replies to this topic

#1 Andrew Shpagin

Andrew Shpagin

    3DC creator & admin

  • 3D-Coat Developer
  • PipPipPipPipPipPip
  • 6,587 posts

  • Gender:Male

Posted 05 February 2010 - 11:00 AM

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.

#2 Marc Wakefield

Marc Wakefield

    Novice

  • Member
  • PipPip
  • 241 posts
  • Gender:Male
  • Location:Hertfordshire

Posted 05 February 2010 - 12:02 PM

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, 05 February 2010 - 12:26 PM.

Marc Wakefield
mrm design
web ........ web design by mrmdesign

web ........ alchemy design resources
web ........ www.marcwakefield.co.uk
twitter ..... mrm_design
email ....... marc(at)mrmdesign.com


#3 Andrew Shpagin

Andrew Shpagin

    3DC creator & admin

  • 3D-Coat Developer
  • PipPipPipPipPipPip
  • 6,587 posts

  • Gender:Male

Posted 05 February 2010 - 03:47 PM

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

#4 artman

artman

    Expert

  • Contributor
  • PipPipPipPipPip
  • 2,073 posts
  • Gender:Male
  • Location:quebec,canada
  • Interests:Henri Corbin
    Brian Wilson
    Hikaru No Go
    Noah23
    and 3DCoat.

Posted 05 February 2010 - 04:00 PM

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?
Lest limbs be reddened and rent--I spring the trap that is set--As I loose the snare you may glimpse me there--For surely you shall forget
"The Wind In the Willows", Chapter 7 "The Piper at the Gates Of Dawn"

#5 Andrew Shpagin

Andrew Shpagin

    3DC creator & admin

  • 3D-Coat Developer
  • PipPipPipPipPipPip
  • 6,587 posts

  • Gender:Male

Posted 05 February 2010 - 04:13 PM

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.

#6 artman

artman

    Expert

  • Contributor
  • PipPipPipPipPip
  • 2,073 posts
  • Gender:Male
  • Location:quebec,canada
  • Interests:Henri Corbin
    Brian Wilson
    Hikaru No Go
    Noah23
    and 3DCoat.

Posted 05 February 2010 - 04:21 PM

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. :)
Lest limbs be reddened and rent--I spring the trap that is set--As I loose the snare you may glimpse me there--For surely you shall forget
"The Wind In the Willows", Chapter 7 "The Piper at the Gates Of Dawn"

#7 kay_Eva

kay_Eva

    Apprentice

  • Member
  • PipPipPip
  • 629 posts

Posted 05 February 2010 - 11:14 PM

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.
"Uploading 08O. But problem - no electricity now. Notebook shows 35 min to the end of power, upload - 30. Who will be the first? :)"

#8 Marc Wakefield

Marc Wakefield

    Novice

  • Member
  • PipPip
  • 241 posts
  • Gender:Male
  • Location:Hertfordshire

Posted 05 February 2010 - 11:37 PM

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,

Marc Wakefield
mrm design
web ........ web design by mrmdesign

web ........ alchemy design resources
web ........ www.marcwakefield.co.uk
twitter ..... mrm_design
email ....... marc(at)mrmdesign.com


#9 pbowmar

pbowmar

    Novice

  • Member
  • PipPip
  • 138 posts
  • Gender:Male
  • Location:Vancouver, BC, Canada

Posted 28 February 2010 - 06:53 AM

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

#10 Andrew Shpagin

Andrew Shpagin

    3DC creator & admin

  • 3D-Coat Developer
  • PipPipPipPipPipPip
  • 6,587 posts

  • Gender:Male

Posted 28 February 2010 - 09:29 AM

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.

#11 pbowmar

pbowmar

    Novice

  • Member
  • PipPip
  • 138 posts
  • Gender:Male
  • Location:Vancouver, BC, Canada

Posted 28 February 2010 - 06:37 PM

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.



#12 Andrew Shpagin

Andrew Shpagin

    3DC creator & admin

  • 3D-Coat Developer
  • PipPipPipPipPipPip
  • 6,587 posts

  • Gender:Male

Posted 28 February 2010 - 07:18 PM

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

#13 Arashi2

Arashi2

    Newbie

  • Member
  • 5 posts

Posted 13 March 2010 - 11:49 PM

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?

#14 melazoma

melazoma

    Newbie

  • Member
  • 4 posts

Posted 17 March 2010 - 04:51 AM

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.

#15 simmsimaging

simmsimaging

    Novice

  • Member
  • PipPip
  • 225 posts
  • Gender:Male

Posted 26 May 2010 - 06:21 PM

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
Brett Simms
www.simmsimaging.com

#16 robotbob

robotbob

    Neophyte

  • Member
  • Pip
  • 85 posts
  • Gender:Male

Posted 01 September 2010 - 04:09 PM

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
mac 10.6.6 | 2 x 2.26 GHz quad core Xeon | NVIDIA GeForce GTX 285 | http://www.bitstate.com/

#17 Psmith

Psmith

    Helper

  • Moderator
  • PipPipPipPip
  • 1,070 posts

  • Gender:Male

Posted 01 September 2010 - 05:07 PM

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

#18 robotbob

robotbob

    Neophyte

  • Member
  • Pip
  • 85 posts
  • Gender:Male

Posted 01 September 2010 - 06:28 PM

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.
mac 10.6.6 | 2 x 2.26 GHz quad core Xeon | NVIDIA GeForce GTX 285 | http://www.bitstate.com/

#19 robotbob

robotbob

    Neophyte

  • Member
  • Pip
  • 85 posts
  • Gender:Male

Posted 03 September 2010 - 07:21 PM

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
mac 10.6.6 | 2 x 2.26 GHz quad core Xeon | NVIDIA GeForce GTX 285 | http://www.bitstate.com/

#20 Psmith

Psmith

    Helper

  • Moderator
  • PipPipPipPip
  • 1,070 posts

  • Gender:Male

Posted 03 September 2010 - 11:38 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users