-
Notifications
You must be signed in to change notification settings - Fork 3k
OBS Shading Language
The baseline for the shader language libOBS uses is HLSL, for which you can find documentation here. libOBS modifies this so it works across all of its supported graphics APIs, sacrificing functionality and versatility for compatibility. As a result, some effects that would be possible with ease in GLSL or HLSL directly do not work in libOBS's shader language. For the sake of all future documentation, the langauge will be referred to as OBS-SL, since it mixes and matches many different langauge constructs into one.
Similar to HLSL, OBS-SL supports storage, transfer and modification of data.
Storage specifiers seem to only be used by the OpenGL backend.
Name | DirectX | OpenGL | Notes |
---|---|---|---|
uniform |
uniform |
||
const |
const |
||
inout |
inout |
||
out |
out |
Name | DirectX | OpenGL |
---|---|---|
bool |
bool |
bool |
float |
float |
float |
float2 |
float2 |
vec2 |
float3 |
float3 |
vec3 |
float4 |
float4 |
vec4 |
int |
int |
int |
int2 |
int2 |
ivec2 |
int3 |
int3 |
ivec3 |
int4 |
int4 |
ivec4 |
string |
string |
string |
float3x3 |
float3x3 |
mat3x3 |
float3x4 |
float3x4 |
mat3x4 |
float4x4 |
float4x4 |
mat4x4 |
texture2d |
Texture2D |
sampler2D |
texture3d |
Texture3D |
sampler3D |
texture_cube |
TextureCube |
samplerCube |
texture_rect |
N/A | sampler2DRect |
sampler_state |
SamplerState |
Metadata only |
At the time of writing this, Arrays are only supported when DirectX is being used by libOBS. The patch to make it available in OpenGL was retracted at the request of the current OBS Project team.
A limited subset of keywords are supported, other keywords may work if they match across both langauges.
Name | DirectX | OpenGL |
---|---|---|
POSITION |
SV_Position |
gl_FragCoord |
TARGET |
SV_Target |
N/A |
VERTEXID |
SV_VertexID |
uint(gl_VertexID) |
A limited subset of semantics are supported, other keywords will not work.
Name | DirectX | OpenGL | Notes |
---|---|---|---|
POSITION |
SV_Position |
Metadata only | Provided as float32[4]
|
NORMAL |
NORMAL |
Metadata only | Provided as float32[4]
|
COLOR |
COLOR |
Metadata only | Provided as uint8_unorm[4]
|
TANGENT |
TANGENT |
Metadata only | Provided as float32[4]
|
TEXCOORD |
TEXCOORD |
Metadata only | Either float32 , float32[2] or float32[4] . |
VERTEXID |
VERTEXID |
Metadata only |
This work is licensed under a Creative Commons Attribution 4.0 International License.
The wiki has been under repeated automated attacks by bots, with attempts to phish or infect unsuspecting users with malware, trojans and similar software. As a response to these attacks and GitHubs complete ineptitude at handling this situation, we have decided to write-protect the wiki for the time being. If you wish to submit changes to the wiki, please do so over Discord. Thank you for understanding!
- 🟢 3D Transform
- 🔴 Auto-Framing
- 🟠 Blur
- 🟢 Color Grading
- 🔴 Denoising
- ❌ Displacement Mapping
- 🟢 Dynamic Mask
⚠️ SDF Effects- 🔴 Shaders
- 🔴 Spout
- 🔴 Upscaling
- 🔴 Virtual Greenscreen
- 🔴 Shaders
- 🔴 Sink
⚠️ Source Mirror
- 🔴 Shaders