Vectors in TG issues

Started by TheBadger, August 25, 2014, 09:00:08 PM

Previous topic - Next topic

TheBadger

OK,

I can get a mudbox vector into TG and to work with just two nodes (image map shader + vector dis shader) But only if the map was made from a sculpt using the default plane in mud.

So then I tried this:
[attach=1]

Then I exported the plane back to MUD as a FBX and sculpted:
[attach=2]

Now in TG:
[attach=3]

So  :-[

Also, there are a few other things Im not sure about
1) Yes or no to clicking antialiasing in Mud map output? I left it off for all my tests. Including the ones that worked.
2) there are several vector space choices a) world. b) Object. c) Absolute Tangent. d) relative Tangent

In the case of the tangents, mud says that relative Tangent is best for making vectors for use in MUD. And Absolute Tangent is best for vectors for use in Maya, Max, and softomage.

So I was guessing that  Absolute Tangent is best for Terragen. But in the test above, I used world.

Now Its hard for me to believe that the detail on the walls is too much, given some of the tests in the big thread on this topic. And I dont know why sending to Maya and back to mud would be a problem. So any help on this would be very welcome!

Thanks.
It has been eaten.

Oshyan

Could it be because you don't appear to actually be using a simple plane but a pre-displaced one or something?

- Oshyan

TheBadger

#2
Hi Oshyan!
To be clear. The plane started in mud from the default plane. I sent it to maya by way of obj. All I did in maya was to extrude a few times. Then I sent it back to MUD .fbx... I think it may have something to do with the UVs? THat is, in order to have X&Z (they are not visable to a Y planer map) I had to UV map... Cant understand why that would be an issue in TG though, if it was not an issue in MUD... So maybe not the maps.

Here is a test that worked ok. I found a image on line and loaded it as a stencil in mud. I did not prep the image to be used as a stencil but it still worked pretty good.

The vector preview:
[attach=1]

The sculpt:
[attach=2]

The render:
[attach=3]

Here you see that the details are coming through.
And after re-reading some of the info from the big thread, I began to play with "final multiplier". In every case so far, some adjustment to the FM setting is required.
What other setting may I alter from default, that could effect things the way FM does?
In the case of the HR Giger faces, I had to increase FM to 5. Otherwise the faces were too slight and hard to see. But at default 1, there was no spikes. IF I increase to say 50-200, the terrain explodes. The proper setting seems to be different for every vector, and also depending on the sculpter used. Can anyone tell me anything more about this?

Also from this test. It seems I cannot change the size in the image map shader. If I change it from the 500x500, it will lose all intended features.
This may be related to the way autodesk stuff works. For example, when working between mud and maya, you must use the same measurement system or problems pop up.
Can anyone one say why I loose my faces just from changing the size in the image map shader?

The thing is, if I can get the OP vector to work (or something basically like that) then I know I can do everything I wanted with this vector to TG stuff! So I really want it to work.  ;D

Thanks for helping!

And again (per another thread) You only need two nodes to work with vectors in TG if you save out an .exr as you Vector.
It has been eaten.

Oshyan

I'm no expert with the vector stuff, I've never even tried it as I don't have Mudbox or ZB, so hopefully someone who knows for sure will step in. But unless I'm mistaken, there are assumptions you are making that are causing problems. The whole reason the vector maps work from ZB/MB to TG is that they start with a flat plane and then *the vector displacement map holds all the info needed to reproduce the resulting shapes*. What you're doing is creating *additional changes* from the flat plane that will *not* be reflected in a vector displacement map (because they're already there before you start sculpting), but still hoping it will work as before. The only way what what you're doing would work is if you applied those vector displacement maps *to the same object shape* in TG, and of course TG would have to be able to displace objects properly which it can't. So I don't think what you're doing is possible. The technique that does work is cool but still limited and this is one reason people haven't done more with it.

