summaryrefslogtreecommitdiff
path: root/gfx/models/texture.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-12-11 12:42:35 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-12-11 12:42:35 +0000
commitc4809bec8486e12a388fb3f09b6c65a4c6c9a754 (patch)
tree1ea4a3a5ee8b76de1b5859f03edb94ec9ddd9594 /gfx/models/texture.cpp
parentSupport saving textures with different output types (diff)
downloadilt-c4809bec8486e12a388fb3f09b6c65a4c6c9a754.tar.bz2
ilt-c4809bec8486e12a388fb3f09b6c65a4c6c9a754.tar.xz
ilt-c4809bec8486e12a388fb3f09b6c65a4c6c9a754.zip
Support saving a normals texture
Diffstat (limited to 'gfx/models/texture.cpp')
-rw-r--r--gfx/models/texture.cpp6
1 files changed, 6 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);
+}