Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Understanding ofMesh with ofShader

$
0
0

@lewislepton wrote:

howdy folks,

this is just a small & hopefully quick question. but I wanted to ask about shaders & using them with ofMesh.

I have a project that generates random addVertex points, which can be controlled via OSC etc. & whilst I love how this has turned out & does have some good results, I’m looking at getting shaders in the mix to extend to further.

can ofMesh bring in ofShader to have shaders on top of the generated ofMesh. the mesh itself is not always filled, but there are points such as using the OF_PRIMITIVE_TRIANGLE_STRIP where it does get filled in, but has no depth [currently].
ive tried a few different options, such as wrapping the shader around the mesh with

shader.begin();
mesh.draw();
shader.end();

without much fanfare. so assuming it will take more than just that. also tried even other setting on the modes, as well as a few other things.
it wasn’t until I got to 2am that I had to stop, come back with a fresh head & try again. but no luck.
im not looking to change the geometry [right now]. it’s only to plaster it over the mesh, with that doing all the other work.
its just simple shader im working with right now, just has a red color.

scratching my head a bit here, so just have to ask. not sure where other steps may be needed, if any

thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles