Jump to content

Custom Shader


Recommended Posts

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...