Jump to content
konstantin magnus

Displacing displacements for curly paper

Recommended Posts

I have been playing around with a displacement shader that is supposed to make polygons look curly (see picture 1 and HIP file).

Would anyone know how to make them actually peel off so they dont fully cover their initial surface (picture 2)?

I think Kai Stavginski mentioned in his shading masterclass that its possible to displace displacements in shaders..

bend_paper.thumb.png.e4beabf56d1d6c1a45cf73fe0eaa205f.png

paper_curl_test_by_theblakespace-d6byv5f.thumb.png.02c6d264a456df34fc672d94b69081d6.png

paper_roll_shader.hipnc

Share this post


Link to post
Share on other sites
13 hours ago, CinnamonMetal said:

Do you mean the Lighting Shading & Rendering Masterclass ?

Yes, when he was talking about cracks he mentioned that he can displace within displacements. He did not show how to do it, though.

Share this post


Link to post
Share on other sites

I have looked at your file and tried to create a valid Normal input for your Displace Along Normal node : the idea is to mix between the normal of your face when s is around 0.5, and normalized (P + dPds) when s is close to 0, and minus that when s is close to 1. This should shrink the face in the direction it is bending as you want.

I will share the file once I have tried (it almost works, but I have to make an if statement to reverse P+dPds once s>=0.5.... but it already reduce the face

Share this post


Link to post
Share on other sites
Posted (edited)

That opens alot of possibilities with displacements. Is there self-shadowing, hard to tell by looking at the image ?

Edited by CinnamonMetal

Share this post


Link to post
Share on other sites

Yes, there is self shadowing, because displacement modify the geometry at render time, so everything is computed correctly (provided the displacements bounds is higher than the disp :-))

Share this post


Link to post
Share on other sites

It still doesnt curl though, does it? Just in case its not obvious, this what I am looking for:

houd_shader.gif

Share this post


Link to post
Share on other sites
Posted (edited)

Ok, indeed, it does not curl, because I made my normal follow the tangent of a bell curve. But by playing a bit more with the normal, this should be possible : that’s « only » a kind of vector displacement in the end.

Let me figure out how to find a function N(s,t) that would reflect that curling (ie. vector displacement)

379488FA-99CD-439C-99F0-0F509ACEDEF6.thumb.jpeg.dfcbab5174c54548336af822891ff495.jpeg

Edited by StepbyStepVFX

Share this post


Link to post
Share on other sites
Posted (edited)

Well, I believe there are more clever solutions than the one I came up with, but here is what I did, based on the idea above of displacement map :

- I created a plane, that I have bent; then for each point, I have computed the vector between its "rest" position and its position once the grid bent (I have therefore a "displacement" vector). I put that into a color attribute.

- I created a constant shader using this displacement texture, and rendered the grid with orthographic camera, so that I can use it as a displacement texture. I tried to fetch the mantra render node into a COP network, to be used instead of a texture, but it does not work... So I just rendered the texture file (note that you can animate the bending of the grid, and render a sequence, to animate your peeling effect afterward).

- I use this texture to create a Normal, based on normailze(dPds) and a normal calculated as cross product of dPds and dPdt, each one weighted by the red channel and green channel of my displacement map. I normalize that displacement vector (used in the normal input of the displacement along normal node), and use the length of the color of the texture as the length of my displacement.

- note that vector displacement is sensible to scale, therefore, my grid being 1x1 units, I had to scale down the displacement (0.05, I promoted the parameter, you will see), so that each primitive can be bent more realistically. I am pretty sure the setup can be improved using a measure node, sample that info and scale the displacement dynamically...

I guess that's it... Please find the file, the texture (painted in Nuke, because of watermark in Houdini Non Commercial), and the results.

Hope that will help you.

pig_v2_large.thumb.jpg.79dc0654ec74e086fb5b2730a0f1e3bf.jpgpig_v2_closeup.thumb.jpg.fae1a0ddaae50436a2b66f1a8c23f40e.jpg

 

paper_roll_shader-1.hipnc

 

dispClean.exr

Edited by StepbyStepVFX

Share this post


Link to post
Share on other sites

