vs_hdr_mesh.sc 495 B

12345678910111213141516171819202122
  1. $input a_position, a_normal
  2. $output v_pos, v_view, v_normal
  3. /*
  4. * Copyright 2011-2025 Branimir Karadzic. All rights reserved.
  5. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
  6. */
  7. #include "../common/common.sh"
  8. void main()
  9. {
  10. vec3 pos = a_position;
  11. vec3 normal = a_normal.xyz*2.0 - 1.0;
  12. gl_Position = mul(u_modelViewProj, vec4(pos, 1.0) );
  13. v_pos = gl_Position.xyz;
  14. v_view = mul(u_modelView, vec4(pos, 1.0) ).xyz;
  15. v_normal = mul(u_modelView, vec4(normal, 0.0) ).xyz;
  16. }