Page 2 of 3

Re: displacement question - which color is 'neutral' ?

Posted: Mon Dec 08, 2014 4:41 pm
by prodviz
I didn't have any success with displacement, although this could have been something I was doing wrong.

I've asked a few times, but I'd love for Otoy to do a Mudbox/zbrush displacement tutorial (including negative values).

Re: displacement question - which color is 'neutral' ?

Posted: Mon Dec 08, 2014 6:43 pm
by miko3d
mate ,this quote:
gordonrobb wrote:I get all of that in terms of how to create a good displacement map.

What I'm still confused about is why you say my comment ...

"If you're using a ZBRush displacement map, you need to make shift value negative a half of the amount value. So if you're amount figure is 1, your shift value needs to be -0.5."

....is wrong.
Is wrong because not only you DONT need to do that, but also because you SHOULDNT do it (unless you are living in 2004,dont realise there is an easier way,dont know what you are doing or get some kind or fetiche pleasure in working with Integer image formats)

I couldnt care less about it if it wasnt because most people trying to setup displacement in their scene will get the wrong message and never get their maps to match.

Re: displacement question - which color is 'neutral' ?

Posted: Mon Dec 08, 2014 9:04 pm
by TBFX
miko3d wrote:mate ,this quote:
gordonrobb wrote:I get all of that in terms of how to create a good displacement map.

What I'm still confused about is why you say my comment ...

"If you're using a ZBRush displacement map, you need to make shift value negative a half of the amount value. So if you're amount figure is 1, your shift value needs to be -0.5."

....is wrong.
Is wrong because not only you DONT need to do that, but also because you SHOULDNT do it (unless you are living in 2004,dont realise there is an easier way,dont know what you are doing or get some kind or fetiche pleasure in working with Integer image formats)

I couldnt care less about it if it wasnt because most people trying to setup displacement in their scene will get the wrong message and never get their maps to match.
Gordonrobb,

There was absolutely nothing wrong with your statement but it seems perhaps it wasn't quite clear enough for some as miko3d seems to have taken your example values of 1 and -0.5 as something you are setting for your map export and not example displacement values to set in the octane displacement node. Though it seemed very clear to me.
miko3d wrote:all we need to do is add to the whole image a constant value, high enough to get rid of negative values and ofcourse smaller than the displacement bounds of the mesh and then offset in the displacement node.
miko3d,

That would be the same as writing the map with 0% as the base point (lowest value) then using a negative offset in Octane to get matching displacement. When you are adding to the whole image you are just returning the lowest point (negative value) to black (0%) so you may as well write the map out with black as the lowest point at least then you are guaranteed to get it's full range. If you add a value to the whole map after the export you run the risk of clipping the high points if they were at, or were closer to 100% than the amount you are adding to get your negative values back to 0%.

Gordonrobb never mentioned using integer image formats and it's irrelevant anyway as the math is exactly the same for the displacement amount vs offset no matter what bit depth or format the file is when the map has been written with a 50% midpoint, which is pretty standard practice.

I think while we have to use an offset setting in Octane to achieve negative displacement then writing the maps with 50% mid point and using negative half of the displacement amount is the easiest way to match the displacement from your sculpting software and is perfectly valid. Otoy just need to keep working on the niggling little glitches that are occurring when we use a negative shift value.

T.

Re: displacement question - which color is 'neutral' ?

Posted: Mon Dec 08, 2014 9:57 pm
by prodviz
I had a few tight-ish recessed areas on my base mesh, so using a negative shift value gave me errors in the geometry.

Re: displacement question - which color is 'neutral' ?

Posted: Mon Dec 08, 2014 10:36 pm
by gordonrobb
I'm confused. I'll just leave it.

I was purely talking about what you need to do in octane to use a map generated in ZBrush. The shift parameter is needed as far I as I know. I was then told that was wrong, by someone who seemed to say the same thing. :)

If I'm using the shift parameter for maps the have negative (indented, recessed) areas and I don't need to then I really want to know. Because as far as I'm concerned it's the shift parameters calculations that are causing tearing geometry in examples I've seen.

Re: displacement question - which color is 'neutral' ?

Posted: Mon Dec 08, 2014 11:00 pm
by TBFX
gordonrobb wrote:I'm confused. I'll just leave it.

