I have used the dirty vertex via vertex paint before to mix shaders, but I appear to have done something wrong and I have been unable to work out what. Here is a screenshot of my set up (left = dirty vertex in vertex paint mode, 2nd left = render result, 3rd left = material set up with attribute node using the vertex colour name, and on the right you can see the vertex colour named “test”):
For some reason, I always get a solid red diffuse result, no matter what the settings in the colour ramp are, even if I invert the result from the ramp. The way I understand it, the white values on the vertex colour map will take a value of 1, which are currently being mapped to the same value of 1 in the colour ramp, and are then getting sent to mix node for a factor of 1. That should result in the other diffuse image being displayed (which is jut a texture which works fine when the mix node is bypassed). Where the vertex colour is black, a 0 will be sent to the fac in the mix node so the first shader will be used, i.e. the red…so why is my entire model red when i can see plenty of white in the vertex colours?
matt, if you get solid red, this means only white is used… so you need to tweak the colorramp. do it like this: first plug the end of the colorramp into the diffuse color, and this into the material output. you should see the vertex paint on your model somehow. since you see in your nodeset up only red in the render, i suspect you will see the vertexpaint now almost white. use the colorramps slider and push it until you see the vertexpaint about the way it looked first on the model. then replug everything as it was. … as we cannot see your complete nodeset up, i cannot tell if this is the only spot that makes trouble… but try first what i described, and see if you get the other color too.
No idea… I have this file here you can paint bump and color on object while being in vertex paint mode… See yourself if it works.
Nodes are quick and dirty; somebody might refrain again something about monkeys and if they are a lot… But whatever, it just works. http://www.pasteall.org/blend/26925
Edit: If i’m in doubt if it works, some levels or anything which goes to Fac for mixing, i use Emission shader which i temporarily connect to Output and connect questionable noodle to it’s input.
Edit2: what you could do is disconnect all inputs from Diffuse below red, make it some poisonous color and play with Color ramp.
Add Brightness/Contrast before Color ramp maybe.
Thanks! I tried plugging the colour ramp to the colour socket in the diffuse and that into the shader output…but I actually get a solid black, rather than my vertex colours. That makes sense with the red result to me (black = 0, hence only showing shader in socket 1 of the mix node). Why my vertex colour is solid black…I do not know. :S
Strange I know! Yep, I checked the vertex colours themselves in the vertex paint and they were still as shown in the first image (a range of white and black definitely visible). I tried creating an entirely new material. I tried re-doing the vertex colours, I tried renaming the vertex colours, I tried removing a secondary material that is used for a hair particle emmiter, I tried UV unwrapping again…I can’t think of anything else. I will try creating a new object and doing the dirty verts for that, and if no success I will try your blend file (currently running a simulation so can’t open anything new). Thanks for your help!
So I added Suzanne to the scene and set up the dirty vertex as per my original post and it works fine. I just cannot get it to work on this particular object. I have tried duplicating, decimating, recalculating normals, removing doubles, re-doing weight paint, etc etc but it just wont work. For some reason that object will not allow me to use weight painting, that seems a bit like a bug to me. I will try the latest stable build tonight, and if that doesn’t work then I think I will have to pass on trying to fix it for now.
At that point you should upload your blend to http://www.pasteall.org/blend/ , so someone more expert in cycles nodes can give a look at why this is happening.
one other idea… in your screenshot the mesh is called mesh.010, ,is there an same object in the scene called mesh that maybe renders all the time above the one you change the nodes for?
Not that I am aware of (scene getting complicated now! Lesson in organisation…). This did give me an idea though - I appended the object to a new file and tried to render, still got black…but when I renamed the mesh and set the reference to object rather than data…I finally got a render of the dirty vertexes! However, when I tried to re-append that object back to my original scene (with new object name and new mesh name) I ended up getting black again. I am going to try renaming materials so that they don’t have a duplicate when I append…see if that helps :S
So I have an empty scene with the model with the dirty vertexes that works, however, I am unable to get this into my actual scene that I am working on. Things I’ve noticed:
I can append the working dirty vert model to any new file and instantly render it properly in cycles without any adjustments to settings (so if I upload the file you will all find that it works fine!).
If I append it to my actual scene in my current project and try to render the same as in 1), then I just get a solid black shape where the object is supposed to be. My project is currentlty 300 Mb or so…not ideal for uploading and downloading.
one last idea matt, in the panel where one organizes renderlayers… maybe you have the layer as mask layer where you put this mesh?
if not, it is maybe a bug in the scene file. these occasionally happen, i lost for example my robot file after hours of retopging, it opens correctly but as soon as i go into edit mode the robot vanishes… i had several such weird files, each with other issues though , maybe yours became so too :-(( … you could try to append all your objects into a fresh new scenefile to rescue the whole (group some objects, and append the groups, makes things easier)