Jump to content
3DCoat Forums

Vector Displacement


Recommended Posts

  • Applink Developer

Hi !

I have been working with Vector Displacement plugin and my goal is take 3d-coat Displacement maps to houdini. Did you know that you can get free houdini Master

if you are using it for personal projects and not taking money for it. I just found it and I really like it. This picture is what I have so far. The base of this shader I took from

Sidefx forum. And it was ment to working with Normal maps. What I understand with my small brains is that Vector Displacement maps works almost like Normal maps. they both

are using Tangent space and Vec. Disp also moves surface. My question is that after texture node. I'm splitting RGB channels. What are the Max and Min values of each channel when I'm using 32-bit Openexr format. Because I think that I have to do some kind of Convertion from color value to Vector value so I have know those limits. But here is a picture from the work so far. I don't know is this going to be a life time project because I'm not good with these things but I have had a lot of fun time playing with this one so..and

help from anybody would be nice.

post-1165-1237910251_thumb.jpg

  • Like 1
Link to comment
Share on other sites

  • Advanced Member
What are the Max and Min values of each channel when I'm using 32-bit Openexr format. Because I think that I have to do some kind of Convertion from color value to Vector value

With a signed 32 bit value, you shoudn't need to do any conversion at all. EXR files should support signed (negative and positve numbers)... provided Houdini reads them. There should be no need to convert or normalize (it would be a bad thign anyway). With RGB>XYZ vector displacement, if pixel "foo" has RGB value "5.3, -6.3, -119.78" the vertex corresponding to that pixel would be modified by XYZ "5.3, -6.3, -119.78" in object space. Very simple. There is no need to limit to 0-1 range other than to make it visible (but displace maps aren't for displaying)

TS displacement is a lot more complicated, though... The question is whether Houdini will let you displace a vertex in a direction other than the normal based on a texture. Do you have a screenshot of the end of the nodetree (some sort of displace or geometry node)? If it only displaces along the normal, there isn't probably anything you can do.

Link to comment
Share on other sites

  • Applink Developer

Thanks so much for that information. Here is a update. Good thing that you can see displace. And also good thing is that it's not only up and down but every direction. Bad thing is

that it dosen't look any how it should look like. Here is a picture

post-1165-1237978494_thumb.jpg

Link to comment
Share on other sites

  • Advanced Member
Thanks so much for that information. Here is a update. Good thing that you can see displace. And also good thing is that it's not only up and down but every direction. Bad thing is

that it dosen't look any how it should look like. Here is a picture

post-1165-1237978494_thumb.jpg

I can't seem to find much documentation on the displacement node by googling. Do you have any documentation for it you can paste here so I can get an idea of what the properties on the node do?

Link to comment
Share on other sites

  • Applink Developer

It works! Now it works in tangent space mode. My problem was that I used "zero level is grey" where colors are normalized. I'm not quite sure if here is houdini users but if somebody wants to use this material I can download it to forum. How does "Absolute positions" works. Does it use Tangent Space or object space?

This is other problem I'm facing right now. Here is a picture to help to understand.

When I'm doing a sculpt and build mesh for it and then press "Merge into Scene" It changes Vector Displacement to normal Displacement. Can anybody else confirm this.

post-1165-1238020356_thumb.jpg

Link to comment
Share on other sites

  • Advanced Member
It works! Now it works in tangent space mode.

Cool! Congrats!

It works! Now it works in tangent space mode. My problem was that I used "zero level is grey" where colors are normalized. I'm not quite sure if here is houdini users but if somebody wants to use this material I can download it to forum. How does "Absolute positions" works. Does it use Tangent Space or object space?

Absolute positions is object space. If the texture value is RGB "1.3, 1.59, -2.2" the vertex at that texture coordinate gets moved to exactly that spot (it's not relative to the original position).

Link to comment
Share on other sites

  • Advanced Member
When I'm doing a sculpt and build mesh for it and then press "Merge into Scene" It changes Vector Displacement to normal Displacement. Can anybody else confirm this.

Yes. I thought that was by design, though. Anything resulting from retopo is automatically normal-space displacement. I'm not sure there is another way to do it (though i'm sure maybe andrew can figure it out, if there is a way). Maybe make a feature request.

