Fix `get_test_texture()` returning an almost fully white texture

The texture's appearance is now similar to the texture that was displayed
on the TestCube node in Godot 2.x.
This commit is contained in:
Hugo Locurcio 2023-04-04 02:30:05 +02:00
parent ef025711a6
commit e4d5cecd4c
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
1 changed files with 3 additions and 3 deletions

View File

@ -140,9 +140,9 @@ RID RenderingServer::get_test_texture() {
c.b = y;
}
w[(y * TEST_TEXTURE_SIZE + x) * 3 + 0] = uint8_t(CLAMP(c.r * 255, 0, 255));
w[(y * TEST_TEXTURE_SIZE + x) * 3 + 1] = uint8_t(CLAMP(c.g * 255, 0, 255));
w[(y * TEST_TEXTURE_SIZE + x) * 3 + 2] = uint8_t(CLAMP(c.b * 255, 0, 255));
w[(y * TEST_TEXTURE_SIZE + x) * 3 + 0] = uint8_t(CLAMP(c.r, 0, 255));
w[(y * TEST_TEXTURE_SIZE + x) * 3 + 1] = uint8_t(CLAMP(c.g, 0, 255));
w[(y * TEST_TEXTURE_SIZE + x) * 3 + 2] = uint8_t(CLAMP(c.b, 0, 255));
}
}
}