How can I add gradient banding and control it?

I am rendering a quad with up to 4 different vertex colours. My vertex shader is super simple: #version 330 layout(location=0) in vec2 inVertexPosition; layout(location=1) in vec4 inColor; out vec4 color; void main() { gl_Position = vec4(inVertexPosition.x,-inVertexPosition.y, 0.0, 1.0); color = inColor; } The fragment shader: #version 330 layout(location=0) out vec4 frag_colour; in vec4 color;…

Details

C++: Best way to access overloaded operator++ with std::unique_ptr?

If I have a class with an overloaded operator++, for example: In header: SomeClass& operator++(int); Implementation: SomeClass& SomeClass::operator++(int) { someLocalVar++; return this; } If I then instantiate SomeClass in an std::unique_ptr: std::unique_ptr<SomeClass> someClass(new SomeClass()); And I then want to call operator++ some someClass, I use: someClass.get()->operator++(0); I understand I could do something like: SomeClass *ptrSomeClass…

Details