Fragment Shader
The Renderable Component accepts custom fragment shaders.
These fragment shaders are written in GLSL and have some special variables.
Inputs
Name |
Type |
Description |
|---|---|---|
NtshEngn_position |
vec3 |
The fragment’s position, in world-space. |
NtshEngn_normal |
vec3 |
The fragment’s normal. |
NtshEngn_tangent |
vec3 |
The fragment’s tangent. |
NtshEngn_bitangent |
vec3 |
The fragment’s bitangent. |
NtshEngn_uv |
vec2 |
The fragment’s texture coordinates. |
NtshEngn_tbn |
mat3 |
The fragment’s Tangent-Bitangent-Normal matrix. |
NtshEngn_diffuseTextureSampler |
sampler2D |
The object’s material’s diffuse texture. |
NtshEngn_normalTextureSampler |
sampler2D |
The object’s material’s normal texture. |
NtshEngn_metalnessTextureSampler |
sampler2D |
The object’s material’s metalness texture. |
NtshEngn_roughnessTextureSampler |
sampler2D |
The object’s material’s roughness texture. |
NtshEngn_occlusionTextureSampler |
sampler2D |
The object’s material’s occlusion texture. |
NtshEngn_emissiveTextureSampler |
sampler2D |
The object’s material’s emissive texture. |
NtshEngn_emissiveFactor |
float |
The object’s material’s metalness factor. |
NtshEngn_alphaCutoff |
float |
The object’s material’s alpha cutoff. |
NtshEngn_scaleUV |
vec2 |
The object’s material’s UV scale. |
NtshEngn_offsetUV |
vec2 |
The object’s material’s UV offset. |
NtshEngn_useTriplanarMapping |
bool |
|
NtshEngn_directionalLightCount |
uint |
The number of directional lights in the scene. |
NtshEngn_directionalLight(i) |
The *i*th directional light. |
|
NtshEngn_pointLightCount |
uint |
The number of point lights in the scene. |
NtshEngn_pointLight(i) |
The *i*th point light. |
|
NtshEngn_spotLightCount |
uint |
The number of spot lights in the scene. |
NtshEngn_spotLight(i) |
The *i*th spot light. |
|
NtshEngn_ambientLightCount |
uint |
The number of ambient lights in the scene. |
NtshEngn_ambientLight(i) |
The *i*th ambient light. |
|
NtshEngn_time |
float |
The time since the application’s launch, in seconds. |
NtshEngn_cameraPosition |
vec3 |
The camera’s position, in world-space. |
NtshEngn_useReversedDepth |
bool |
|
Outputs
Name |
Type |
Description |
|---|---|---|
NtshEngn_outColor |
vec4 |
The output color. |
NtshEngn_outDepth |
float |
The output depth. |