17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 05:09:20 +02:00

feat(editor): -generate-nodebank-previews mode: png previews of the node bank models, or of the entries given with -entries, drawn offscreen and without a window by the full renderer: square, -resolution 1024 by default, the model in perspective from the front, side and above, fitted to the image less -margin pixels (64 by default) on white background, lit, with materials and with self shadows unless -no-shadows; saved in textures/previews/nodebank under the path of the model with the skin; software rendering of mesa when the graphics driver gives no gl 3.3 or with -software

This commit is contained in:
2026-10-08 18:52:51 +02:00
parent 917c8f7285
commit e661b9f1c7
6 changed files with 900 additions and 2 deletions

View File

@@ -93,6 +93,10 @@ public:
// imgui renderer
virtual class imgui_renderer *GetImguiRenderer() = 0;
virtual void MakeScreenshot() = 0;
// draws the model of a scenery instance on its own into a square image of Size pixels on white background, the model
// seen in perspective from the front, side and above and filling the image less Margin pixels at each edge.
// Image receives rgb rows, top row first. returns false if the backend can't make previews or there's nothing to draw
virtual auto Render_Preview( TAnimModel *Instance, int const Size, int const Margin, bool const Shadows, std::vector<std::uint8_t> &Image ) -> bool { return false; }
};
class gfx_renderer_factory