I'm using a vertex shader with a Pshape to do some Vertex Displacement Mapping. It works fine with the shape but how can I access and edit its stroke (in red in the picture) ?
I have found a solution. I'm using two shaders: one for the surfaces, another for the strokes but it is not optimized: I do the same calculations two times. Do you know another way to proceed ?
Answers
I have found a solution. I'm using two shaders: one for the surfaces, another for the strokes but it is not optimized: I do the same calculations two times. Do you know another way to proceed ?
If "stretched" lines are not a problem, you could use a simple wireframe texture, or fragment shader behaving like on:
If you are searching for a more sofistcated solution instead, have a look into Solid Wireframe:
Btw.: Of course this can be used display quad-wires as well, but that's up to you. ;)
I get the same error on both of your examples :
Any idea ? I'm using Processing 2.2.1
That's because 2.2.1's PVector class didn't support method chaining. You'd have to split this into two operations to make it work:
But I don't think there was an attrib() equivalent back in 2.2.1...
Great examples! Thank you!