gl.material changing lighting behaviour of gl.gridshape
Hi there,
I want the lighting to appear on all sides of gridshapes when there is a gl.material applied. It seems that the plane, cone and circle do not reflect light on all sides when they have a gl.material attached. Can anyone tell me how to resolve this please?
Thanks,
Tim.
2-sided lighting is not currently supported by jit.gl.material unfortunately. depending on what your setup is, you can workaround by duplicating the object you are drawing and reversing the normals. post a patch if you want more details.
Hi Rob,
Thanks for your response. Can you tell me what normals are and how to reverse them, please?
Thanks,
Tim.
Hi Tim.
Not sure if you have already figured this out, but I just did because of this post :)
I'm not able to explain what normals are, but if you duplicate the shape you are working on and just add 180 to all three numbers of "rotatexyz" that should do the trick.
If you are moving the shape around, you can use the "vexpr $f1 + 180 @scalarmode 1" and feed the position list through that.
Could be, that there is a more elegant way of doing this, but this worked for me.
something like this:
I've realised, that my method doesn't in fact do, what I thought it did. For certain position and rotation it looked right, but not always.
However, I now always have some surface that is lit up, so I don't get dark patches when rotating.
Rob's solution looks more correct to me ;)