jfcameron / gdk-graphics

3D Rendering using OpenGLES 2.0/WebGL1.0. Platforms: Linux, Windows, Mac, x86 64bit, arm64, wasm
MIT License
1 stars 1 forks source link

vertex_data: consider making it serializable + texture thoughts #61

Open jfcameron opened 3 years ago

jfcameron commented 3 years ago

providing a conscise, serializable format for vertex_data would be a convenient way to store simple model data in a way that does not require this library to provide an implementation for parsing e.g: obj files. while obj files are a simple format, i dont want to support loading material values from one. i think a binary serial form of vertex_data would be better.

also, consider that textures already have a serializable format (raw bitmap data, RGBA32 encoded PNG). could use a jsonlike bin format like ubjson etc. via nlohmann::json

jfcameron commented 3 years ago

should provide a way to copy texture data from vram and write to png buffer as well. providing some very limited serialization options would be useful for 1 storing simple stuff on disk 2 sending stuff over a network. as long as its kept very limited I think this is worthwhile

jfcameron commented 3 years ago

writing to png buffer is necessary for print screen. would help when debugging multipass render set ups. user could modify texture data using a shader then write it to disk or send it over the network to another instance of the same program.