Macha Posted December 21, 2010 Share Posted December 21, 2010 (edited) How do I use old shaders in the shader network. For example, the displacement shaders. Before H11 we plugged them into suboutput node and used a vopsurface node to create the surface. But now all this is done inside one network with the collect node but the old displacement nodes don't copy-paste into it. I know, I can go the old way and build a shader from scratch, but there is an easier way, right? Edited December 21, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted December 21, 2010 Share Posted December 21, 2010 How do I use old shaders in the shader network. For example, the displacement shaders. Before H11 we plugged them into suboutput node and used a vopsurface node to create the surface. But now all this is done inside one network with the collect node but the old displacement nodes don't copy-paste into it. I know, I can go the old way and build a shader from scratch, but there is an easier way, right? You just need to work at the vop level the whole time. Start with a material node and it will show you the basic connections of the disp, surf, light, and fog vop netowrks. There is no longer that mid-level area when you created a material before from separate displacement and surface networks. That area is now the output nodes into the collect nodes. You can still work in the old method but I believe you need to put a collect node in your h10 disp, and surface shader to get it to work. I don't have h11 working on my laptop at the moment for an example. You should be able to just copy and paste the vops nodes from inside the disp networks into a material node alongside the vops from your surface node and connect them into the right outputs and it should be fine. There may be one or two legacy nodes in their dispimport may or may not work which would be the biggest problem I can see. I know I got it to work on my ubershader and a couple other ones. Quote Link to comment Share on other sites More sharing options...
Macha Posted December 22, 2010 Author Share Posted December 22, 2010 (edited) So, how would I get, for example, the v_choppywater node inside the vop network? If I build it the same way as in H10 (see image) then I can access its parameters with Import Displacement Variable vop, but it's not quite the same as having it inside the network. The reason I ask is because I want to use the HOT vex in my shader but I can't figure out how to get it to displace it along vectors (so I get a choppy look, standard up-down displacement I can do). The HOT ocean displacement does it nicely but I would like to use it inside the new mantra surface shader, without having to rebuild everything the old way. Edited December 22, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
Macha Posted December 22, 2010 Author Share Posted December 22, 2010 (edited) With regards to HOT, this is the best I've come up with so far. The displacement is fine in fact, but the normals for display are somehow messed up. I apologize if it should be in another thread, but perhaps somebody can see what's wrong with this setup. (Using st directly works as well but I need to choose really weird scales and the shading normals are still wrong) Edited December 22, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted December 22, 2010 Share Posted December 22, 2010 So, how would I get, for example, the v_choppywater node inside the vop network? If I build it the same way as in H10 (see image) then I can access its parameters with Import Displacement Variable vop, but it's not quite the same as having it inside the network. The reason I ask is because I want to use the HOT vex in my shader but I can't figure out how to get it to displace it along vectors (so I get a choppy look, standard up-down displacement I can do). The HOT ocean displacement does it nicely but I would like to use it inside the new mantra surface shader, without having to rebuild everything the old way. I haven't messed around with HOT at all, but I'm willing to bet it was written in vex so whomever wrote it will need to update the code to include the new updates to output and collect, and any other things that may have been updated and recompile the code. If you can dive inside the node to vops then you can put it inside the new material node. Quote Link to comment Share on other sites More sharing options...
Ryan Posted December 22, 2010 Share Posted December 22, 2010 I think I know what you mean... Before H11, I used to lay down a VOP VEX Surface SHOP, then go inside and use VEX Choppy for displacement. Now in H11, in the SHOP context, you can lay down a Subnetwork, then go inside and then put a Choppy in the suboutput. You can also use a 'Surface Shader Builder' or a 'Displacement Shader Builder' to link to the suboutput, and do things the old way. Hope that helps some... Quote Link to comment Share on other sites More sharing options...
ikarus Posted December 22, 2010 Share Posted December 22, 2010 With regards to HOT, this is the best I've come up with so far. The displacement is fine in fact, but the normals for display are somehow messed up. I apologize if it should be in another thread, but perhaps somebody can see what's wrong with this setup. (Using st directly works as well but I need to choose really weird scales and the shading normals are still wrong) did you try using a Shading Normal node to update your normals? getting correct normals out of ocean eval isnt as straight forward as it seems Quote Link to comment Share on other sites More sharing options...
Macha Posted December 22, 2010 Author Share Posted December 22, 2010 Yes that's what I did in the image I posted before, but then I am back to the original problem. Or do you mean we could put two shaders on one object and them import the displacements variables? Before H11, I used to lay down a VOP VEX Surface SHOP, then go inside and use VEX Choppy for displacement. Now in H11, in the SHOP context, you can lay down a Subnetwork, then go inside and then put a Choppy in the suboutput. You can also use a 'Surface Shader Builder' or a 'Displacement Shader Builder' to link to the suboutput, and do things the old way. Hope that helps some... Quote Link to comment Share on other sites More sharing options...
Macha Posted December 23, 2010 Author Share Posted December 23, 2010 Ah, but I don't know how to go about that. You mean plugging in the original normal? I think that's what it is doing by default. At least it looks as if it displaces but without changing the original shading normals. I tried adding normals, swapping, you name it! But the solution evades me. did you try using a Shading Normal node to update your normals? getting correct normals out of ocean eval isnt as straight forward as it seems Quote Link to comment Share on other sites More sharing options...
matt Posted December 29, 2010 Share Posted December 29, 2010 Just a wild guess (I'm still a Houdini noob, especially when it comes to VOPs), but do you need to transform the normals into shading space? The normals that come directly out of the sim are in object space, so if Mantra shades by default in camera space it may need to be converted? The reason I mention this is because I've been working on a HOT implementation for Blender recently and have just got the normals figured out there too. Quote Link to comment Share on other sites More sharing options...
Macha Posted January 4, 2011 Author Share Posted January 4, 2011 Hey Matt, thanks for the tip. I don't know what space the HOT displacement normals are in. If the sim comes from the geometry context its obvious, but in this case its purely shader generated so something isn't clear there (at least for me). Quote Link to comment Share on other sites More sharing options...
luoqiulin Posted January 24, 2011 Share Posted January 24, 2011 (edited) as i know, HOT replaced it's own normal after displace. if your orginoal sop is a flat grid(normal is (0,1,0)), the result is right. if your origional sop is dispalced already, you shoud find out it's origional normal and add it to HOT's normal . remember, $NY is superabundance than 1, so subtract 1 for $NY... sorry i have no HOT home in vex you can do this: {(global normal in) ----normalize----vector to float----($VY-1)----float to vector} +{HOT normal----normalize} (maybe you should add a normalize node at last) and of cause both origional sop and HOT vex's normal should be toggle on. Edited January 24, 2011 by luoqiulin 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.