@kognifai/cogsengine
    Preparing search index...

    Conventions

    Cogs uses a right-hand coordinate system, that is, OpenGL conventions, both in shaders and application code.

    Also matrices assumed to be laid out column-major-order in memory, that is, first the elements of the first column, then the elements of the second column, and so on. The same convention used by OpenGL.

    With regards to world coordinate system, X/Y forms the ground plane and Z is up, where X usually refers to east/easting and Y to north/northing.

    Unless the textureload flag "flip" is set, textures are passed directly to the rendering subsystem.

    Most image formats start with the first row as the top row, so when passing this directly to DX11/DX12/Vulkan/Metal the top row is conceptually at the top.

    However, OpenGL starts with the bottom row, and thus an image loaded from a file will conceptually be upside-down. But also texcoords starts at the bottom in OpenGL, so texcoord y=0 will always refer to the first row in the image, and thus, for regular texturing this doesn't matter.

    Where it does matter is when consuming rendered output in another rendering pass. To handle this case, Cogs defines COGS_SHADER_GL for OpenGL, so the shader can sample with the correct convention. However, for fullscreen-quad passes where we sample a texture with the current pixel position, no flipping is required as the current pixel position in OpenGL (that is, gl_FragCoord) uses the y=0 bottom convention as well.