What is the difference between a stream texture and an image texture?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By emrevit

What is the difference between a stream texture and an image texture, especially in regard to performance?

I’m asking this question because when I use a stream texture (this is the default I guess), I got artifacts on textures on Android (While it’s OK on my PC). Using an Image texture solves the problem on Android.

Here’s a screenshot of the artifact:
enter image description here

:bust_in_silhouette: Reply From: Wakatta

That actually has less to do with texture types and more to do with how the image is imported.

In the Import dock try different compression modes and for mobile ensure Filter and Mipmap flags are enabled

:bust_in_silhouette: Reply From: ChildLearning.Club

In Godot, a StreamTexture and an ImageTexture are two different types of textures that can be used in a game.

An ImageTexture is a texture that is created from a loaded image file, such as a PNG or JPEG. It is a static texture, meaning that it cannot be modified at runtime. You can use an ImageTexture to display images on 2D sprites, as backgrounds, or as textures on 3D models.

A StreamTexture, on the other hand, is a texture that is generated dynamically from a stream of data. It is often used to display video or webcam input in a game. Unlike an ImageTexture, a StreamTexture is updated every frame with new data from the stream. This means that the texture can change dynamically, allowing for real-time video input.

In summary, the main difference between a StreamTexture and an ImageTexture is that the former is a dynamic texture that is generated from a stream of data, while the latter is a static texture that is created from a loaded image file.

Credit: ChatGPT → Everyone who contributed to docs and Godot

:bust_in_silhouette: Reply From: ld2studio

A stream texture is loaded from a .ctex file. This file format is internal to Godot; it is created by importing other image formats with the import system. In Godot 4, it named CompressedTexture2D. It is automatically used when you place images into project folder.

An Image texture is created from an image (class Image), They can be created at run-time by loading images both from within the editor and externally.

nb: don’t believe what chatgpt says.