If you use lower precision floating point data types for these purposes, it can cause precision-related artifacts. On most platforms, float values are 32 bits like in regular programming languages.įull float precision is typically useful for world space positions, texture coordinates, or scalar calculations that involve complex functions such as trigonometry or power/exponentiation. This is the highest precision floating point data type.
There are also several related data types for vectors and matrices such as half3 and float4x4. These data types differ in precision and, consequently, performance or power usage. In Unity’s implementation of HLSL, the scalar floating point data types are float, half, and fixed. Shaders carry out the majority of calculations using floating point numbers (also called as float in regular programming languages like C#).
However, Unity handles some data types differently from HLSL to provide better support on mobile platforms. More info See in Glossary language HLSL and supports general HLSL data types. Unity uses the standard Shader A program that runs on the GPU.