godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.83k stars 21.13k forks source link

Textures appear to have strange colors. #11394

Closed antonyjones67 closed 7 years ago

antonyjones67 commented 7 years ago

Godot Engine v3.0.alpha.custom_build.41715c1

Using Sponza Model: Brick appears to be yellowish in color.

Just load Sponza model from Crytek. Exported from Blender using Better Collada Exporter.

image

This keeps printing repeatedly in Console. At: drivers\gles3\rasterizer_gles3.cpp:122 ERROR: _gl_debug_print: GL ERROR: Source: OpenGL Type: Error ID: 1282 Severity: High Message: GL_INVALID_OPERATION error generated. Texture name does not refer to a texture object generated by OpenGL. At: drivers\gles3\rasterizer_gles3.cpp:122

henkz1 commented 7 years ago

Just load Sponza model from Crytek. Exported from Blender using Better Collada Exporter.

There seem to be quite a few steps not described here, could you share the project or a smaller example of the same issue? Also it would seem like a good idea to mention gfx card, drivers and os when the issue is about rendering..

antonyjones67 commented 7 years ago

Windows 10. Intel I7. Geforce GTX 1060. The project is too big to upload. The Sponza model can be found here. http://www.crytek.com/cryengine/cryengine3/downloads.

antonyjones67 commented 7 years ago

Sponza.zip Here is the Collada file without textures.

Calinou commented 7 years ago

I can reproduce this with the Sponza model and textures found on the link above.

This is because the first material uses the same texture for both albedo and normal map. Therefore, Godot imports the texture as RGTC (a compression format optimized for normal maps), which only contains red and green channels. Thus, the albedo is displayed with a "yellow" tint. If you disable Normal Map in the texture's import dialog, it will look bad because the normal map also uses that texture. So, you also need to change the material's normal map texture to the actual normal map, which is spnza_bricks_a_ddn.tga.

This might be related to Godot, but I'm not sure.

reduz commented 7 years ago

This is not a bug, if the project uses the same texture for albedo and normal map, this will happen. You may see this bug from time to time in OBJ files, because OBJ does not really use normalmap but bump map.