Jump to content

Edge Displacement on fractured pieces


Tato

Recommended Posts

That's cool but if you bypass the exploded view node, pieces are intersecting. I don't know how but this guy made edge displacement at render time. here is the video 1:00 - 1:10 from which i captured those photos: 

Edited by Tato
  • Like 1
Link to comment
Share on other sites

What you need is a vector and transformation matrix for each piece.

Create world space displacement. This way the pieces wont interpenatrate.

Use the vector to determine which axis don`t want to displace(use this vector as a mask for displacement).

When each piece starts moving you have to use matrix to transform displacement with it.

It is a little tricky as there is a lot space conversion involved, but I will try to send you example file.

 

Good Luck

Link to comment
Share on other sites

I found old H11 RnD scene, but I`m not allowed to post it. Fortunately this setup is old and there is much room for improvement( it is using .sim data ) and with packed prims setup will be even simpler. Hopefully I`ll be able to create it by the end of the week. Just need some time...

post-7806-0-34161800-1392118126_thumb.jp

Edited by rayman
  • Like 1
Link to comment
Share on other sites

I found old H11 RnD scene, but I`m not allowed to post it. Fortunately this setup is old and there is much room for improvement( it is using .sim data ) and with packed prims setup will be even simpler. Hopefully I`ll be able to create it by the end of the week. Just need some time...

 

Very interesting. waiting for your post and thank you in advance ;)

Link to comment
Share on other sites

hi!

I think You misunderstood the whole problem, what Tato wants, is a render time displacement, not premodeled (like Jeffs rest trick), for render time displacement you need some vectors to displace along or you can activate displacements when the piece becomes active

Link to comment
Share on other sites

Hi!

Had a few days without internet still managed to create the scene I promised.

This is a very simple example of how to set up matrix for each piece, and use it to create rendertime displacement (in this case in just one direction).

You can create separate vector parameter for displacement per piece and use it inside shader to create displacement in direction you want.

Also keep in mind that UV s are not included. They are little tricky to setup, but still possible.

I`ll create another scene with updated setup and uvs, again not sure when.

