Black Dots on Multiplied Gridshape
Got this great patch from the managing multiples article and just wondering is anyone able to say why there are black dots on the bottom of these grid shapes and have any ideas how to remove them, please? breaks the experience a bit with those on... I am referring to the sphere shapes - they have the block dots on the bottom when rotated.
Here's the page I got it from...
You mean shadows?

You can disable the lights and materials to have a flatter effect:

Hey, really appreciate the speedy reply!
Sorry for the lack of clarification. I have some spheres here, one side is fine but rotated 180 there are black dots on the bottom. Any ideas why and how to remove, please?


Ah! I didn't spot them.
Was a fun investigation: it seems that [jit.gl.mesh @auto_normals 1] struggle to compute the normals at the bottom of the sphere for some reason, hence the black hole.
The fix is to take the normals coming from the source. What the two [jit.gl.gridshape] output isn't just the position matrix, but a 12 planes matrix which include position (planes 0-1-2) and the normals (planes 6-7-8). So instead of that [jit.matrix 3 float32 20 20 @interp 1] I used a [jit.unpack 2 @offset 0 5 @jump 3 3] which gives me the two desired matrices. And I removed @auto_normals 1 from the [jit.gl.mesh] as I don't want it to auto-compute the normals anymore.
Okay interesting. How do we get it so that you see the surface responds to lighting as if the light that is shining on them from behind the camera? Also, why is it the lighting working in a way that is natural where the base of the shapes are dark constantly and the other side is light constantly?
Thanks 🙂
why is it the lighting working in a way that is natural where the base of the shapes are dark constantly and the other side is light constantly?
This is just the default lighting configuration of jit.world. But you can overwrite it by adding a [jit.gl.light] to your patch and playing with its attributes.
Here I've set the light in a way that makes the light to come from behind the camera, so we see very few shadows:
Hmm im currently looking into rotating the vertices and the normals using jit.gen. So that when I rotate the the entire shape those components also move. Previously the shheres would move but the way that the light was reflecting off of those vertices and normals stayed static. Got any ideas how I would set that up within jit.gen, please?
Thanks again.
Instead of changing the normals, why not simply changing the light direction? I think it should give the same effect, unless you want to go fancy with the normal transformation, in which case you can throw a [jit.gen] after the middle outlet of the [jit.unpack] and do whatever you want in it.
So I currently have the spheres rotating in time with the bpm inside of a max for live device.
Do you know how to get rotation working within jit.gen please?
I think it’s something to do with cos sin but can’t figure it out.
any help appreciated. Thanks
Again, how do you want to rotate the normals? What kind of effect do you want to produce?
Here is a small example of messing with the normals. Definitely not the mathematical definition of a rotation, but gives the illusion. I also added some noise to give the texture more relief.
Here is another example where I don't touch the normals but instead rotate the light in a circular movement:
In both examples I used jit.mo.time to produce some basic rhythmical automation.
Ah cool this is some very interesting work!
However, to return to the beginning of my request - I asked about how to remove the black dots on the bottom of the spheres because when I rotate the whole the whole sphere (made out of spheres) one side looks different as there are black dots on it. Then you said it was due to normals so we did some calculations so we reset the normals using jit.unpack and then disabled auto_normals within the mesh.
When normals have been disabled and then controlled by jit.unpack as can be seen in the screenshot recording below when the shape rotates they disappear on that other side. I have other Max for Live objects responding to the lighting I have set up in the world m4l device which is why I want to leave the light source as is and have the normals rotate with the shape as I think they would have been before we disabled auto_normals within the mesh.
So, I am basically wanting the entire sphere to rotate and for both sides of the individual spheres to appear exactly the same. As you can be seen in the screenshot recording I have rotation in sync with the Ableton BPM.
Does that make sense? Your first patch looks pretty close. I think we need to rotate the vertices and the normals to get the effect I am looking for but hopefully the screen recording makes what I am going for clearer now.
Thanks again for your interesting ideas!
Tim.
You're just looking at the dark side of the moon :)
This happens either because you rotate the camera and not the sphere of spheres, so at some point you look at the spheres "from behind" (in the opposite direction of the light, hence the dark side), either because of what seems some weird behavior (unless I just don't get the math) of the gridshape's @matrixoutput 2 (on with transforms) attribute not playing well with normals or something.
As a workaround I would use @matrixoutput 1 (without transform, not taking the gridshape's rotation into account), and rotate the [jit.gl.multiple] directly instead: