jit.geom.displace and jit.gl.mesh draw_mode not compatible
Hello Jitter comunity and developpers,
I am trying to use jit.gl.mesh draw_mode attribute to draw in points, or lines, etc. Problem is :
after using jit.geom.displace, jit.gl.mesh won't display different draw modes. If I use jit.geom.topints, it chanes the draw_mode, but then, I cannot modify the initial shape, this includes or its dimensions.
Is there a way to make it work ?
Thank you.
Use [jit.geom.topoints] instead of [jit.geom.tomesh] and you'll be able to use different draw modes.
Still struggling to precisely understand why though.
use jit.geom.tomatrix and do whatever you want with the matrix output.
Ok, it worked, thanks TFL and Rob, jit.geom.topoints after jit.geom.displace
Rob, there's a few things I don't get here:
Why can we use different draw_mode on jit.gl.mesh when using jit.geom.tomesh in some circumstances? Sometimes we can, sometimes we can't. jit.geom.displace is a culprite, but not the only one, and it doesn't seems to be always a culprite.
What's the actual difference between jit.geom.tomatrix and jit.geom.topoints, given that both output a 1D 8 planes matrix, but jit.geom.tomatrix gives a 6 times bigger matrix than jit.geom.topoints (at least with duck.dae)? Is it that tomatrix provides individual triangles every 3 cells instead of points at every cell, so each point (or most) is duplicated 6 times for each triangle it is part of?
If I understand correctly, jit.geom.tomesh is like [jit.geom.tomatrix] (sending sets of 3 points for each triangle) but I guess sends its data directly to a format jit.gl.mesh understands instead of converting it to a jitter matrix in-between?
Here is a patch illustrating cases where draw_mode work or don't work. It also seems that jit.gl.pbr doesn't like point_mode other than square.
Why can we use different draw_mode on jit.gl.mesh when using jit.geom.tomesh in some circumstances? Sometimes we can, sometimes we can't. jit.geom.displace is a culprite, but not the only one, and it doesn't seems to be always a culprite.
clearly this area could use some tightening up. technically not all jit.gl.mesh draw_mode's can support geometry input, so the tomesh converter takes control over draw_mode when bound to a mesh. We could add a draw_mode attribute to tomesh that provides options supported by the geometry input.
What's the actual difference between jit.geom.tomatrix and jit.geom.topoints, given that both output a 1D 8 planes matrix, but jit.geom.tomatrix gives a 6 times bigger matrix than jit.geom.topoints (at least with duck.dae)? Is it that tomatrix provides individual triangles every 3 cells instead of points at every cell, so each point (or most) is duplicated 6 times for each triangle it is part of?
exactly this. topoints provides only the unique points, rather than tomatrix which provides a triangulated mesh where points are duplicated for each triangle.
If I understand correctly, jit.geom.tomesh is like [jit.geom.tomatrix] (sending sets of 3 points for each triangle) but I guess sends its data directly to a format jit.gl.mesh understands instead of converting it to a jitter matrix in-between?
exactly
Thanks for the note about PBR points, this seems like a reasonable feature request.