And another thing to solve : it is curling into the "s" direction, but face don't have s,t coordinates that are consistent between them... so we should find a way to flip the direction of curling depending on how s and t are oriented or the "aspect ratio" of the primitive... To be continued.

Share this post


Link to post
Share on other sites

just a note to displacing displacements

it doesn't matter how many displacement steps you do as they are all added to single vector displacement value in the end

so whether you do it at once with some function that maps starting point to the end or if you displace with recomputing new P and N and displace along the new N again, or in any direction it's essentially the same the only difference is in the cost of the calculations you decide to use to come up with the final P and N

for very extreme displacements to make sure you have enough geometry to move around you can turn on Re-Dice Displacements property ( vm_redice )

 

Share this post


Link to post
Share on other sites
Posted (edited)
46 minutes ago, anim said:

just a note to displacing displacements

it doesn't matter how many displacement steps you do as they are all added to single vector displacement value in the end

so whether you do it at once with some function that maps starting point to the end or if you displace with recomputing new P and N and displace along the new N again, or in any direction it's essentially the same the only difference is in the cost of the calculations you decide to use to come up with the final P and N

for very extreme displacements to make sure you have enough geometry to move around you can turn on Re-Dice Displacements property ( vm_redice )

 

Hi,

What do you mean by « displacement steps » ? From my understanding, when a ray is sent and hit the surface, or is passing near a surface +/- the displacement bound, it evaluate the new position of this surface based on a vector * distance (in case of a vector displacement, in local coordinates, right ?).

To be honest I don’t understand the « displacing displacement » expression : I only know classic displacement (the surface is moved at render time along its normal), or vector displacement (the surface is moved along a specified vector expressed in various coordinates system, local or worl or object). Am-I missing something ?

Last question : something remains unclear for me, since we still talk about dicing, but I thought dicing was the action of creating a micropolygon in the old-mantra / renderman fashion way of rendering (REYES, is that correct ?). Does dicing options also work with raytracing option in Mantra, which is supposed to be the default ? 

Las-last-question (all apologizes... I rarely have occasions to talk with professionals :-) : what is the difference between Re-Dice, and the « Shading rate » option (which if I thought controlled the dicing process) ? How does it compare to the « subdivise at render time », say in Arnold for example ?

Hope you’ll have time to answer those questions :-) Sorry about hi-jacking this thread !

Edited by StepbyStepVFX

Share this post


Link to post
Share on other sites
Posted (edited)
9 hours ago, StepbyStepVFX said:

What do you mean by « displacement steps » ?

just a lazy way to describe one displace along normal applied after another, or simply any operation that advects P along any vector until you get to final P and N

9 hours ago, StepbyStepVFX said:

To be honest I don’t understand the « displacing displacement » expression : I only know classic displacement (the surface is moved at render time along its normal), or vector displacement (the surface is moved along a specified vector expressed in various coordinates system, local or worl or object). Am-I missing something ?

in Houdini you can move P around to any position to create displacement, what can be tricky is to compute corresponding N, but however you get to new P doesn't have to be just moving along N or custom vector. Let's say you want to advect P through volume vel in a several steps, well, why not

9 hours ago, StepbyStepVFX said:

Last question : something remains unclear for me, since we still talk about dicing, but I thought dicing was the action of creating a micropolygon in the old-mantra / renderman fashion way of rendering (REYES, is that correct ?). Does dicing options also work with raytracing option in Mantra, which is supposed to be the default ? 

Mantra still needs to dice geometry to get enough resolution for Displacement or achieve perfect smoothness for Subd, so no, dicing is not only for micropoly, however micropoly has to dice every geo as it's shading corners of micropolygons, in Raytrace mode dicing is purely to generate hi res geo to raytrace against like in mentioned cases

9 hours ago, StepbyStepVFX said:

Las-last-question (all apologizes... I rarely have occasions to talk with professionals :-) : what is the difference between Re-Dice, and the « Shading rate » option (which if I thought controlled the dicing process) ? How does it compare to the « subdivise at render time », say in Arnold for example ?

Shading Quality is controlling dicing density based on geometry before displacement

Re-Dicing runs trial dice and displace pass just to measure area of displaced geometry, then adjusts dicing density accordingly and displaces for real, therefore hopefully giving you more micropolys where you need them

Edited by anim
corrected typos
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×