diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-16 20:03:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-16 20:03:24 +0400 |
commit | 4d79ceefa34209bb009e5ee09a5bf7d53da8f2b2 (patch) | |
tree | b1a8e29a3b36920bd72109ba38c8b95911a0c8d8 | |
parent | 01ef1c9b2c80e87cec0644aade7c1e4deb949901 (diff) |
H3D Support for spot and sun lamps.
-rw-r--r-- | io_scene_x3d/export_x3d.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py index 2aa455bd..6f528ebb 100644 --- a/io_scene_x3d/export_x3d.py +++ b/io_scene_x3d/export_x3d.py @@ -185,6 +185,16 @@ def h3d_shader_glsl_frag_patch(filepath, global_vars): w = l.split(', ') w[1] = '(view_matrix * %s_transform * vec4(%s.x, %s.y, %s.z, 1.0)).xyz' % (w[1], w[1], w[1], w[1]) l = ", ".join(w) + elif l.lstrip().startswith("lamp_visibility_sun_hemi("): + w = l.split(', ') + w[0] = w[0][len("lamp_visibility_sun_hemi(") + 1:] + w[0] = '(mat3(normalize(view_matrix[0].xyz), normalize(view_matrix[1].xyz), normalize(view_matrix[2].xyz)) * -%s)' % w[0] + l = "\tlamp_visibility_sun_hemi(" + ", ".join(w) + elif l.lstrip().startswith("lamp_visibility_spot_circle("): + w = l.split(', ') + w[0] = w[0][len("lamp_visibility_spot_circle(") + 1:] + w[0] = '(mat3(normalize(view_matrix[0].xyz), normalize(view_matrix[1].xyz), normalize(view_matrix[2].xyz)) * -%s)' % w[0] + l = "\tlamp_visibility_spot_circle(" + ", ".join(w) lines.append(l) |