Jump to content

Linking Surface And Displacement?


jjstanley

Recommended Posts

I am trying to make a shader that looks like old, chipped paint. I can get the surface shader looking quite good, but I need a displacement shader that matches it. If I do it in Photoshop it is no problem but I would like to find a procedural solution. How do I link the pattern in the surface to the displacement?

Thanks, Jerry

Link to comment
Share on other sites

I am trying to make a shader that looks like old, chipped paint. I can get the surface shader looking quite good, but I need a displacement shader that matches it. If I do it in Photoshop it is no problem but I would like to find a procedural solution. How do I link the pattern in the surface to the displacement?

Thanks, Jerry

Unfortunately you can only do this other way 'round :/

The Displacement shader gets run my Mantra first, but you can "export" chosen variables (using the export VEX keyword) which can be picked up by your surface shader using the dimport() VEX function.

The ingredients in VOP land are: export the variable you want using the Parameter VOP with the Export Parameter toggle switched on. Now you can import the value of that variable in the Surface context using the Import Displacement Variable VOP (i think thats the name).

Write in again if you need an example!

Jason

Link to comment
Share on other sites

Thanks for the reply. That makes sense but I think I am still not on the correct track. Because the nodes are different between surf and disp even though the values are linked they do not line up correctly.

I think I need to be finding the displaced amount and coloring based on that maybe. How would you go about a flaking paint look?

Link to comment
Share on other sites

Thanks for the reply. That makes sense but I think I am still not on the correct track. Because the nodes are different between surf and disp even though the values are linked they do not line up correctly.

I think I need to be finding the displaced amount and coloring based on that maybe. How would you go about a flaking paint look?

Well, the upshot of this is that you really have to move all of your noise calls/pattern-generation/mapping for your driving values (eg. like a flake_mask or a rust_amount) to the Displacement context and dimport() the values into your surface shader. Don't duplicate your pattern generaton in the surface shader - as not to cause recomputation or risk the two becoming misaligned or different as the shader evolves.

As for what the best technique for generating a flaked paint look, that could be a pretty deep discussion. Do you have any photo reference for what you're attempting to recreate? Reference is essential for this type of work; don't try to match a picture in your imagination: it's not worth it ;)

Link to comment
Share on other sites

All depends on how close to the object your camera gonna be (and on what angle). In most cases (99%) you don't need to model these flakes. For some rare situations this can happen. Hard to say like that.

As far as I can say bump or displace wouldn't help too much in case of such a big cracks. Better keep it in distance... ;)

cheers,

sy.

Link to comment
Share on other sites

All depends on how close to the object your camera gonna be (and on what angle). In most cases (99%) you don't need to model these flakes. For some rare situations this can happen. Hard to say like that.

As far as I can say bump or displace wouldn't help too much in case of such a big cracks. Better keep it in distance... ;)

cheers,

sy.

I'd say the best/easiest way to get the flakes is to generate a flake mask in photoshop from that image and do the rest in your own shader. However, if you like a challenge (the flakes don't look terribly easy to generate procedurally) you can look at the pattern generator VOPs (Tile VOP, snake scales, etc) - and even possibly this old-but-good page: http://odforce.net/happy_rendering_with_vex/

If you intend to get up close to it, CopyStamp some paint flake geometry around and be done with it:)

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