ro0mquy / rtificial

Flashing Visuals and Dope Sound | Das Git™
http://rtificial.org/
1 stars 0 forks source link

Texture support #132

Closed vincent23 closed 8 years ago

vincent23 commented 8 years ago

One simple solution:

One (or a few) fixed texture "slots" in the shader. Which actual texture is bound to a slot is controlled by a numeric parameter. Images for use as textures are placed in a special subdirectory of the project. Each filename should be a number to enable simple mapping from parameter value to texture.

vincent23 commented 8 years ago

We're going for an even simpler solution for now:

There is a reserved number of texture units (say 20) for loaded textures. Every png file in the texture directory is loaded and gets is texture number from sorting the list by filename. In the shader you can just choose the texture with layout(binding = …). The exporter creates header files with arrays directly loadable by glTexImage2D.

vincent23 commented 8 years ago

Export and runtime support is still missing.