Skip to content

Commit

Permalink
Add means to save framebuffer to file (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren authored Oct 25, 2024
1 parent 9e2c540 commit a586dcf
Show file tree
Hide file tree
Showing 3 changed files with 1,785 additions and 2 deletions.
4 changes: 4 additions & 0 deletions include/threepp/renderers/GLRenderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ namespace threepp {

void copyFramebufferToTexture(const Vector2& position, Texture& texture, int level = 0);

[[nodiscard]] std::vector<unsigned char> readRGBPixels();

void readPixels(const Vector2& position, const std::pair<int, int>& size, Format format, unsigned char* data);

// Experimental threepp function
Expand All @@ -165,6 +167,8 @@ namespace threepp {

[[nodiscard]] std::optional<unsigned int> getGlTextureId(Texture& texture) const;

void writeFramebuffer(const std::filesystem::path& filename);

~GLRenderer();

private:
Expand Down
Loading

0 comments on commit a586dcf

Please sign in to comment.