diff --git a/README.md b/README.md index 1deab6cbb50ef7651034f54cc445186dfdafcacb..2f459b1f21fd0c35fcc407cbe1c9181d2a90174e 100644 --- a/README.md +++ b/README.md @@ -74,10 +74,15 @@ Note that only if all damping textures agree with the dimensions specified in th A `.texture` file contains `4 * texture_width * texture_height` floating point values. Each group of four is to be interpreted as the RGBA values of a single texel. Successive values are delimited with a single space. After each `4 * texture_width` values, a newline is expected. -Be aware of different axis conventions here. +Texture uploading is done via the following call: +```c++ +glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, texture_width, texture_height, 0, GL_RGBA, GL_FLOAT, data_target.data()); +``` + +One peculiarity to be aware of is the use of different axis conventions. Images typically have the origin in the lower left corner with y-axis pointing upwards, while OpenGL has the origin in the top left corner with the y-axis pointing **downwards**. This means that the first four floats in the file describe the top left texel, and the first `4 * texture_width` values describe the top most row of texels. -This is only important when using images that are asymmetric with respect to the horizontal. +This is only important when using damping textures that are asymmetric with respect to the horizontal. If it is a problem, consider either flipping the image, or look into calling `stbi_set_flip_vertically_on_load(true)`. This can also be taken care of shader side. ### Colour Palettes @@ -87,6 +92,11 @@ Most of the conventions for [Damping Textures](#damping-textures) also apply her - The `.texture` file still contains four space-denominated floats per texel (RGBA), but there is a newline after each texel As things stand now, the lowest wave point maps to the first texel, and the highest wave point maps to the last texel. +Similarly to 2D textures, here we upload the data via +``` +glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA32F, palette_.size()/4, 0, GL_RGBA, GL_FLOAT, palette_.data()); +``` + # Building the Project ## Windows In order to build the project, the following steps must be followed