auto_material and jit.gl.sketch


    Sep 08 2008 | 6:36 pm
    I've just written a patch and small article for my website about lighting in Jitter. The idea is not so much a tutorial as an exploratory approach to finding out how lighting is tackled in Jitter. However, coming to test the patch I'm completely stumped by something regarding auto_material and jit.gl.sketch. If I disable auto_material and draw something in sketch, say 'drawobject gridshape 1', material parameters have no affect on the lighting/colour of the scene, but altering the colour parameters does. This is not what I expected and indeed is not what happens with other jitter objects. Am i missing something totally obvious?
    pelado
    Here is a patch that shows what I mean

    • Sep 08 2008 | 7:41 pm
      hey pelado. you are correct. for normal gl objects, with lighting_enable 1 and auto_material 0, color attribute will be ignored and mat_diffuse, mat_specular, mat_ambient will be used.
      it looks like gl.sketch is ignoring the mat_diffuse and mat_ambient, and just using color even with @auto_material 0. not really sure why this is, but i will try to find out. mean time, using color instead of mat_diffuse has the exact same effect.
      also gl.sketch command "glmaterial diffuse 1 1 1 1" should also have the same result as @mat_diffuse 1 1 1 1.
      -rob
    • Sep 09 2008 | 12:40 am
      hey pelado, turns out it was an intentional decision (not a bug) to keep control of material state in gl.sketch with the appropriate gl calls as i described in previous email.
      if you run into a problem with this, please let us know, otherwise it probably won't be changing anytime soon.
    • Oct 06 2008 | 4:29 pm
      Hello,
      I can't understand why @inherit_material 1 only works if one gridshape is in my patch.
      With 2 gridshape objects the attribut doesn't work? Strange ...
    • Oct 06 2008 | 4:39 pm
      looks like it requires you to either enable inherit_material on both shapes OR @automatic 0 and explicitly bang the the inherited material shape before the non-inherited material shape.
    • Oct 06 2008 | 6:16 pm
      Yes, it works as you said. Thank you Rob.