shader_update_bones   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm

Implementation

(bind-func shader_update_bones
  (let ((bonesdat:float* (alloc (* 16 4 20))) ;; 16 (4x4 array) * 20 * 4 (bytes per float)
        (i:i32 0))
    ;; default to id matrix
    (dotimes (i 20) (fill_identity_matrix (pref-ptr bonesdat (* 16 i))))
    (lambda (shader:ShaderProgram* mesh:XTMMesh*)
      (let ((num_bones (tref mesh 12))
            (bones (tref mesh 13))
            (bone:XTMBone* null)
            (mymat:float* (alloc 16))
            (transmat:float* null))
        (fill_identity_matrix mymat)
        (translate_matrix mymat 2.0 2.0 2.0)
        ;; (dotimes (i 20) (fill_identity_matrix (pref-ptr bonesdat (* 16 i))))
        (dotimes (i num_bones)
          (set! bone (pref-ptr bones i))
          (set! transmat (tref bone 2))
          (memcpy (cast mymat i8*) (cast transmat i8*) (* 16 4))
          (if (= i -1)
              (begin
                (rotate_matrix mymat 50.0 0.0 1.0 0.0)
                (memcpy (cast (pref-ptr bonesdat (* 16 i)) i8*) (cast mymat i8*) (* 16 4)))
              (memcpy (cast (pref-ptr bonesdat (* 16 i)) i8*) (cast transmat i8*) (* 16 4))))
        ;; update 20 bones
        (glUniformMatrix4fv (glGetUniformLocation (id shader) "Bone") 20 GL_FALSE bonesdat)
        (gl_print_error "Error updating bones")
        void))))


Back to Index

Similar Entries

  • Shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • ShaderProgram    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • ShaderProgram    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • ShaderProgram    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • ShaderProgram    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • ShaderProgram_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • ShaderProgram_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • ShaderProgram_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • ShaderProgram_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • ShaderProgram_print_info_log    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Shader_create    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Shader_id    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Shader_print_info_log    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • Shader_type    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • VBO_update_data    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • clock:update-metro    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • clock:update-metro    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • cpTransformBoneScale    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpTransform.xtm
  • create_arrows_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/arrows.xtm
  • create_heatmap_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/heatmap.xtm
  • create_particles_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/particles.xtm
  • create_points_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/points.xtm
  • create_post_process_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/framebuffer.xtm
  • create_raymarcher_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/raymarcher.xtm
  • create_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • create_shader_xtm    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • create_shadertoy_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/shadertoy.xtm
  • create_texture_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/texture.xtm
  • create_triangle_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/simple-triangle.xtm
  • create_triangle_shader    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/framebuffer.xtm
  • dict_update    xtlang    /digego/extempore/tree/v0.8.9/libs/core/adt.xtm
  • fragshader    scheme    /digego/extempore/tree/v0.8.9/examples/external/raymarcher.xtm
  • impc:ti:check-to-update-generic-vars    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:update-closure-name    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:update-var    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • kinect_update_body    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/kinect2.xtm
  • model_update    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/horde3d_knight.xtm
  • position_update    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/particles.xtm
  • print_shader_info_log    xtlang    /digego/extempore/tree/v0.8.9/libs/external/opengl.xtm
  • shader_prepare_draw    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_prepare_draw    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_prepare_draw    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_prepare_draw    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_prepare_draw    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_set_grid_offsets    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_setup_convolution_filter    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_camera    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_envmap    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_light    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_lights    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_material    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_material    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_material    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_matrices    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_matrices_lv    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_matrices_lvs    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_projection_texture    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shader_update_uvwmatrix    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • shadertoy-loop    scheme    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/shadertoy.xtm
  • update    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • update    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • update-borders    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • update-fluid-sym-state    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • update_cube    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects2.xtm
  • update_data_points    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/fluids_2d.xtm
  • vertshader    scheme    /digego/extempore/tree/v0.8.9/examples/external/raymarcher.xtm
  • xtm_render_init_dof_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_light_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_quad_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_simple_bone_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_simple_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_skybox_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_update_camera    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_update_lights    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_update_matrices    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtmtest-update-test-result    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • xtmtest-update-test-result    scheme    /digego/extempore/tree/v0.8.9/libs/core/test.xtm