shader_update_light   xtlang


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

Implementation

(bind-func shader_update_light
  (lambda (shader:ShaderProgram* position target angle power:float ambient diffuse specular)
                                        ;(vprint position 4)
                                        ;(vprint target 4)
    (glUniform1f (glGetUniformLocation (id shader) "ConstantAttenuation") 1.0)
    (glUniform1f (glGetUniformLocation (id shader) "LinearAttenuation") 0.0)
    (glUniform1f (glGetUniformLocation (id shader) "QuadraticAttenuation") 0.0)
    (glUniform1f (glGetUniformLocation (id shader) "SpotExponent") power)
    (glUniform1f (glGetUniformLocation (id shader) "SpotAngle") (- 1.0 (/ angle 180.0)))
    (glUniform4fv (glGetUniformLocation (id shader) "LightPos") 1 position)
    (glUniform4fv (glGetUniformLocation (id shader) "LightAmbient") 1 ambient)
    (glUniform4fv (glGetUniformLocation (id shader) "LightSpecular") 1 specular)
    (glUniform4fv (glGetUniformLocation (id shader) "LightDiffuse") 1 diffuse)
    (let ((direction:float* (salloc 4))
          (tmp:float* (salloc 4)))
      (vvsub target position 3 tmp)
      (vnormalise tmp 3 direction)
      (pset! direction 3 0.0)
      (glUniform4fv (glGetUniformLocation (id shader) "SpotDir") 1 direction))
    void))


Back to Index

Similar Entries

  • Shader    xtlang
  • ShaderProgram    xtlang
  • ShaderProgram    xtlang
  • ShaderProgram    xtlang
  • ShaderProgram    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_print_info_log    xtlang
  • Shader_create    xtlang
  • Shader_id    xtlang
  • Shader_print_info_log    xtlang
  • Shader_type    xtlang
  • VBO_update_data    xtlang
  • clock:update-metro    scheme
  • clock:update-metro    scheme
  • create_arrows_shader    xtlang
  • create_heatmap_shader    xtlang
  • create_particles_shader    xtlang
  • create_points_shader    xtlang
  • create_post_process_shader    xtlang
  • create_raymarcher_shader    xtlang
  • create_shader    xtlang
  • create_shader_xtm    xtlang
  • create_shadertoy_shader    xtlang
  • create_texture_shader    xtlang
  • create_triangle_shader    xtlang
  • create_triangle_shader    xtlang
  • dict_update    xtlang
  • fragshader    scheme
  • impc:ti:check-to-update-generic-vars    scheme
  • impc:ti:update-closure-name    scheme
  • impc:ti:update-var    scheme
  • kinect_update_body    xtlang
  • light-and-shade-frag    scheme
  • light-and-shade-vert-xtm    scheme
  • light-frag    scheme
  • light-vert    scheme
  • model_update    xtlang
  • position_update    xtlang
  • print_shader_info_log    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_prepare_draw    xtlang
  • shader_set_grid_offsets    xtlang
  • shader_setup_convolution_filter    xtlang
  • shader_update_bones    xtlang
  • shader_update_camera    xtlang
  • shader_update_envmap    xtlang
  • shader_update_lights    xtlang
  • shader_update_material    xtlang
  • shader_update_material    xtlang
  • shader_update_material    xtlang
  • shader_update_matrices    xtlang
  • shader_update_matrices_lv    xtlang
  • shader_update_matrices_lvs    xtlang
  • shader_update_projection_texture    xtlang
  • shader_update_uvwmatrix    xtlang
  • shadertoy-loop    scheme
  • update    xtlang
  • update    xtlang
  • update-borders    xtlang
  • update-fluid-sym-state    xtlang
  • update_cube    xtlang
  • update_data_points    xtlang
  • vertshader    scheme
  • xtm_get_lights    xtlang
  • xtm_light_ambient    xtlang
  • xtm_light_angle    xtlang
  • xtm_light_diffuse    xtlang
  • xtm_light_pos    xtlang
  • xtm_light_power    xtlang
  • xtm_light_specular    xtlang
  • xtm_light_tgt    xtlang
  • xtm_light_up    xtlang
  • xtm_light_view    xtlang
  • xtm_render_init_dof_shader    xtlang
  • xtm_render_init_light_shader    xtlang
  • xtm_render_init_quad_shader    xtlang
  • xtm_render_init_simple_bone_shader    xtlang
  • xtm_render_init_simple_shader    xtlang
  • xtm_render_init_skybox_shader    xtlang
  • xtm_update_camera    xtlang
  • xtm_update_lights    xtlang
  • xtm_update_matrices    xtlang
  • xtmfrag_nolight    scheme
  • xtmtest-update-test-result    scheme
  • xtmtest-update-test-result    scheme