godotengine / godot

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

Creating new image for ImageTexture logs errors to console #38112

Open p10tr3k opened 4 years ago

p10tr3k commented 4 years ago

Godot version: v3.2.2.rc.custom_build.36a30f681

OS/device including version: Windows 10

Issue description: It is not possible to create new image for ImageTexutre in editor. Errors are logged in console:

drivers\gles3\rasterizer_storage_gles3.cpp:1097 - Condition "texture->data_size == 0 && !texture->render_target" is true. Returned: Ref<Image>() drivers\gles3\rasterizer_storage_gles3.cpp:832 - Condition "!read.ptr()" is true.

Also trying to load image shows warning image

Steps to reproduce:

rzil commented 4 years ago

I am having the same issue with ImageTexture. I am using Godot 3.2.1 stable.official on MacOS.

mrushyendra commented 4 years ago

I believe selecting New Image simply creates an empty Image, which is not allowed for an ImageTexture. Instead you need to load an Image resource to use with this texture type.

The second error about having selected a StreamTexture appears because ImageTexture expects an Image datatype. To import an image file (.png, .jpeg, etc.) as an Image, select the file in the editor's filesystem tab, select the Import tab, then select Import As, and select Image as the format.

Also see related: #17650

Shadowblitz16 commented 4 years ago

Ran into this issue when trying to initialize a image for the main box of a custom color picker

KoBeWi commented 3 years ago

I think this could get similar fix like for #34734