Topic was automatically imported from the old Question2Answer platform.
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.
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
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.