You can ask If you have any questions (:

 

 

SHOP_edgedisp_v02.hipnc

  • Like 7
Link to comment
Share on other sites

Hey Pavel. Thanks for the file. It´s downright amazing, even though I´m still trying to get everything going on there. I didn´t thought this would be so complex.

 

I already have a couple of questions if you don´t mind.

 

-On the first VOPSOP Matrix, where you input the normalized xax and yax, and make the cross product to get the zax (which makes a lot of sense to me), you also seem to put yax through a cross product with xax and then the result with another cross product with xax to get yax which you already had in the first place!! It looks pretty redundant to me, if not downright unneeded. I checked the values of yax before and after, and they look the same to me as well, which seems to reinforce the idea on this "double cross product" not being necessary at all.

 

- Finally, what´s the  purpose for the offset matrix, if I may ask? I tried to change some values but the render didn´t seem to change at all or at least I didn´t notice anything. I see this offset is mutipliying the displacement at the shader, but I still don´t understand its purpose.

 

Thanks again. As I told you this has been an ongoing unsolved problem for me for a few years.

 

EDIT:mmm...interesting. If I don´t use theoffset matrix on the shader, but I substitute it by a constant "1.0" I get the same result but with the displacement texture both on the interior and the exterior, as opposed to only on the interior...any hints?

Edited by Netvudu
Link to comment
Share on other sites

-On the first VOPSOP Matrix, where you input the normalized xax and yax, and make the cross product to get the zax (which makes a lot of sense to me), you also seem to put yax through a cross product with xax and then the result with another cross product with xax to get yax which you already had in the first place!! It looks pretty redundant to me, if not downright unneeded. I checked the values of yax before and after, and they look the same to me as well, which seems to reinforce the idea on this "double cross product" not being necessary at all.

 

I haven't looked at the file but what you describe is a standard technique to create an orthogonal (read: at right angles to each other) frame given two arbitrary vectors that may not be perpendicular to each other. Whether the second cross product is necessary depends on whether you know ahead of time that the two input vectors are always guaranteed to be perpendicular to each other. They may not always be perpendicular depending on the application.

  • Like 2
Link to comment
Share on other sites

Hello! I`m glad if you can find it useuful. Initially I had intention to make long explanation of every step, as there are a lot of things going on, but again-not enough time.

About the questinos you have:

-Why double cross? Well, in this particular case one cross product may be enough, but It is there 'just in case', to make sure that all the vectors are perpendicular and matrix is correct. I took this setup from another file I`m working for a long time (upres RBDs wip) and made some minor changes and it is still working, so double check is never a bad thing (i think). This way you can provide any 2 non parallel vectors for the input and everything should work fine. You can try different polyframe styles and final result (after offset matrix) should look the same (in theory). You can even provide just 2 random non parallel vectors (2 face normals for example) per piece, instead of polyframe and again it will generate nice result. There are just many ways to do the same thing.

-Why offset matrix? This part if very important! It is related with the way we compute displacement. We want to get just the offsets from inital transformation..

Let`s say we have a point. This point has just position. In first frame Its located on P1= [0,10,0]. Then its starts moving. On frame 10 its on P2 = [0,15,0]. So were computing just the offset from inital pos which is OFF = P2 - P1 = [0,5,0], and we have the offset as attribute. Then in shader on frame 10 we know that point is on pos P2 = [0,15,0]. We know the offset OFF = [0,5,0], so we can compute our rest state REST = P2-OFF = [0,15,0] - [0,5,0] = [0,10,0]. And then we can use this value to generate noise from inital pos. Add the noise value to this point and thast it - we have pont with displacement regardless of its position.

It`s the same with the matrices, but instead you have positions AND orientations. The nice thing about the offset matrix is that it has nice orentations aligned with the world.

-And why dont we just use rest positions? Yes we can. The result is the same, BUT we have to carry another attribute. We need this matrix anyway(we have to reorient the noise to match piece orientation), so we can just use it. We can even remove one of the matrix orient vectors and generate it on the fly inside of the shader (cross) so we can save hdd space when we create caches. I keep all of them just for consistency.

 

 

In short form the workflow for matrix generation looks like this:

 

Get any 2 non parallel vectors per piece. (polyframe_setax)

Generate wiredly oriented matrices dependent of piece geo. (vopsop_matrix)

Create rest matrix (timeshift_to_first, pointwrangle_rest_p,attribute_rename_rest_mx)

Generate just the offset matrix (vopsop_offsetmatrix)

 

Then in shader:

Get point in worldspace and multiply it by inverse offset matrix. This will transform the point to its initial pos.

Generate noise from initial pos.

Generate displaced point by adding the noise to inital pos. (If you put this to result P it should return pieces in inital state with dispalcement)

Then multiply displaced point by matrix. This will return displaced points to current state.

 

  • Like 5
Link to comment
Share on other sites

I haven't looked at the file but what you describe is a standard technique to create an orthogonal (read: at right angles to each other) frame given two arbitrary vectors that may not be perpendicular to each other. Whether the second cross product is necessary depends on whether you know ahead of time that the two input vectors are always guaranteed to be perpendicular to each other. They may not always be perpendicular depending on the application.

Nice and clean explaination, much better than mine. Thanks!

Edited by rayman
Link to comment
Share on other sites

Thanks rayman for your example file, it's the best I have seen :)

 

I also had a similar question as Aaron. Let me ask them in order:

 

1. You ensured Y (yax) is orthogonal, but still used the old Y to calculate Z. If X and Y are parallel, would this not be a problem for Z? Or are you relying on the fact that it would never happen using PolyFrame?

 

2. If the wall was on a mountain, conforming to the curvature of the landscape, would you have to come up with a different way to calculate the up direction (Y)? What would you suggest for this, using the vectors you have from PolyFrame?

 

3. Instead of storing the vectors separately, would it be better or worse to store the matrix itself so you don't have to assemble it manually everytime you need it? I assume the storage size wouldn't change?

 

4. If you want all inner parts of the pieces to be displaced, how would you do it? Would that be desirable? I assume for wood, you only want a single direction of displacement but for things like concrete, this should be fine? Basically how would you identify all the inner parts of the pieces (excluding the outer faces of the model visible before the destruction), and then displace these using the face normals?

 

5. Please have more free time :)

 