I was purely talking about what you need to do in octane to use a map generated in ZBrush. The shift parameter is needed as far I as I know. I was then told that was wrong, by someone who seemed to say the same thing.
Yes exactly, no need to be confused you have a perfectly clear understanding of this.
gordonrobb wrote:If I'm using the shift parameter for maps the have negative (indented, recessed) areas and I don't need to then I really want to know. Because as far as I'm concerned it's the shift parameters calculations that are causing tearing geometry in examples I've seen.
It is definitely the shift that is causing the tearing. The only way you could avoid using a negative offset in Octane to match your sculpt is to make your base mesh smaller before you sculpt and only ever sculpt in the positive direction, ie. have the final sculpt only additive to the original mesh, which is a pretty hard thing to do once you begin sculpting and certainly not an ideal or desirable workflow.

T.

Re: displacement question - which color is 'neutral' ?

Posted: Mon Dec 08, 2014 11:05 pm
by prodviz
Is there a workaround to this tearing?

Any chance of a tutorial, Otoy?

There's seems to be a lot of users with issues here...

Re: displacement question - which color is 'neutral' ?

Posted: Tue Dec 09, 2014 2:48 am
by miko3d
gordonRobb:
I was purely talking about what you need to do in octane to use a map generated in ZBrush. The shift parameter is needed as far I as I know. I was then told that was wrong, by someone who seemed to say the same thing.
mate:
"...you NEED to make shift value negative a half of the amount value..." is NOT at all the same thing to say: "you need to shift values"
dont get confused,because you are constraining how this values are shifted, and the moment you take this path you are locking yourself to a workflow from Zbrush that should be avoided like the plague.

Look,Im really sorry that my message wasnt clear enough, im not trying to be the "smart guy", but its important to let people know .

offset= - 0.5*max displacement

Is not the right way to setup displacement offsets either in Octane ,Vray Arnold or any modern and decent render engine.Even if you want smaller 16 bits files,
Things are much simpler now,follow the link I gave in my previous post and read it properly please.
TBFX:
...If you add a value to the whole map after the export you run the risk of clipping the high points if they were at, or were closer to 100% than the amount you are adding to get your negative values back to 0%.
this is all nonsense... . clamping values in a 32 bit float file...
...it's irrelevant anyway as the math is exactly the same for the displacement amount vs offset no matter what bit depth or format the file is...
so the way you store float values in a float image format is the same as how you store them in an integer image format,oh dear....
It is definitely the shift that is causing the tearing. The only way you could avoid using a negative offset in Octane to match your sculpt is to make your base mesh smaller before you sculpt and only ever sculpt in the positive direction, ie. have the final sculpt only additive to the original mesh, which is a pretty hard thing to do once you begin sculpting and certainly not an ideal or desirable workflow.
Again nonsense and worse ,mis-information

Anyway, no need to carry on.

I just setup a very simple scene ,exported from zbrush with negative and positive displacement for anyone that may be interested..I also have added the hi res target OBJ from Zbrush, next to it to compare the result.
Its very basic,so please excuse the crappy model, but i think it shows that correct displacement from Zbrush is not difficult to do in Octane
here are the files:

https://onedrive.live.com/redir?resid=4 ... lder%2cexr



I hope it helps.

Re: displacement question - which color is 'neutral' ?

Posted: Tue Dec 09, 2014 9:53 am
by gordonrobb
OK, just leaving for a meeting so will read your link again later, but let me check what you are saying.

Do you mean that my thinking that in ZB "zero displacement (in or out) is mid-grey" is wrong? (except where the max and minimum displacement are equal)? And that if your inward displacement is smaller, you can have your zero (not displacement) point be nearer black than mid grey? Are you disagreeing on the amount of shift I'm saying you would have to have? And if so, does your link discuss how you would know and/or tell ZB where midpoint is, and if this will tell you how much shift you need to put into the parameter in Octane?

Also, does how does this help if your inward and outward displacement ARE around equal. Surely what I was saying about shifting by negative a half is the case, and if so how do we avoid the tearing?

Also, starting your post with "Mate" sounds a bit snarky, and isn't helpful. Even if the person you are trying to help is being dumb :)

Re: displacement question - which color is 'neutral' ?

Posted: Tue Dec 09, 2014 9:56 am
by gordonrobb
Also, is your point more about a work flow that makes sure you are getting the right amount of displacement without it being trial and error?