6
$\begingroup$

I am currently attempting to do a trick with texture mapping and noise texturing. The effect I am trying to accomplish is to change the direction of the stretching on the noise bumps.

On the image below, the bumps get stretched out as they approach the edge of the sphere. They stretch in a direction parallel to the edge. What I want to do is have them stretched perpendicular to the edge, so that going longways with each bump it will point towards the edge more as the underlying surface points away from the camera.

enter image description here

The image below, a mockup made in GIMP with the Motion Blur (Zoom) filter, gives a rough idea of the effect I wish to accomplish. The desired effect also should not rely upon baking or screen size/ratio, and it needs to work on organic shapes (I am just using a sphere for testing). It also needs to work without OSL since I intend to use GPU rendering.

enter image description here

Below is the current node setup I am using. Probably nowhere near close to what I need to do to get this to work.

A

$\endgroup$
  • $\begingroup$ That picture vaguely reminds me of a reflection, as if the ball were a mirror reflecting a textured plane behind the camera. Perhaps you could do some math on the camera ray and the surface normal to compute a new texture coordinate as if the ray were being reflected and striking a plane behind the camera. $\endgroup$ – Mutant Bob Aug 5 '15 at 19:04
  • $\begingroup$ Yeah, the texture coordinate input I am using right now is "Reflection". I've tried a variety of things to get it working, though I had no idea what I was doing. $\endgroup$ – Zauber Paracelsus Aug 5 '15 at 20:36
3
$\begingroup$

Set up the nodes as pictured below. In Texture Coordinate node choose the Normal output. Select the Normal option in a Mapping node and experiment with its Scale settings. enter image description here

Change the Z Scale to increase the stretch of a noise. enter image description here

I used this technique to procedurally create the iris. Hope this is the effect you're looking for. enter image description here


UPDATE: After playing with the nodes I found out a new solution, though I am not sure it's the proper way of doing it. enter image description here

|improve this answer|||||
$\endgroup$
  • $\begingroup$ Close, though not quite. The effect I'm going for is dependent on facing. IE: the more the surface faces away from the viewer, the more stretching there will be. $\endgroup$ – Zauber Paracelsus Aug 5 '15 at 20:35
1
$\begingroup$

I managed to figure this out on my own after toying around a bit with the method suggested by Gonzou. Before passing the Normal output into the Mapping node, the solution is to first pass it through a Vector Transform node, and set it to transform from Object to Camera.

enter image description here

And that results in the desired effect:

enter image description here

|improve this answer|||||
$\endgroup$
  • $\begingroup$ please see my updated answer. It took me some time to figure it out, though your method looks better than mine. It's just much simplier :). $\endgroup$ – Paul Gonet Aug 6 '15 at 11:26
  • $\begingroup$ You could also plug Camera output from Texture Coordinates node, so this effect won't depend on surface rather that a camera position (assuming this instead of Vector Transform) $\endgroup$ – Mr Zak Aug 6 '15 at 12:46
  • $\begingroup$ I had tried using the Camera output, though I couldn't get the desired effect. Regardless though, the entire endeavor was pointless. I was going to use the generated texture through a bump node, but it refused to use texture inputs with any camera-space mapping :-/ $\endgroup$ – Zauber Paracelsus Aug 13 '15 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.