summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'gfx')
-rw-r--r--gfx/models/texture.cpp6
-rw-r--r--gfx/models/texture.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/gfx/models/texture.cpp b/gfx/models/texture.cpp
index 4718708..942cedf 100644
--- a/gfx/models/texture.cpp
+++ b/gfx/models/texture.cpp
@@ -71,3 +71,9 @@ Texture::saveDepth(const glTexture & texture, const glm::ivec2 & size, const cha
{
save(texture, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, size, 1, path, 3);
}
+
+void
+Texture::saveNormal(const glTexture & texture, const glm::ivec2 & size, const char * path)
+{
+ save(texture, GL_BGR, GL_BYTE, size, 3, path, 2);
+}
diff --git a/gfx/models/texture.h b/gfx/models/texture.h
index 3974d7f..1aad1e0 100644
--- a/gfx/models/texture.h
+++ b/gfx/models/texture.h
@@ -20,6 +20,7 @@ public:
static void save(const glTexture &, const glm::ivec2 & size, const char * path);
static void saveDepth(const glTexture &, const glm::ivec2 & size, const char * path);
+ static void saveNormal(const glTexture &, const glm::ivec2 & size, const char * path);
private:
static void save(const glTexture &, GLenum, GLenum, const glm::ivec2 & size, unsigned short channels,