Link to comment
Share on other sites

  • Applink Developer

Here is a node tree. I added Normal map. My only consern is that did I add Normal maps normals right way or not. In this node I'm just adding the Displacement normal and Normal map texture normal together and then normalized it. If there is any better way do it. Maybe you can help me again psyborgue.

node_system.jpg

I know that I'm doing something wrong because I get these black lines in my render.

error.jpg

Link to comment
Share on other sites

  • Advanced Member

Can you post a screenshot of the non-displaced mesh and the TS normal map you're using? What options did you use to generate the TS normal map from 3d coat (off mid-poly mesh, position 0, or low poly)?

What happens if you plug the output of "Normal_from_map" directly into output1's "n" (not combining with the normal from displacement node)?

Why is it necessary to have a separate normal map if you already have good normals from the displacement node? What does the result look like with displacement's normals alone?

Link to comment
Share on other sites

  • Applink Developer

Thanks Andrew and psyborgue!

I think that now it's working like it should. It was good point about normal maps. So the end result was that I took normal maps away and now

it is only Vector Displacement. I had to adjust some options in houdini to take black lines away but now I'm very happy for result.

post-1165-1238161827_thumb.jpg

Link to comment
Share on other sites

  • Advanced Member
Thanks Andrew and psyborgue!

I think that now it's working like it should. It was good point about normal maps. So the end result was that I took normal maps away and now

it is only Vector Displacement. I had to adjust some options in houdini to take black lines away but now I'm very happy for result.

post-1165-1238161827_thumb.jpg

Looks good. I think Andrew had a good point about the displacment, though. It seems as if you're just combining the three channels and feeding them into the displacement node's "amount" parameter. While that might work correctly if the displacements on your model are just normal displacements anyway, I don't think it will work if your displacements are in more than just one direction.

In order to get correct results, wouldn't you have to use sshear and tshear as well as amount (unless the displace node moves points along the perturbed normals... in which case you probably want to get rid of the length node and plug the blue (normal, i assume) channel directly into amount)?

According to andrew's blip on TS vector displacement:

2) Tangent space (local space) displacement - RGB mean shift in TBN - space, N- normal, T,B - directions of U,V gradient. This kind of displacement is good for animation but less precise because tangent space calculation can be made using many methods, it even can be non - orthonormal.

I assume R=T G=B and B=N... Andrew would know for sure.

(N would probably be amount or scale, TB would be Tshear and Sshear).... maybe. (again, unless the displace node moves points along the perturbed normals...)

I think you're on the right track, but are you certain it works with complex displacements (not just along the normal)? Your object doesn't seem to really test that. As a test, try deforming the cube like this in sculpt mode and exporting a ts vector displacement (as well as the original cube with original vertex positions).

post-1287-1238173203_thumb.png

If all goes well, the cube should be displaced into the original shape (and it should deform correctly.. a simple test is to rotate the cube's vertexes in object space and see if the displacements follow). I used a similar test object to troubleshoot vector displacements in blender (though it was world space map, much simpler, and it won't deform correctly). once you get it working with a simple test object, you can use it with something more complex.

Don't give up if it doesn't work. You've come a long way and i'm pretty sure you'll get it if you keep trying.

Link to comment
Share on other sites

  • Applink Developer

Which program did you use to make cube with spikes like in your picture. Do you have maybe obj file and Displacement file to give.

That would be great if you can download houdini too.

here is my houdini file so you can check it out.

File

Link to comment
Share on other sites

  • Advanced Member
Which program did you use to make cube with spikes like in your picture.

I opened a cube in 3d coat, went to sculpt mode (not voxel sculpt mode) and then used the drag with pen to first drag out "cones" and then bend them sideways (then some smooothing). This makes it overhanging, which you can only relplicate with vector displacements (or a multiresolution mesh).

Do you have maybe obj file and Displacement file to give.

