JuriBryan Posted January 24, 2012 Share Posted January 24, 2012 hey guys, so i have a big problem. I need a custom mantra shader that will allow how to texture fractured objects with out the use of UVs. So what i thought that I will use "sticky" textures, that use the uvs I have on the frame before the fracturing starts. This texture will then be sticking on their geo with out losing it, so that it "sticks" to the geo. Then I would use the groups to shade the new inside of the geo with a procedural texture. All in all the shader would need to do something like the shader in this video in the end when he shows the example with the street that gets destroyed: http://www.sidefx.com/index.php?option=com_content&task=view&id=1540&Itemid=132 Any ideas, because i have no idea on how to get such a shader to work.. cheers Quote Link to comment Share on other sites More sharing options...
aghourab Posted January 25, 2012 Share Posted January 25, 2012 hey guys, so i have a big problem. I need a custom mantra shader that will allow how to texture fractured objects with out the use of UVs. So what i thought that I will use "sticky" textures, that use the uvs I have on the frame before the fracturing starts. This texture will then be sticking on their geo with out losing it, so that it "sticks" to the geo. Then I would use the groups to shade the new inside of the geo with a procedural texture. All in all the shader would need to do something like the shader in this video in the end when he shows the example with the street that gets destroyed: http://www.sidefx.com/index.php?option=com_content&task=view&id=1540&Itemid=132 Any ideas, because i have no idea on how to get such a shader to work.. cheers Not quite sure what you're aiming for here but... If you send an object with UV's to DOPs, the external faces will maintain their UV positions correctly. I.e. Sim a box RBD fracture object, with UVs and a checkerboard pattern on it, once it fractures all the faces that once belonged to the outside of the box will maintain their texture. The points on the insider will have UV's of <<0,0,0>>. If you want to isolate the inside faces based on UV's, you could simply use a compare statement (if UV == 0, then its an inside face, otherwise its outside), though I'm sure there's probably a far more elegant solution (seperate faces in sops based on UV/Normal/other attrib, then simply set different materials for the different grps). I did a quick test, and as I can't upload it i'll just quickly describe the process. After your DOP Import in your sop network>> -Attribute promote (name uv, original class Vertex, new class Point) -Lay down a vop sop -Inside, lay down Import Attribute (Attribute uv) -Feed output of the former node into first input of compare statement -Lay down switch statement, feed output of compare statement into first input of switch -Feed Global CD into second input -Feed custom Parameter into third input -Connect result into CD global output Now if you modify the custom parameter from the third input, say make it red, you should find that the inside faces are red, and the outside are whatever they originally were. VOP sops are pretty similar to shader's so you should be able to modify this to work in a shader, except that instead of connecting a custom color, you connect a anti aliased noise or something. Hope this helps... Quote Link to comment Share on other sites More sharing options...
Erik_JE Posted January 25, 2012 Share Posted January 25, 2012 Why not use the UVs ? When you fracture an object it gets the UVs from the original object and then you just apply different shader to the inside and outside group and everything should be jolly. No need to complicate things. Quote Link to comment Share on other sites More sharing options...
JuriBryan Posted January 25, 2012 Author Share Posted January 25, 2012 (edited) Ohhh that is sooo much better than anything I could dream of! Thanks guys... I think i got a little to maya on that problem:P Edited January 25, 2012 by JuriBryan 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.