--
You received this message because you are subscribed to the Google Groups "G3D Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to g3d-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/g3d-users/8d6f7d8b-42c7-4821-8751-1f85b0e8f5f4o%40googlegroups.com.
The right-hand side is rendered with one sample per pixel, and the left-hand side uses 1 sample per 4x4 pixels.
I tried also to do the same in minimalOpenGL project, which does not use G3D lib at all and results are as expected:
Is there any chance you might have an idea what might cause such weird behavior?
Here's my code for VRS:
GLint srTexelW, srTexelH;
glGetIntegerv(GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV, &srTexelW);
glGetIntegerv(GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV, &srTexelH);
GLuint sri;
glGenTextures(1, &sri);
GLsizei sri_w = m_framebuffer->width() / srTexelW;
GLsizei sri_h = m_framebuffer->height() / srTexelH;
unsigned char* data = (unsigned char*)malloc(sri_w * sri_h * sizeof(unsigned char));
for (size_t y = 0; y < sri_h; ++y)
{
for (size_t x = 0; x < sri_w; ++x)
{
if ((float)x / sri_w < 0.5)
data[x + y * sri_w] = 0;
else
data[x + y * sri_w] = 2;
}
}
glBindTexture(GL_TEXTURE_2D, sri);
glTexStorage2D(GL_TEXTURE_2D, 1, GL_R8UI, sri_w, sri_h);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, sri_w, sri_h, GL_RED_INTEGER, GL_UNSIGNED_BYTE, data);
GLint palSize;
glGetIntegerv(GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV, &palSize);
GLenum* palette = new GLenum[palSize];
for (size_t i = 0; i < palSize; ++i)
{
palette[i] = GL_SHADING_RATE_NO_INVOCATIONS_NV;
}
palette[0] = GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV;
palette[1] = GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV;
palette[2] = GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV;
palette[3] = GL_SHADING_RATE_NO_INVOCATIONS_NV;
glBindShadingRateImageNV(sri);
glShadingRateImagePaletteNV(0, 0, palSize, palette);
delete[] palette;
glEnable(GL_SHADING_RATE_IMAGE_NV);
--
You received this message because you are subscribed to the Google Groups "G3D Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to g3d-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/g3d-users/e328610b-f457-48f5-b419-4a512d88b278o%40googlegroups.com.