No edit summary |
replace some with templates |
||
(2 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
|Name=StaticTexture2D | |Name=StaticTexture2D | ||
}} | }} | ||
The '''StaticTexture2D''' Component stores a reference to a static [[Type:IAssetProvider`1|asset]] representing a [[Texture2D|2D Texture]]. | The '''StaticTexture2D''' Component stores a reference to a static [[Type:IAssetProvider`1|asset]] representing a [[Texture2D|2D Texture]]. | ||
== | |||
== Fields == | |||
{{Table ComponentFields | {{Table ComponentFields | ||
|URL|Uri| The Asset URI that references the raw texture data | |URL|Uri| The Asset URI that references the raw texture data | ||
|FilterMode|TextureFilterMode| | |FilterMode|TextureFilterMode| {{Template:Texture FilterMode Field}} | ||
|AnisotropicLevel|Int| | |AnisotropicLevel|Int| {{Template:Texture AnisotropicLevel Field}} | ||
|Uncompressed|Bool| Do not use texture compression | |Uncompressed|Bool| Do not use texture compression | ||
|DirectLoad|Bool| | |DirectLoad|Bool| Whether to load the image directly from it's URI source and to not cache it locally. | ||
|ForceExactVariant|Bool| | |ForceExactVariant|Bool| Only allow one variant of the texture to exist, part of [[Asset Variant|Asset Variant System]]. | ||
|PreferredFormat|'''[[Type:Nullable`1|Nullable`1]]<[[Type:TextureCompression|TextureCompression]]>'''|TypeAdv6=true| | |PreferredFormat|'''[[Type:Nullable`1|Nullable`1]]<[[Type:TextureCompression|TextureCompression]]>'''|TypeAdv6=true| The format to use for texture compression rather than the auto picked one | ||
|PreferredProfile|'''[[Type:Nullable`1|Nullable`1]]<[[Type:ColorProfile|ColorProfile]]>'''|TypeAdv7=true| | |PreferredProfile|'''[[Type:Nullable`1|Nullable`1]]<[[Type:ColorProfile|ColorProfile]]>'''|TypeAdv7=true| The color profile to use rather than the auto picked one. (usually linear) | ||
| | |MipmapBias|Float| {{Template:Texture MipmapBias Field}} | ||
|IsNormalMap|Bool| This texture should be interpreted as a [[Normal Map]] | |IsNormalMap|Bool| This texture should be interpreted as a [[Normal Map]] | ||
|WrapModeU|TextureWrapMode| | |WrapModeU|TextureWrapMode| {{Template:Texture WrapMode Field|X}} | ||
|WrapModeV|TextureWrapMode| | |WrapModeV|TextureWrapMode| {{Template:Texture WrapMode Field|Y}} | ||
|PowerOfTwoAlignThreshold|Float| The threshold for pixel count from range [0.0,1.0] before scaling both axes to a power of 2. | |||
|CrunchCompressed|Bool| | |CrunchCompressed|Bool| Whether to compress the texture to extreme lengths to reduce VRam usage. | ||
|MaxSize|'''[[Type:Nullable`1|Nullable`1]]<[[Type:Int|Int]]>'''|TypeAdv14=true| | |MaxSize|'''[[Type:Nullable`1|Nullable`1]]<[[Type:Int|Int]]>'''|TypeAdv14=true| The maxiumum size to show to the user, which scaled versions are generated by the cloud on the fly from the original and sent as part of the [[Asset Variant|Asset Variant System]] | ||
| | |Mipmaps|Bool| {{Template:Texture Mipmaps Field}} | ||
|KeepOriginalMipMaps|Bool| | |KeepOriginalMipMaps|Bool| Whether to use the original mipmaps that came with the image data (yes you could have rainbow mipmaps at further distances) or not. | ||
|MipMapFilter|Filtering| | |MipMapFilter|Filtering| How to apply filtering to the image's mipmaps. please see [[Type:Filtering|Filtering]]! | ||
|Readable|Bool| | |Readable|Bool| Whether this can be read per pixel via things like [[ProtoFlux]] | ||
}} | }} | ||
== | == Usage == | ||
By default <code>Filter</code> is set to [[Bilinear Filtering]], however [[Anisotropic Filtering]] results in a much better appearance at very steep angles, and only has a very minor performance impact. If visual fidelity of your texture is a concern, you should set <code>Filter</code> to Anisotropic, and <code>AnisotropicLevel</code> to 4 or 8. | By default <code>Filter</code> is set to [[Bilinear Filtering]], however [[Anisotropic Filtering]] results in a much better appearance at very steep angles, and only has a very minor performance impact. If visual fidelity of your texture is a concern, you should set <code>Filter</code> to Anisotropic, and <code>AnisotropicLevel</code> to 4 or 8. | ||
=== Special Functions === | === Special Functions === | ||
Line 37: | Line 37: | ||
When importing images into Resonite, sometimes the image will have a row of pixels taken from the bottom of the image rendered at the top. To fix this issue, go to the FilterMode property on the StaticTexture2D component, click the checkbox, and select "Point". This prevents the issue | When importing images into Resonite, sometimes the image will have a row of pixels taken from the bottom of the image rendered at the top. To fix this issue, go to the FilterMode property on the StaticTexture2D component, click the checkbox, and select "Point". This prevents the issue | ||
{ | {{Table ComponentTriggers | ||
|InvertRGB()|null|Inverts the colors of the texture | |||
| | |InvertR()|null|Same as above, but only effects the red channel of the texture | ||
|InvertG()|null|Same as above, but only effects the green channel of the texture | |||
|InvertB()|null|Same as above, but only effects the blue channel of the texture | |||
|InvertA()|null|Same as above, but only effects the alpha channel of the texture | |||
|ColorToAlphaWhite()|null|Converts all pure white colors in the image to alpha | |||
| Inverts the colors of the texture | |ColorToAlphaBlack()|null|Converts all pure black colors in the image to alpha | ||
| | |AlphaFromIntensity()|null|Makes the texture transparent based on the intensity of colors in the image. | ||
| | |AlphaToMask()|null|Creates a black and white mask texture from an alpha image | ||
| Same as above, but only effects the red channel of the texture | |RemoveAlpha()|null|Forces the entire image to full opacity on the alpha channel | ||
| | |GrayscaleAverage()|null|Converts the image to grayscale based on the average of the red, green and blue channel. | ||
| | |SwapRG()|null|Swaps the red and green channels on the image | ||
| Same as above, but only effects the green channel of the texture | |SwapRB()|null|Swaps the red and blue channels on the image | ||
| | |SwapGB()|null|Swaps the green and blue channels on the image | ||
| | |ShiftHue()|null|Adjusts the hue of the image by the increment specified in the Input box | ||
| Same as above, but only effects the blue channel of the texture | |AdjustGamma()|null|Adjusts the gamma the image by the increment specified in the Input box | ||
| | |Resize()|null|Resizes the image such that the longest size of the image is equal to the size specified in the input box. | ||
| | |FlipHorizontal()|null|Flips the image horizontally | ||
| Same as above, but only effects the alpha channel of the texture | |FlipVertical()|null|Flips the image vertical | ||
| | |Rotate90CW()|null|Rotates the image by 90° clockwise | ||
|Rotate90CCW()|null|Rotates the image by 90° counterclockwise | |||
| Converts all pure white colors in the image to alpha | |Rotate180()|null|Rotates the image by 180° | ||
| | |TrimTransparent()|null|Stretches the image such that both sides are equal to the longest side | ||
|ToNearestPOT()|null|Stretches the image on each axis individually, to the next largest power of two. | |||
| Converts all pure black colors in the image to alpha | |InvalidFloats()|null|Highlights any pixels that are out of range | ||
| | |GenerateBitmapMetadata()|null|Spawns a [[Texture Metadata]] window displaying the asset's texture metadata as a string | ||
| | }} | ||
| | |||
| | |||
| Creates a black and white mask texture from an alpha image | |||
| | |||
| | |||
| Forces the entire image to full opacity on the alpha channel | |||
| | |||
| Converts the image to grayscale based on the average of the red, green and blue channel. | |||
| | |||
| | |||
| Swaps the red and green channels on the image | |||
| | |||
| | |||
| Swaps the red and blue channels on the image | |||
| | |||
| | |||
| Swaps the green and blue channels on the image | |||
| | |||
| | |||
| Adjusts the hue of the image by the increment specified in the Input box | |||
| | |||
| | |||
| Adjusts the gamma the image by the increment specified in the Input box | |||
| | |||
| | |||
| Resizes the image such that the longest size of the image is equal to the size specified in the input box. | |||
| | |||
| | |||
| Flips the image horizontally | |||
| | |||
| | |||
| Flips the image vertical | |||
| | |||
| | |||
| Rotates the image by 90° clockwise | |||
| | |||
| | |||
| Rotates the image by 90° counterclockwise | |||
| | |||
| | |||
| Rotates the image by 180° | |||
| | |||
| | |||
| Stretches the image such that both sides are equal to the longest side | |||
| | |||
| | |||
| Stretches the image on each axis individually, to the next largest power of two. | |||
| | |||
| | |||
| Highlights any pixels that are out of range | |||
| | |||
| | |||
| Spawns a [[Texture Metadata]] window displaying the asset's texture metadata as a string | |||
== Examples == | == Examples == | ||
== | == See Also == | ||
</translate> | </translate> | ||
[[Category:Components{{#translation:}}|Static Texture 2D]] | [[Category:Components{{#translation:}}|Static Texture 2D]] | ||
[[Category:Components:Assets{{#translation:}}|Static Texture 2D]] | [[Category:Components:Assets{{#translation:}}|Static Texture 2D]] |
Latest revision as of 15:33, 19 November 2024
This article or section is a Stub. You can help the Resonite Wiki by expanding it.
The StaticTexture2D Component stores a reference to a static asset representing a 2D Texture.
Fields
Name | Type | Description |
---|---|---|
persistent
|
Bool | Determines whether or not this item will be saved to the server. |
UpdateOrder
|
Int | Controls the order in which this component is updated. |
Enabled
|
Bool | Controls whether or not this component is enabled. |
URL
|
Uri | The Asset URI that references the raw texture data |
FilterMode
|
TextureFilterMode | How to handle the interpolation between pixels. |
AnisotropicLevel
|
Int | The levels of Anisotropic filtering distances when using Anisotropic for FilterMode
|
Uncompressed
|
Bool | Do not use texture compression |
DirectLoad
|
Bool | Whether to load the image directly from it's URI source and to not cache it locally. |
ForceExactVariant
|
Bool | Only allow one variant of the texture to exist, part of Asset Variant System. |
PreferredFormat
|
Nullable`1<TextureCompression> | The format to use for texture compression rather than the auto picked one |
PreferredProfile
|
Nullable`1<ColorProfile> | The color profile to use rather than the auto picked one. (usually linear) |
MipmapBias
|
Float | Whether to see lower resolution versions of the texture closer up or not (MipMaps). |
IsNormalMap
|
Bool | This texture should be interpreted as a Normal Map |
WrapModeU
|
TextureWrapMode | How to repeat or mirror the texture along the X axis. this goes into affect when X values are outside of the range [0.0 to 1.0]. |
WrapModeV
|
TextureWrapMode | How to repeat or mirror the texture along the Y axis. this goes into affect when Y values are outside of the range [0.0 to 1.0]. |
PowerOfTwoAlignThreshold
|
Float | The threshold for pixel count from range [0.0,1.0] before scaling both axes to a power of 2. |
CrunchCompressed
|
Bool | Whether to compress the texture to extreme lengths to reduce VRam usage. |
MaxSize
|
Nullable`1<Int> | The maxiumum size to show to the user, which scaled versions are generated by the cloud on the fly from the original and sent as part of the Asset Variant System |
Mipmaps
|
Bool | Whether to enable the rendering of mipmaps, which are lower res textures at further distances from the camera to improve performance. |
KeepOriginalMipMaps
|
Bool | Whether to use the original mipmaps that came with the image data (yes you could have rainbow mipmaps at further distances) or not. |
MipMapFilter
|
Filtering | How to apply filtering to the image's mipmaps. please see Filtering! |
Readable
|
Bool | Whether this can be read per pixel via things like ProtoFlux |
Usage
By default Filter
is set to Bilinear Filtering, however Anisotropic Filtering results in a much better appearance at very steep angles, and only has a very minor performance impact. If visual fidelity of your texture is a concern, you should set Filter
to Anisotropic, and AnisotropicLevel
to 4 or 8.
Special Functions
Any of the operations listed below will generate a new static texture asset, and anything referring to this StaticTexture2D component will be updated with the new texture. The existing asset is deleted from the servers if no other items refer to it.
Troubleshooting
When importing images into Resonite, sometimes the image will have a row of pixels taken from the bottom of the image rendered at the top. To fix this issue, go to the FilterMode property on the StaticTexture2D component, click the checkbox, and select "Point". This prevents the issue
Method Name | Method type and Arguments. | Description |
---|---|---|
InvertRGB()
|
null | Inverts the colors of the texture |
InvertR()
|
null | Same as above, but only effects the red channel of the texture |
InvertG()
|
null | Same as above, but only effects the green channel of the texture |
InvertB()
|
null | Same as above, but only effects the blue channel of the texture |
InvertA()
|
null | Same as above, but only effects the alpha channel of the texture |
ColorToAlphaWhite()
|
null | Converts all pure white colors in the image to alpha |
ColorToAlphaBlack()
|
null | Converts all pure black colors in the image to alpha |
AlphaFromIntensity()
|
null | Makes the texture transparent based on the intensity of colors in the image. |
AlphaToMask()
|
null | Creates a black and white mask texture from an alpha image |
RemoveAlpha()
|
null | Forces the entire image to full opacity on the alpha channel |
GrayscaleAverage()
|
null | Converts the image to grayscale based on the average of the red, green and blue channel. |
SwapRG()
|
null | Swaps the red and green channels on the image |
SwapRB()
|
null | Swaps the red and blue channels on the image |
SwapGB()
|
null | Swaps the green and blue channels on the image |
ShiftHue()
|
null | Adjusts the hue of the image by the increment specified in the Input box |
AdjustGamma()
|
null | Adjusts the gamma the image by the increment specified in the Input box |
Resize()
|
null | Resizes the image such that the longest size of the image is equal to the size specified in the input box. |
FlipHorizontal()
|
null | Flips the image horizontally |
FlipVertical()
|
null | Flips the image vertical |
Rotate90CW()
|
null | Rotates the image by 90° clockwise |
Rotate90CCW()
|
null | Rotates the image by 90° counterclockwise |
Rotate180()
|
null | Rotates the image by 180° |
TrimTransparent()
|
null | Stretches the image such that both sides are equal to the longest side |
ToNearestPOT()
|
null | Stretches the image on each axis individually, to the next largest power of two. |
InvalidFloats()
|
null | Highlights any pixels that are out of range |
GenerateBitmapMetadata()
|
null | Spawns a Texture Metadata window displaying the asset's texture metadata as a string |