Displacement Map Masked by Surface Luminance


#1

Hi guys,

I am trying to implement a requirement of an animation almost two weeks, specifically, the “building material”. My goal is that the intensity of displacement is relative to how much light gets to the surface. At first, I thought it would be easy, it would just connect the node outvalue of surfaceLumiance the value of displacementShader. But when I try the Mental Ray simply crashes. Apparently it cannot read the value of surfaceLuminance, but i did further tests using this to make “masks” in the texture based by luminance received and got no problems with it.

I’m trying an procedural solution independent to the renderer. below some shading networks I’ve tried:



Anyone have any idea how to solve this issue?


#2

I’m not entirely sure how to fix it woth a fully procedural solution. If your lighting and shading is uber simple, you can maybe set up a network to approximate the brightness via the incidence of light, but thats only easy for super simple lighting, though that may actually give you the same crashes…I’m not sure.

I THINK the issue here is that your shading network is a cycle, in a sense. The luminance drives the displacement, that changes the geometry, that changes luminance etc etc. I ran into the same problem when trying to use ambient occlusion as displacement.


#3

VB2341, 1, When you spoke about my shading network is a cycle, I understand why it don’t work. But I could not think of another solution, my real goal is to define the application of the displacement of a procedural way, for example displacement only is applied on character shadow.

This image shows more or less what I want to do. Do you have any other ideas of how I can accomplish this?


#4

I found the solution:

I use 3 displacementShaders, one for maximum distortion, one for minimum and one for the result of the merge based on light that the surface receives. But would not have found without clarifying the VB2341, thanks.


#5

How are you doing it based on light received? It appears that the blend node isn’t connected to a surface luminance node. The displacement shaders are only outputting scale, which doesn’t have an incoming connection, so its just a single floating point number. Also, the first two displacement shaders in this case aren’t functioning as anything more than simple texture nodes, as they’d just be outputting maps at best. I think if you change your lighting, you won’t see any real difference. If it does though, by clarifying for you, I’ve confused myself!


#6

Hi There

You can use mip_rayswitch or mip_rayswitch_advanced - shaders for connecting different shaders / textures for different rays but alas I’m afraid if you need to get displacement into the shadow ( or some other ray ) only, you need to write a custom mr shader for that.

Read here more about the mr production shaders : http://www.nvidia-arc.com/fileadmin/user_upload/PDF/production.pdf

Also google for mr production shaders tutorials in youtube. There should be a few.

With renderman studio & slim - shading network tool this would a breeze but if you’re bound to mr, then this is the situation.

All I can think in a rush.

/Risto


#7

VB2341, actually, I just forgot to connect to surfaceLuminance when I post the solution but is basicament so use it as the input of the blender.

The goal was only my mask where the displacement would be applied. To do this I created a value of displacement with maximum and another with minimum distortion required. using blendColors I get the maximum and minimum “calculated” and mix based in rate of the surface illumination.

I ran the test animating the lights and working with this application oceanShader only in the shadows of the surface.

ristopuukko, Really interesting, but I usually prefer to try independent solutions of the renderer.