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

Mipmap generation breaks at very low resolutions #56066

Open
Je06jm opened this issue Dec 19, 2021 · 5 comments
Open

Mipmap generation breaks at very low resolutions #56066

Je06jm opened this issue Dec 19, 2021 · 5 comments

Comments

@Je06jm
Copy link
Contributor

Je06jm commented Dec 19, 2021

Godot version

4.0.dev

System information

Windows 10, GTX 1070, 496.49, Vulkan

Issue description

While implementing FSR for the upcoming 4.0 release, a bug was discovered where if the render target was at very low resolutions, mipmap generation would fail because it would request more mipmaps then allowed.

Steps to reproduce

In any project, enable FSR and set the quality to as low as it goes

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Dec 19, 2021

This also breaks glow rendering at low viewport sizes: #51679 (comment)

Does this occur with textures that use Lossless compression (instead of VRAM Compressed)? If this only occurs with VRAM-compressed textures, this may be related to #49981. You can change a texture's compression mode in the Import dock after selecting it in the FileSystem dock.

@Je06jm
Copy link
Contributor Author

Je06jm commented Jun 28, 2022

Does this occur with textures that use Lossless compression (instead of VRAM Compressed)?

This issue does occur when textureless objects are in the scene, so it does not appear to be related

@clayjohn clayjohn modified the milestones: 4.0, 4.x Feb 23, 2023
@Lasuch69
Copy link
Contributor

Lasuch69 commented Apr 25, 2023

I think I have the same issue when generating mipmaps on NoiseTexture3D. Godot requests more images than it is possible with pixel size.

Good example would be setting texture size to 1x1x2, which results in an error: Data for slice index 0 (mapped to layer 0) differs in size (supplied: 12) than what is required by the format (8). format is RGBA8 (1 pixel = 4 bytes size).

Link to code: https://github.com/Lasuch69/add_noisetexture3d/blob/a22e9c3527af2d478c788af97ed5afc9b24fb940/modules/noise/noise_texture_3d.cpp

This issue is a huge roadblock (straight up impossible to create planned feature set) in implementing NoiseTexture3D resource.

@Calinou
Copy link
Member

Calinou commented Apr 25, 2023

This issue is a huge roadblock (straight up impossible to create planned feature set) in implementing NoiseTexture3D resource.

In the meantime, you could probably disable mipmap generation if one of the dimensions is below a specific size.

@Lasuch69
Copy link
Contributor

This issue is a huge roadblock (straight up impossible to create planned feature set) in implementing NoiseTexture3D resource.

In the meantime, you could probably disable mipmap generation if one of the dimensions is below a specific size.

I don't think that's a good idea, it would be better to just wait for fix or add mipmap generation later, or I could clamp depth to width but that would be sketchy anyway. Clamping depth to width seems like the best option tbh, it would work well with fog as that's the main use case for it.

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

No branches or pull requests

4 participants