Firstborn/Library/PackageCache/com.unity.shadergraph@12.1.11/Documentation~/Texel-Size-Node.md
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

1.1 KiB

Texel Size Node

Description

Returns the Width and Height of the texel size of Texture 2D input. Uses the built in variable {texturename}_TexelSize to access special properties of a Texture 2D.

If you experience texture sampling errors while using this node in a graph which includes Custom Function Nodes or Sub Graphs, you can resolve them by upgrading to version 10.3 or later.

Note: Do not use the default input to reference your Texture 2D. It makes your graph perform worse. Instead connect this node to a separate Texture 2D Asset Node and re-use this definition for sampling.

Ports

Name Direction Type Binding Description
Texture Input Texture None Texture asset
Width Output Float None Texel width
Height Output Float None Texel height

Generated Code Example

The following example code represents one possible outcome of this node.

float _TexelSize_Width = Texture_TexelSize.z;
float _TexelSize_Height = Texture_TexelSize.w;