$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
pbr_functions.glsl File Reference

Functions

vec2 dirToUV (vec3 v)
 
vec3 fresnelSchlickRoughness (float cosTheta, vec3 F0, float roughness)
 
vec3 compute_IBL_PBR_Advanced (vec3 N, vec3 V, vec3 R, vec3 F0, float NdotV, vec3 albedo, float metallic, float roughness, float ao, vec3 worldPos)
 
float compute_specular_aa_roughness (vec3 N, float roughness, float projectedCurvature)
 
float compute_roughness_clamping_analytic (float roughness, float curvature)
 
float compute_roughness_clamping (vec3 N, float roughness)
 
vec3 compute_pbr_stable (vec3 N, vec3 V, vec3 albedo, float metallic, float roughness, float ao, vec3 worldPos, float curvature)
 
vec3 compute_pbr (vec3 N, vec3 V, vec3 albedo, float metallic, float roughness, float ao, vec3 worldPos)
 
vec3 compute_debug (vec3 N, vec3 V, vec3 albedo, float metallic, float roughness, float ao, int debugMode, vec3 worldPos)
 

Variables

header sh_probe glsl
 
const float PI = 3.14159265359
 
const float INV_PI = 0.31830988618
 
const float EPSILON = 1e-6
 

Function Documentation

◆ compute_debug()

vec3 compute_debug ( vec3  N,
vec3  V,
vec3  albedo,
float  metallic,
float  roughness,
float  ao,
int  debugMode,
vec3  worldPos 
)
Here is the call graph for this function:

◆ compute_IBL_PBR_Advanced()

vec3 compute_IBL_PBR_Advanced ( vec3  N,
vec3  V,
vec3  R,
vec3  F0,
float  NdotV,
vec3  albedo,
float  metallic,
float  roughness,
float  ao,
vec3  worldPos 
)
Here is the call graph for this function:

◆ compute_pbr()

vec3 compute_pbr ( vec3  N,
vec3  V,
vec3  albedo,
float  metallic,
float  roughness,
float  ao,
vec3  worldPos 
)
Here is the call graph for this function:

◆ compute_pbr_stable()

vec3 compute_pbr_stable ( vec3  N,
vec3  V,
vec3  albedo,
float  metallic,
float  roughness,
float  ao,
vec3  worldPos,
float  curvature 
)
Here is the call graph for this function:

◆ compute_roughness_clamping()

float compute_roughness_clamping ( vec3  N,
float  roughness 
)

◆ compute_roughness_clamping_analytic()

float compute_roughness_clamping_analytic ( float  roughness,
float  curvature 
)

Analytic Roughness Clamping (Hardware Independent)

Parameters
roughnessThe original perceptual roughness
curvatureThe geometric curvature (e.g., 1.0 / Radius for spheres)

◆ compute_specular_aa_roughness()

float compute_specular_aa_roughness ( vec3  N,
float  roughness,
float  projectedCurvature 
)

Generic Screen-Space Roughness Clamping (Hardware Dependent)

Note
This uses GPU derivatives (dFdx/dFdy) which differ between vendors.
Currently disabled to ensure bit-perfect "ISO" rendering across GPUs. Screen-Space Specular Semi-Analytic Anti-Aliasing. Uses the Varef (Variance-based Roughness) technique.
Parameters
NNormal vector in world space.
roughnessPerceptual roughness (0-1).
projectedCurvaturePixel size in world space / Geo Radius (Analytic AA).

◆ dirToUV()

vec2 dirToUV ( vec3  v)

◆ fresnelSchlickRoughness()

vec3 fresnelSchlickRoughness ( float  cosTheta,
vec3  F0,
float  roughness 
)

Variable Documentation

◆ EPSILON

const float EPSILON = 1e-6

◆ glsl

header postprocess lut3d glsl

◆ INV_PI

const float INV_PI = 0.31830988618

◆ PI

const float PI = 3.14159265359