Post
by Maximus » 13 Feb 2013, 02:50
Alright here is a screenshot which i'm gonna describe it a bit.
[rimg=200]http://img600.imageshack.us/img600/9219/layerv.jpg[/rimg]
Now, I hope you are familiar on how the layer system works in render tree anyway i'll try to be as much clear as I can.
Basically what you want is a diffuse layer (with its own reflections control), another diffuse layer in this case a dirt in your case the black dirt (with its own reflections control) and the flexibility to change everything without much hassle.
Now you first need the diffuse images of course, the image on top must have a black/white mask to guide some of those things.
So in my setup i used a yellow gradient shader for the bottom layer, and a red dirt image with its relative b/w image to drive the parameters.
As you can see, i have 2 mia materials. The first one is set in a traditional way, it has the gradient yellow diffuse and you have all the normal controls in it.
Since we know we are gonna put on top of this layer another layer with another diffuse, i've used the b/w mask of our next diffuse to "mask" the reflectiviy and exclude from this mia_material the dirt spot. If you plug a black and white map on the refl_color of the mia material, the black part of the map will be 0 reflections while the white part will be full reflections. Since my map has the dirt part black i'm actually excluding the reflections on that part out of this materials, because we want to control them alone and we are gonna do it later with the mix node.
Still in this first mia material, i've added on top the red dirt diffuse using the layer system. I have plugged the red diffuse texture in the color input and i'm driving the diffuse with a Mask.
I'm using the color picker set to blue in this case, but u can also use red or green, doesnt matter since your image is black and white, its gonna use luminance, not rgb.
So what i did basically is just adding a diffuse layer on top of the yellow, driving the diffuse part with the black and white mask. When you add layer on the mia material you have to right click the layer name and tell it what parameter are you adding the layer to. IF you dont do this it wont work. Also in the Mia material you need to enable the mask mode "Use Mask Connection". Check the screenshot.
Now all this first Mia material setup give us: 1 yellow diffuse layer with its reflections (you can control the reflections by just increasing it with the normal reflection parameter in the mia, note that those reflections wont affect the red dirt layer because you are using the scratches.jpg mask in the refl_color port)
2 a red dirt diffuse on top which now cant have reflections because we have masked them with the scratches.jpg in the refl_color slot.
Now to have the reflections on this red dirt layer just create another mia material, make it mirror-like by increasing the facing reflectivity to 1, and mix it in "Blend" mode on top of the other mia material. I used an inverted node to invert the black/white scratches map in the weight of the mix2color node. IN this way if you increase or decrease the reflections in the second mia materials it will only affect the red dirt layer on top, and you still have the separated reflections for your yellow bottom layer in the first mia material.
I hope i made sense in all this wall of text. I've uploaded the model with the shading network and setup.
Hope that helps
Cheers, Max
p.s. obviously this setup is quite unusual i must admit, because you want 2 separate controls for reflections, usually you just plug a black/grey/white image in the reflection color to drive the reflections based on that image. But yeah if you want this, thats how you do it.
keep in mind that the layering system isnt physically accurate with mia materials, in the new upcoming shaders (miLA) this thing is gonna be easier, with better control, and you will preserve the physically accuracy of the reflections/refractions and shaders in the whole layering system.
You do not have the required permissions to view the files attached to this post.