create GetTexture2DPixel page. |
added missing gallery item |
||
Line 40: | Line 40: | ||
== Examples == | == Examples == | ||
<gallery widths=480px heights=480px> | |||
File:Protoflux_texture_asset_parsing.webp|Example of a Get Texture2D Pixel being used in a larger example code reading 3D and 2D textures. | |||
</gallery> | |||
[[Category:ProtoFlux:Assets]] | [[Category:ProtoFlux:Assets]] |
Latest revision as of 18:57, 8 February 2024
Get texture 2D pixel is a node that allows you to sample the pixel color of an 2 dimensional Texture that has readable enabled.
Since the StaticTexture2D component needs to have readable enabled, most players opt to keep a component on the object that their code is on, and then change it's URL so they can read the image's pixels.
This node also takes a raw IAsset<Texture2D> instead of an asset provider. To extract the raw texture reference from the provider for use in this node, see the Get Asset Node.
Inputs
Texture (IAsset<Texture2D>)
The raw asset of an IAssetProvider<Texture2D> extracted using a Get Asset Node.
Position (Int2)
The Position to sample the colorX from.
MipLevel (Int)
The MipMap level of the provided image to sample from. Highest quality by default.
Outputs
* (colorX)
The ColorX color from the provided Texture (IAsset<Texture2D>) at the provided Position (Int2) with the provided quality MipLevel (Int).
Examples
-
Example of a Get Texture2D Pixel being used in a larger example code reading 3D and 2D textures.