瀏覽代碼

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.

(cherry picked from commit e4d5cecd4c5e571b6f46b2a7d3e693d09277eb37)
Hugo Locurcio 2 年之前
父節點
當前提交
9253f415b3
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      servers/rendering_server.cpp

+ 3 - 3
servers/rendering_server.cpp

@@ -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));
 			}
 		}
 	}