Anti-Distinctlyminty Posted August 8, 2017 Share Posted August 8, 2017 Hi all, I've set up a displacement shader to rotate an object. As you can see, when the displacement is applied, the normals are not smoothly interpolated. Is there anyway to fix this without subdividing the entire object? Displacement_Normals.hipnc Quote Link to comment Share on other sites More sharing options...
adrianr Posted August 8, 2017 Share Posted August 8, 2017 Damn, thought I had it, still a bit broken.. Only render time subdiv fixes it but I know that wasn't the point. Curious to know the proper solution as this would technically work in sops regarding rotating the position and normals. Displacement_Normals_02.hipnc Quote Link to comment Share on other sites More sharing options...
Anti-Distinctlyminty Posted August 8, 2017 Author Share Posted August 8, 2017 You're right that the exact same code does work at SOP level, but still gives facet artefacts. I'm really curious to see what the solution is...surely mantra can do this? Otherwise every displaced object has to be subdivided. Quote Link to comment Share on other sites More sharing options...
bran_daid Posted August 8, 2017 Share Posted August 8, 2017 you can rotate the normal with the same dihedral matrix you used to generate the position rotation. if the shading normal you pipe in is smooth, it will remain smooth after you rotate it. here's an example: displacement_normals_bb.hipnc Quote Link to comment Share on other sites More sharing options...
Anti-Distinctlyminty Posted August 8, 2017 Author Share Posted August 8, 2017 (edited) That much better! There are still some artefacts on the faces that are going into shadow, but certainly better. Edit: it seems to be from the torus rows and columns being increased :/ Yet this raises the question of what was actually being done wrong before? As far as I can tell, wasn't what I was doing before essentially the same thing? The results for both displacement setups are the same. Edited August 8, 2017 by Anti-Distinctlyminty Quote Link to comment Share on other sites More sharing options...
bran_daid Posted August 8, 2017 Share Posted August 8, 2017 howdy. the normals are smooth in the example. the artifacting you're seeing is the self-shadowing of the individual polygons. if you turn off raytrace shadows on your light you will see this clearly. fiddling with the raytrace bias on your mantra rop can resolve this if you aren't wiling to have a model with more divisions. here's what this looks like after fiddling with the raytrace bias: Quote Link to comment Share on other sites More sharing options...
Anti-Distinctlyminty Posted August 8, 2017 Author Share Posted August 8, 2017 (edited) Ok, I thought it may be something to do with the shadow calculation rather than the normal calculation on the mesh, and it seems that is correct! I changed my Raytracing Bias to 0.17 and the shadows are now smoothly interpolated. Edit: You beat me to it thank you Brian! Edited August 8, 2017 by Anti-Distinctlyminty Quote Link to comment Share on other sites More sharing options...
Anti-Distinctlyminty Posted August 8, 2017 Author Share Posted August 8, 2017 (edited) Although, in my ongoing effort to actually understand displacement in mantra, I do have some confusion as to why this setup doesn't work. Any ideas there? Displacement_Normals.hipnc Edited August 8, 2017 by Anti-Distinctlyminty Quote Link to comment Share on other sites More sharing options...
adrianr Posted August 9, 2017 Share Posted August 9, 2017 (edited) Sooo my solution worked? Just using quaternion dihedral as you had set up instead of a 3x3 matrix. Good to know about the raytracing bias. Regarding your latest scene pretty sure the source is the shading normal vop inside the displace vop. It creates new normals from the displaced position, rather than rotating the existing normals along with the position. You can go into the displace vop and hijack the matrix coming out of the 'get_space' subnetwork to rotate the normals and bypass the shading normal vop - Just be sure to turn off your transform after the displace normal. Edit: I haven't checked the full subnet to see what it's making or if the normals are now technically rotated the same as the points, but I think this gives you enough to go on for further poking around. Edited August 9, 2017 by adrianr Quote Link to comment Share on other sites More sharing options...
Anti-Distinctlyminty Posted August 9, 2017 Author Share Posted August 9, 2017 Hi Adrian, thanks for the input. I dug around inside the other nodes as you suggested. The get_space subnetwork seemed to just be getting a rotation matrix for the purpose of converting whatever was input into object space (or whatever space was chosen). But that doesn't seem to imply I was doing anything wrong. In an effort to try and understand the displacement better, I'm trying to apply layers of displacement. For example rotate first, then displace along normals. The Shading Normal VOP doesn't have too much in the way of documentation (e.g. what space are the inputs expected to be in?), but it states that it will pick up the global variables of the same name if nothing is inputted. So this is the closest I have gotten, but as you can see I'm still getting artifacts here. Furthermore, if you try to make the object subdivided now then the displacement disappears. I feel there's something essential to all this that I'm missing here. Displacement_Normals.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.