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_color |
vec4 |
The fragment’s color from vertex colors. |
NtshEngn_tbn |
mat3 |
The fragment’s Tangent-Bitangent-Normal matrix. |
NtshEngn_diffuseTexture |
sampler2D |
The object’s material’s diffuse texture. |
NtshEngn_normalTexture |
sampler2D |
The object’s material’s normal texture. |
NtshEngn_metalnessTexture |
sampler2D |
The object’s material’s metalness texture. |
NtshEngn_roughnessTexture |
sampler2D |
The object’s material’s roughness texture. |
NtshEngn_occlusionTexture |
sampler2D |
The object’s material’s occlusion texture. |
NtshEngn_emissiveTexture |
sampler2D |
The object’s material’s emissive texture. |
NtshEngn_emissiveFactor |
float |
The object’s material’s emissive 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(uint i) |
The |
|
NtshEngn_directionalLightShadows(uint i, vec p) |
float |
A value between 0.0 and 1.0 determining how much the position |
NtshEngn_pointLightCount |
uint |
The number of point lights in the scene. |
NtshEngn_pointLight(uint i) |
The |
|
NtshEngn_pointLightShadows(uint i, vec p) |
float |
A value between 0.0 and 1.0 determining how much the position |
NtshEngn_spotLightCount |
uint |
The number of spot lights in the scene. |
NtshEngn_spotLight(uint i) |
The |
|
NtshEngn_spotLightShadows(uint i, vec p) |
float |
A value between 0.0 and 1.0 determining how much the position |
NtshEngn_ambientLightCount |
uint |
The number of ambient lights in the scene. |
NtshEngn_ambientLight(i) |
The |
|
NtshEngn_time |
float |
The time since the application’s launch, in seconds. |
NtshEngn_cameraPosition |
vec3 |
The camera’s position, in world-space. |
NtshEngn_width |
uint |
The framebuffer’s width. |
NtshEngn_height |
uint |
The framebuffer’s height. |
NtshEngn_useReversedDepth |
bool |
|
Outputs
Name |
Type |
Description |
|---|---|---|
NtshEngn_outColor |
vec4 |
The output color. |
NtshEngn_outDepth |
float |
The output depth. |