I'll upload a 3b file to my server. you can then export low poly with original positions and a vector displacement.

http://www.michaelcrawfordportfolio.com/do...testdisp.3b.zip (12 mb)

That would be great if you can download houdini too.

here is my houdini file so you can check it out.

File

Cool. will open. Thanks.

Link to comment
Share on other sites

  • Applink Developer

I'm not quite sure but I think that 3d-coat cannot build spikes like you have in your cube. Here is a picture When I'm in sculpt mode. First picture is basic spike and second one is curved spike. The end result is the same. Like I said I have to do some tests to confirm this.

post-1165-1238180312_thumb.jpg

Link to comment
Share on other sites

  • Advanced Member

You're right. It does apply the normal before it displaces. It works fine for me. I modified hte node layout slightly... and for some reason the blue channel needs to get inverted (did this by multiplying by negative 1)

See screenshot.

post-1287-1238182309_thumb.png

(the screenshot shows negative two, but after I switched to the non-normalized exr (from 3d coat), it's now at -1 and getting accurate results.

Link to comment
Share on other sites

  • Advanced Member

I seem to get more or less exact results by exporting from 3d coat "zero is black, not normalized" (just exported again).

post-1287-1238182653_thumb.png

Works perfectly... squiggly tangent space displacements and all.

One modification I made to your nodetree: the output from the texture node should already be vector. no need to convert to float and back (that I can see.. i tried swapping but got the same exact render result).

Link to comment
Share on other sites

  • Applink Developer

This is funny. I'm still having some problems with this one. I downloaded your modifyed houdini file and then replaced obj file and exr file with my own files and it dosen't give the results I want. Do you still have your cube obj file and exr that I can borrow to see if that works.

When you doing your vector displacement map. Are you using tangent space and black to zero, not normalized options to get best results?

Link to comment
Share on other sites

  • Advanced Member
This is funny. I'm still having some problems with this one. I downloaded your modifyed houdini file and then replaced obj file and exr file with my own files and it dosen't give the results I want. Do you still have your cube obj file and exr that I can borrow to see if that works.

When you doing your vector displacement map. Are you using tangent space and black to zero, not normalized options to get best results?

Here is the 3d file:

http://www.michaelcrawfordportfolio.com/do...testdisp.3b.zip

the cube is exported using low poly original positions (basically the original cube), and the exr is exported using black (not normalized).

Link to comment
Share on other sites

  • Applink Developer

I already got the file. thanks! Now it's working. There is so many options that you can go wrong with. It took like 4 hours until I noticed that I have scaled my model and that's why displacement map looked all wrong.

Link to comment
Share on other sites

  • New Member

Hello

I'm not so au fait with all this vector map v normal map stuff (kudos to you), but as you're kinda new to Houdini I wonder if you've seen the GLSL tangent / object space normal map materials?

There is an example file from the help card here http://www.sidefx.com/docs/houdini9.5/node...angentnormalmap and here http://www.sidefx.com/docs/houdini9.5/node.../ogl2_normalmap

There also exists another example file with a vopnet which is hidden away on the Exchange, here http://www.sidefx.com/exchange/info.php?fi...p;versionid=562

The tangetspace example uses an inline vop to include a vop function which isn't exposed as a vop node, so you might have missed it if you weren't looking outside vop land. Just though you might be interested to know about it if you didn't already... if you even find it useful, that is.

Also, if you ever encounter any extreme displacements sometimes applying the vm_redice property to your material or object can help mitigate issues - http://www.sidefx.com/docs/houdini9.5/props/mantra9_1

Link to comment
Share on other sites

  • New Member

Hey people

Ive been doing some research into vector displacement with houdini, and was messing with the shader you guys have been working on. Looks like it has some problems with negative displacements. Theres a more detailed explanation here as well as a screenshot of the problem.

Anyone know why this would be happening? It be great to solve this as I have a vector displacement baker in works using Houdini and they would go great with each other. I cant quite see where the problems lies, the shader looks correct to me.

http://www.sidefx.com/index.php?option=com...pic&t=15077

Cheers

Nick

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