summaryrefslogtreecommitdiffstats
path: root/res/effectlib/transformCoordinate.glsllib
diff options
context:
space:
mode:
Diffstat (limited to 'res/effectlib/transformCoordinate.glsllib')
-rw-r--r--res/effectlib/transformCoordinate.glsllib13
1 files changed, 13 insertions, 0 deletions
diff --git a/res/effectlib/transformCoordinate.glsllib b/res/effectlib/transformCoordinate.glsllib
new file mode 100644
index 0000000..5efcd46
--- /dev/null
+++ b/res/effectlib/transformCoordinate.glsllib
@@ -0,0 +1,13 @@
+#ifndef TRANSFORM_COORDINATE_GLSLLIB
+#define TRANSFORM_COORDINATE_GLSLLIB
+
+texture_coordinate_info transformCoordinate( in mat4 transform, in texture_coordinate_info coordinate )
+{
+ texture_coordinate_info tci;
+ tci.position = ( transform * vec4( coordinate.position, 1.0f ) ).xyz;
+ tci.tangent_u = ( transform * vec4( coordinate.tangent_u, 0.0f ) ).xyz;
+ tci.tangent_v = ( transform * vec4( coordinate.tangent_v, 0.0f ) ).xyz;
+ return( tci );
+}
+
+#endif