Gridshape now using internal mesh and jit.gl.material questions

Jun 5, 2012 at 1:09pm

Gridshape now using internal mesh and jit.gl.material questions

Hello

I’ve read somewhere that with max6 jit.gl.gridshape is using a mesh internally.

So My questions are:
- Is that the case only with gridshape or with jit.gl.model / nurbs / sketch… aswel?
- Is there a way to access the tangents (or other vertex attributes) in a shader? A similar way one would do it with the original jit.gl.mesh object?

- And: As jit.gl.material generates its own shader is there a way to use the object with ones self-made shader? Would there be any benefit? Easy texture-storing for example?

Thanks a bunch!
Regards

#54047
Jun 5, 2012 at 6:27pm

“- Is that the case only with gridshape or with jit.gl.model / nurbs / sketch… aswel?”

only gl.gridshape uses a gl.mesh internally. however, there currently is no way to calculate tangents for gridshapes without output-ing to a gl.mesh. this patch demonstrates:

– Pasted Max Patch, click to expand. –

if a model file contains tangents, they will be loaded and made available to the vertex shader with jit.gl.model.

“- Is there a way to access the tangents (or other vertex attributes) in a shader? A similar way one would do it with the original jit.gl.mesh object? “

you can access tangents from either jit.gl.mesh or jit.gl.model by binding a vertex attribute, in the following manner:


attribute vec3 tangent;

“- And: As jit.gl.material generates its own shader is there a way to use the object with ones self-made shader? Would there be any benefit? Easy texture-storing for example? “

there is no way to provide a user-made shader to the jit.gl.material object.

hope this helps.

#194525
Jun 5, 2012 at 8:13pm

Yes, this helps.

Thanks alot.

#194526

You must be logged in to reply to this topic.