To reiterate my basic understanding: you need to work off of Mudbox/ZB native shapes, a plane ideally (perhaps only). You cannot displace on an arbitrary object or even a modification of a MB/ZB plane because you are creating changes that will not be encapsulated in the vector map, they are instead in the base geometry. The resulting vector map then reflects those changes and looks wrong in TG because you're applying it to a different base surface shape.

- Oshyan

TheBadger

Hmmm. If that is true (and it may very well be) Then I think I know a solution!
And Im happy to share it.

So if Oshyan is correct here is a work around

Make a vector of the sculpt for use in Mud box as a "vector brush".
Then, use that new vector brush on a fresh plane (new scene).
exprt a new vector map for TG
No map issues!

Ill try it  :)
It has been eaten.

Oshyan

Interesting. I hope it works!

- Oshyan

Dune

In my (little) experience you need more than 2 nodes to make it work; also convert the channels and then swap some of them into the VDisp shader. Also; if you add your 'printing' doesn't it add vertices? The vector map is the difference between a default plane and the sculpted plane, but I don't think it can have too many differences in local number of vertices. Also, I see some transects from one height to another; I don't think that would be possible as well. And TG has its limitations regarding straight verticals.
And; no UV's are needed, at least not when I worked with them.

Tangled-Universe

Yes, you do need UV's and actually good ones to start with.
Each UV coordinate tells where each pixel of the vector displacement map (VDM) should be, so as far as I know you do need UV's and good ones.

Sadly and mostly unbelievably, Mudbox's own default plane generates very poor UV's upon subdivision.
What I did is creating an 8x8 poly plane in Maya and exported that as .obj (couple of kb only).
I learned you need to do this from a Youtube video.

Import that into Mudbox and create a new layer to sculpt on.
Then subdivide once or twice to create a bit more resolution and start sculpting the rough details.
Then subdivide once again when you need to add more details and repeat the process till you're done.
After that then generate the vector displacement map via that menu I can't remember the name of now ;)

That's how I got it to work and as far as I know I didn't need to do any channel swapping, but that could perhaps be because I have set units/axis setup similar to Maya in Mudbox.
The only thing I have mentioned is that there is a slight negative offset on the Y-axis in TG when using a Mudbox VDM.

TheBadger

QuoteIn my (little) experience you need more than 2 nodes to make it work

No. you need only export a .exr. As you can see in the last image post, it works. It is a verification of a post in one of your threads.

Quoteno UV's are needed, at least not when I worked with them.

The vector of the faces above is an example of a clean plane UV, here is the bad one from the OP
[attach=1]
As far as I can understand, UVs matter through the entire process. The Vector preview you see in the file is in-fact an exact representation of the UVs.

QuoteThe only thing I have mentioned is that there is a slight negative offset on the Y-axis in TG when using a Mudbox VDM.
Do you mean that the map causes the terrain to rise or fall below the rest of the terrain at the edges of the map? I think someone showed that in the big thread in an image, but is there a fix??. I thought that it could be avoided by not sculpting near the edges of the plane, but maybe it will happen anyway? I should test that now too!

QuoteSadly and mostly unbelievably, Mudbox's own default plane generates very poor UV's upon subdivision.
What I did is creating an 8x8 poly plane in Maya and exported that as .obj (couple of kb only).
I learned you need to do this from a Youtube video.

Im not sure I understand the difference between a map made by mud (auto), and one made by maya for example. Do you happen to have a link on hand Martin? I don't recall ever hearing something on that.


The perfectly vertical walls though, yes, I know from the maze world thing I did that, that is a real big problem. But I was hoping that it would be less so now. In 3.1 is it still a big deal??! Ill tell you now I can't/won't sit through a 200 hour render again :o


Im starting the testing now. We will know much better in a little while. But Im really hoping that with the help of you guys I will be able to fix/work around/ any issues! So please keep an eye out. :)
It has been eaten.

Oshyan

Your 200 hour render had little to do with the vertical walls, just to clarify. The problem is that they don't look great when rendered, not that they render slowly.

- Oshyan

Dune

I said UV's are not needed, but I mean only if you make, e.g. a rock surface that's textured procedurally. I have to recheck the converting part...

Tangled-Universe

Michael,

I'm not making maps in Maya.

I meant that you must not start sculpting on a native Mudbox plane, but on a Maya created plane.
Somehow the plane object created in Maya has better UV's and/or allows for better UV's after subdividing in Mudbox.
It's really strange.

Just try the following: subdivide a Mudbox plane 8x and subdivide a Maya plane object 8x, both in Mudbox.
The Mudbox plane will end up with smoothed corners!

TheBadger

#12
Um, I think the reason you are getting smoothed corners is not what you think Martin.

In both Maya and Mudbox in the smooth options, there is a setting that allows you to control the shape of an object as smoothing is applied. So if you want very sharp corners you need to tell both programs to keep the shape of the object before smoothing is applied. If you want those corners to smooth then the default should have done that, but if a setting was changed...

So in maya start with a cube and hit the 3 key. The 3 key previews in real time the effect of one smoothing level (or more smoothing levels if you tell it to). IF your settings are still default (it sounds that they are not to me), you will get a shape that is no longer anything like a cube. But a plane will appear to keep its shape because it has more edge loops. The extra edge loops (verts and edges) are forcing the shape to hold. But at a certain level they are really changing
The way to test if what you are trying to tell me is correct is to test a cube not a plane.

the base level of a Mud and Maya plane must be the exact same amount of  edges and verts, as well as the same size, or you will get a warning, something like "target and source are not the same base level, cannot map". I mean in regards to trying to do what Im doing in the OP.

I just re-learned some of this and some of it I learned for the first time tonight. But basically You can make anything into a a vector for Mud (and then for TG)(even whole objects)) And you can avoid all the problems I was  having at first! The only question is how well TG will render it, but I think it will be near perfect! If not perfect :)

And I will proove it *I think :-\* ... Maybe  ;) Im just waiting for my maps to finish. I stupidly used all the highest setting that should not have for tests ::)
But I will tell you that be fore you make a vector dis, you have to first make a regular displacement map, then from the result of that, make your vector.  ;D a entire step we were not doing!
It has been eaten.

Tangled-Universe

That's interesting.

In my so far simple tests I just open that plane I mentioned, add a new layer and start sculpting there.
The plane stays at subdivision 0 or 1, whichever of both is default.
The sculpt is in the end subdivision 6-8 or so.

I then extract the vector displacement map directly from the differences between the subdivision 6-8 plane vs the subdiv 0/1 base plane and I get a 1:1 reproduction in TG, except for the slight negative offset I mentioned earlier.

It also doesn't make much sense for me that you need to extract a displacement map first and then also a vector displacement map, just because if I think what these actually are and how they differ. It doesn't make sense to me (yet?).


Well ok, the smoothing seems to be something else.
But I'm not out of examples of why NOT to use Mudbox's native plane ;)
Again, subdivide a mudbox plane and displace that with a TG heightfield saved as .exr.
It will look like a mess.
Do the same procedure, but with a Maya obj plane and it works.

TheBadger

Martin, I think what you are saying is right on.
I *will* take your advice on the maya plane in the future! I am sure you tested it, and I am happy to take your advise there without redoing your tests.

But if you look at the op images, Im trying something much more complicated then starting from a simple plane (maya or mud), I have learned that what I want to do *IS* possible, but there are some issues I have to work out.

If I am going to work from an altered plane (not even a plane anymore really) then I need to treat it differently than two maya planes or two mud planes or a mix. I have to treat it like an object like a 3d car as in this example: https://www.youtube.com/watch?v=QuGDdhSqIhg

^^ this link above explains the other displacement map. Do check this out guys! Its pretty interesting when thinking about TG and having the vector be one simple plane at the end for import to TG. But he leaves out some important info (as usual with youtube) He dose not tell us anything about the car or how it was made or what the UVs look like.
It has been eaten.