konstantin magnus Posted February 18, 2018 Share Posted February 18, 2018 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.. paper_roll_shader.hipnc Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted March 11, 2018 Share Posted March 11, 2018 Do you mean the Lighting Shading & Rendering Masterclass ? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted March 11, 2018 Author Share Posted March 11, 2018 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. Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted March 17, 2018 Share Posted March 17, 2018 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 Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted March 17, 2018 Share Posted March 17, 2018 Not sure if this is what you wanted to achieve, but here is a version where each surface don't cover anymore its original surface. Hope this helps ! paper_roll_shader-1.hipnc Quote Link to comment Share on other sites More sharing options...
CinnamonMetal Posted March 22, 2018 Share Posted March 22, 2018 (edited) That opens alot of possibilities with displacements. Is there self-shadowing, hard to tell by looking at the image ? Edited March 22, 2018 by CinnamonMetal Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted March 23, 2018 Share Posted March 23, 2018 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 :-)) Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted April 7, 2018 Author Share Posted April 7, 2018 It still doesnt curl though, does it? Just in case its not obvious, this what I am looking for: Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted April 7, 2018 Share Posted April 7, 2018 (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) Edited April 7, 2018 by StepbyStepVFX Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted April 7, 2018 Share Posted April 7, 2018 (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. paper_roll_shader-1.hipnc dispClean.exr Edited April 7, 2018 by StepbyStepVFX Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted April 7, 2018 Share Posted April 7, 2018 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. Quote Link to comment Share on other sites More sharing options...
anim Posted April 9, 2018 Share Posted April 9, 2018 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 ) Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted April 9, 2018 Share Posted April 9, 2018 (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 April 9, 2018 by StepbyStepVFX Quote Link to comment Share on other sites More sharing options...
anim Posted April 10, 2018 Share Posted April 10, 2018 (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 April 10, 2018 by anim corrected typos 1 Quote Link to comment Share on other sites More sharing options...
anim Posted April 10, 2018 Share Posted April 10, 2018 here are 2 examples displace_example.hip 2 Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted April 10, 2018 Share Posted April 10, 2018 43 minutes ago, anim said: here are 2 examples displace_example.hip Many thanks, I will have a look, that’s an interesting topic ! Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted April 11, 2018 Share Posted April 11, 2018 On 10/04/2018 at 7:19 AM, anim said: here are 2 examples displace_example.hip That's much better using the computetangents node :-) Thanks for your files ! I was using dPds, and I was wrong ! paper_roll_shader-1.hipnc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.