Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shader parameter taking a 256x1 pixel image raises an error. #36940

Closed
hagsteel opened this issue Mar 9, 2020 · 2 comments · Fixed by #39638
Closed

Shader parameter taking a 256x1 pixel image raises an error. #36940

hagsteel opened this issue Mar 9, 2020 · 2 comments · Fixed by #39638

Comments

@hagsteel
Copy link

hagsteel commented Mar 9, 2020

Godot version:
3.2 stable

OS/device including version:
Linux 5.5.8

Issue description:
adding a uniform sampler2D shader parameter and assigning a png which is 256x1 pixels causes the error ERROR: resize: Image height must be greater than 0. At: core/image.cpp:891..

Steps to reproduce:

  1. Create a new project
  2. Add a Sprite
  3. Add a shader
  4. Add the following shader code:
shader_type canvas_item;
uniform sampler2D foo : hint_albedo;
  1. Assign a 256x1 pixel image to the "foo" shader parameter.
  2. Save, restart editor and select the sprite and the error message should be visible in the terminal.

Note: changing the image to a 256x2 pixel image doesn't cause the error anymore

@Calinou
Copy link
Member

Calinou commented Mar 9, 2020

What are the import settings of the PNG file in question? You can view them by selecting the image in the FileSystem dock then going to the Import dock. There are known issues when using the VRAM compression mode on very small images (< 16 pixels in either dimension).

@hagsteel
Copy link
Author

hagsteel commented Mar 9, 2020

[remap]

importer="texture"
type="StreamTexture"
path="res://.import/base-palette.png-610a3708b32f0be1839fb098e30bdc66.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/player/base-palette.png"
dest_files=[ "res://.import/base-palette.png-610a3708b32f0be1839fb098e30bdc66.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants