Support Forum G3D Web Page |
Attaches semantics for reading and writing this texture beyond the OpenGL bitwise description.
More...
Public Member Functions | |
Encoding (const ImageFormat *fmt=nullptr, FrameName n=FrameName::NONE, const Color4 &readMultiplyFirst=Color4::one(), const Color4 &readAddSecond=Color4::zero()) | |
Encoding (const ImageFormat *fmt, FrameName n, const float readMultiplyFirst=1.0f, const float readAddSecond=0.0f) | |
Encoding (const Color4 &readMultiplyFirst) | |
Encoding (const Any &a) | |
size_t | hashCode () const |
bool | operator!= (const Encoding &e) const |
bool | operator== (const Encoding &e) const |
Any | toAny () const |
Color4 | writeAddSecond () const |
Color4 | writeMultiplyFirst () const |
Static Public Member Functions | |
static Encoding | lowPrecisionScreenSpaceMotionVector () |
Computes a suitable representation for low-precision 2D signed motion vectors on this machine, with an exactly representable zero and range of approximately +/- 64. More... | |
Public Attributes | |
const ImageFormat * | format |
FrameName | frame |
This is primarily for debugging and visualization. More... | |
Color4 | readAddSecond |
This is automatically bound as an optional argument when the texture is passed to a shader. More... | |
Color4 | readMultiplyFirst |
This is automatically bound as an optional argument when the texture is passed to a shader. More... | |
Attaches semantics for reading and writing this texture beyond the OpenGL bitwise description.
This allows G3D to automatically bind texture variables more usefully in shaders, visualize
Read the texture in GLSL as:
Note that these encoding values are applied in addition to whatever the underlying ImageFormat specifies. So, sRGB data could be stored in an RGB ImageFormat using an explicit exponent here.
It is common for shaders to assume a limited encoding and their corresponding host code to assert that the encoding is obeyed rather than pass all parameters to the shader.
Any file examples:
|
inline |
|
inline |
|
inlineexplicit |
G3D::Texture::Encoding::Encoding | ( | const Any & | a | ) |
|
inline |
Referenced by G3D::GBuffer::Specification::hashCode().
|
static |
Computes a suitable representation for low-precision 2D signed motion vectors on this machine, with an exactly representable zero and range of approximately +/- 64.
|
inline |
bool G3D::Texture::Encoding::operator== | ( | const Encoding & | e | ) | const |
Any G3D::Texture::Encoding::toAny | ( | ) | const |
|
inline |
|
inline |
const ImageFormat* G3D::Texture::Encoding::format |
FrameName G3D::Texture::Encoding::frame |
This is primarily for debugging and visualization.
It is not automatically bound with the texture for shaders. However, programs can explicitly pass information based on it to a shader to allow generalizing over coordinate transformations, for example.
Referenced by hashCode().
Color4 G3D::Texture::Encoding::readAddSecond |
This is automatically bound as an optional argument when the texture is passed to a shader.
Referenced by hashCode(), G3D::Texture::max(), G3D::Texture::mean(), G3D::Texture::min(), and writeAddSecond().
Color4 G3D::Texture::Encoding::readMultiplyFirst |
This is automatically bound as an optional argument when the texture is passed to a shader.
Referenced by hashCode(), G3D::Texture::max(), G3D::Texture::mean(), G3D::Texture::min(), G3D::Texture::opaque(), writeAddSecond(), and writeMultiplyFirst().