Controlling dirt texture by vertex paint??

I made a basic node setup that adds a dirt texture(black and white) to any shader that is controlled by a vertex paint group. If possible, can someone check it out. I am looking at suggestions but it works.

Step 1. The method I use was have a mix shader use a attribute vertex color to determine to use the original color or the color affected by the dirt texture. All of it is gradual.

Step 2. Then I duplicated the same thing with a base color of white and the latter as above.
(new grayscale factor!)

Finally, the new actual color (from step 1 - includes dark spots) is passed to a diffuse and glossy shader. The latter acts as the factor now (from step 2). If the original color was black it allows for glossiness. Only the areas affected by the dirt texture and vertex color paint group are glossy by value.

Here is the Node setup. I added several RGB to BW conversions and also inverts. This allows a endless amount of things to do.

What do you think? If its good feel free to improve on it.

Vivienne

Attachments

dirtgraduallycontrolbyvertexpaint.blend (501 KB)


This is the update. Knowing a reflection base is white. I had to mix the new material with white. It seams to work with black base color. I was able to do a glossy concrete with faded dirt spots.

Updating .blend showing what I mean.

Attachments

dirtgraduallycontrolbyvertexpaint1.blend (502 KB)