If you just give pointers, that should be more than enough as creating examples for these would be very time consuming for you.

 

Thanks again rayman.

Link to comment
Share on other sites

Your hip file was very helpful.

 

I`m gald to hear that (:

 

 

What about displacement in any direction that i want?

 

Possible. We actually want dispalcement in 1 or 2 perpendicular directions, oriented along pieces. This is just the simplest case I`m showing you, so you can understand how to use this tehnique.

 

also what about displacement mask and uvs?

Is it too complicated?

Not at all. UVs are tricky, I`ll show you how I did them before, but I assume that there is a better ways to deal with them. I`m not very experienced with houdini, so any help will be appreciated (:

Link to comment
Share on other sites

Thanks rayman for your example file, it's the best I have seen :)

 

I also had a similar question as Aaron. Let me ask them in order:

 

1. You ensured Y (yax) is orthogonal, but still used the old Y to calculate Z. If X and Y are parallel, would this not be a problem for Z? Or are you relying on the fact that it would never happen using PolyFrame?

 

2. If the wall was on a mountain, conforming to the curvature of the landscape, would you have to come up with a different way to calculate the up direction (Y)? What would you suggest for this, using the vectors you have from PolyFrame?

 

3. Instead of storing the vectors separately, would it be better or worse to store the matrix itself so you don't have to assemble it manually everytime you need it? I assume the storage size wouldn't change?

 

4. If you want all inner parts of the pieces to be displaced, how would you do it? Would that be desirable? I assume for wood, you only want a single direction of displacement but for things like concrete, this should be fine? Basically how would you identify all the inner parts of the pieces (excluding the outer faces of the model visible before the destruction), and then displace these using the face normals?

 

5. Please have more free time :)

 

If you just give pointers, that should be more than enough as creating examples for these would be very time consuming for you.

 

Thanks again rayman.

 

Thank you, too (:

1. Yes If X and Y are parralel (which I think is very rare, but still possible case If there is something wrong with geometry) the matrix won`t be composed properly. So we just have to use other way to compute these 2 vectors instead of PolyFrame. Still I don`t think you have to worry about it - If geometry is bad, you wouldn`t want to use it anyway.

2. This is next thing I`ll show you how to do. You just have to generate 2 more vectors aligned with pieces walls, and use them to reorient offset matrix.

3. Don`t know. I`ve never used matrices as attributes. Probably it will take little more space because we need to store 4x4 matrix instead of 4 x 3-component vectors.

4. Well, 2 direction displacement is also possible, for both outher and inner parts. Initially I was thinking about the same thing as you - to separete inner parts somehow and blend between 2 and 3 dir world space displacement, but never had the chance to start working on a real solution. Probably It is possible to provide original non-shattered geometry, and use volume gradient as blend between displacements. This way pieces wont interpenatrate.

5. This weekend, when my gf and dog are still in bed sleeping I`ll try to sneak to computer and create another scene (:

 

Cheers

  • Like 1
Link to comment
Share on other sites

This is all going way over my head at the moment but I understand the principle. Looking back at the original image in this post though, I don't see how you would achieve that using this setup?

 

ie, displacing in every direction on internal fractured edges and inside faces. Where the original appearance of the mesh isn't compromised by that displacement.

 

Or at least, using a similar technique for that still seems like it will be a lot more complicated...

Are there any examples of ways to closer match the original post and image?

 

Thanks!

Jay

 

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.

×
×
  • Create New...