Skip to content

Commit bb4f35d

Browse files
make the numeric defines uniformly named
1 parent 54c01f4 commit bb4f35d

File tree

15 files changed

+138
-83
lines changed

15 files changed

+138
-83
lines changed

include/nbl/builtin/glsl/bxdf/brdf/specular/beckmann.glsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ vec3 nbl_glsl_beckmann_cos_remainder_and_pdf(out float pdf, in nbl_glsl_LightSam
148148
float onePlusLambda_V;
149149
pdf = nbl_glsl_beckmann_pdf_wo_clamps(ndf, interaction.NdotV, interaction.NdotV_squared, a2, onePlusLambda_V);
150150
vec3 rem = vec3(0.0);
151-
if (_sample.NdotL>FLT_MIN && interaction.NdotV>FLT_MIN)
151+
if (_sample.NdotL>nbl_glsl_FLT_MIN && interaction.NdotV>nbl_glsl_FLT_MIN)
152152
{
153153
const vec3 reflectance = nbl_glsl_fresnel_conductor(ior[0], ior[1], _cache.VdotH);
154154

@@ -185,7 +185,7 @@ vec3 nbl_glsl_beckmann_aniso_cos_remainder_and_pdf(out float pdf, in nbl_glsl_Li
185185
float onePlusLambda_V;
186186
pdf = nbl_glsl_beckmann_pdf_wo_clamps(ndf, interaction.isotropic.NdotV, TdotV2, BdotV2, NdotV2, ax2, ay2, onePlusLambda_V);
187187
vec3 rem = vec3(0.0);
188-
if (_sample.NdotL>FLT_MIN && interaction.isotropic.NdotV>FLT_MIN)
188+
if (_sample.NdotL>nbl_glsl_FLT_MIN && interaction.isotropic.NdotV>nbl_glsl_FLT_MIN)
189189
{
190190
const float TdotL2 = _sample.TdotL*_sample.TdotL;
191191
const float BdotL2 = _sample.BdotL*_sample.BdotL;
@@ -202,7 +202,7 @@ vec3 nbl_glsl_beckmann_aniso_cos_remainder_and_pdf(out float pdf, in nbl_glsl_Li
202202
float nbl_glsl_beckmann_height_correlated_cos_eval_DG_wo_clamps(in float NdotH2, in float NdotL2, in float NdotV2, in float a2)
203203
{
204204
float NG = nbl_glsl_beckmann(a2, NdotH2);
205-
if (a2>FLT_MIN)
205+
if (a2>nbl_glsl_FLT_MIN)
206206
NG *= nbl_glsl_beckmann_smith_correlated(NdotV2, NdotL2, a2);
207207

208208
return NG;
@@ -217,7 +217,7 @@ vec3 nbl_glsl_beckmann_height_correlated_cos_eval_wo_clamps(in float NdotH2, in
217217
}
218218
vec3 nbl_glsl_beckmann_height_correlated_cos_eval(in nbl_glsl_LightSample _sample, in nbl_glsl_IsotropicViewSurfaceInteraction interaction, in nbl_glsl_IsotropicMicrofacetCache _cache, in mat2x3 ior, in float a2)
219219
{
220-
if (interaction.NdotV>FLT_MIN)
220+
if (interaction.NdotV>nbl_glsl_FLT_MIN)
221221
return nbl_glsl_beckmann_height_correlated_cos_eval_wo_clamps(_cache.NdotH2,_sample.NdotL2,interaction.NdotV,interaction.NdotV_squared,_cache.VdotH,ior,a2);
222222
else
223223
return vec3(0.0);
@@ -226,7 +226,7 @@ vec3 nbl_glsl_beckmann_height_correlated_cos_eval(in nbl_glsl_LightSample _sampl
226226
float nbl_glsl_beckmann_aniso_height_correlated_cos_eval_DG_wo_clamps(in float NdotH2, in float TdotH2, in float BdotH2, in float NdotL2, in float TdotL2, in float BdotL2, in float NdotV2, in float TdotV2, in float BdotV2, in float ax, in float ax2, in float ay, in float ay2)
227227
{
228228
float NG = nbl_glsl_beckmann(ax, ay, ax2, ay2, TdotH2, BdotH2, NdotH2);
229-
if (ax>FLT_MIN || ay>FLT_MIN)
229+
if (ax>nbl_glsl_FLT_MIN || ay>nbl_glsl_FLT_MIN)
230230
NG *= nbl_glsl_beckmann_smith_correlated(TdotV2, BdotV2, NdotV2, TdotL2, BdotL2, NdotL2, ax2, ay2);
231231

232232
return NG;
@@ -241,7 +241,7 @@ vec3 nbl_glsl_beckmann_aniso_height_correlated_cos_eval_wo_clamps(in float NdotH
241241
}
242242
vec3 nbl_glsl_beckmann_aniso_height_correlated_cos_eval(in nbl_glsl_LightSample _sample, in nbl_glsl_AnisotropicViewSurfaceInteraction interaction, in nbl_glsl_AnisotropicMicrofacetCache _cache, in mat2x3 ior, in float ax, in float ay)
243243
{
244-
if (interaction.isotropic.NdotV>FLT_MIN)
244+
if (interaction.isotropic.NdotV>nbl_glsl_FLT_MIN)
245245
{
246246
const float TdotH2 = _cache.TdotH*_cache.TdotH;
247247
const float BdotH2 = _cache.BdotH*_cache.BdotH;

include/nbl/builtin/glsl/bxdf/brdf/specular/blinn_phong.glsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ vec3 nbl_glsl_blinn_phong_conductor_cos_remainder_and_pdf(out float pdf, in nbl_
6767
float nbl_glsl_blinn_phong_cos_eval_DG_wo_clamps(in float NdotH, in float NdotV_squared, in float NdotL2, in float n, in float a2)
6868
{
6969
float NG = nbl_glsl_blinn_phong(NdotH, n);
70-
if (a2>FLT_MIN)
70+
if (a2>nbl_glsl_FLT_MIN)
7171
NG *= nbl_glsl_beckmann_smith_correlated(NdotV_squared, NdotL2, a2);
7272
return NG;
7373
}
@@ -89,7 +89,7 @@ vec3 nbl_glsl_blinn_phong_cos_eval_wo_clamps(in float NdotH, in float maxNdotV,
8989
}
9090
vec3 nbl_glsl_blinn_phong_cos_eval(in nbl_glsl_LightSample _sample, in nbl_glsl_IsotropicViewSurfaceInteraction interaction, in nbl_glsl_IsotropicMicrofacetCache _cache, in float n, in mat2x3 ior)
9191
{
92-
if (interaction.NdotV>FLT_MIN)
92+
if (interaction.NdotV>nbl_glsl_FLT_MIN)
9393
return nbl_glsl_blinn_phong_cos_eval_wo_clamps(_cache.NdotH, interaction.NdotV, interaction.NdotV_squared, _sample.NdotL2, _cache.VdotH, n, ior);
9494
else
9595
return vec3(0.0);
@@ -99,7 +99,7 @@ vec3 nbl_glsl_blinn_phong_cos_eval(in nbl_glsl_LightSample _sample, in nbl_glsl_
9999
float nbl_glsl_blinn_phong_cos_eval_DG_wo_clamps(in float NdotH, in float NdotH2, in float TdotH2, in float BdotH2, float TdotL2, float BdotL2, in float TdotV2, in float BdotV2, in float NdotV_squared, in float NdotL2, in float nx, in float ny, in float ax2, in float ay2)
100100
{
101101
float DG = nbl_glsl_blinn_phong(NdotH, 1.0/(1.0-NdotH2), TdotH2, BdotH2, nx, ny);
102-
if (ax2>FLT_MIN || ay2>FLT_MIN)
102+
if (ax2>nbl_glsl_FLT_MIN || ay2>nbl_glsl_FLT_MIN)
103103
DG *= nbl_glsl_beckmann_smith_correlated(TdotV2, BdotV2, NdotV_squared, TdotL2, BdotL2, NdotL2, ax2, ay2);
104104
return DG;
105105
}
@@ -126,7 +126,7 @@ vec3 nbl_glsl_blinn_phong_cos_eval_wo_clamps(in float NdotH, in float NdotH2, in
126126
}
127127
vec3 nbl_glsl_blinn_phong_cos_eval(in nbl_glsl_LightSample _sample, in nbl_glsl_AnisotropicViewSurfaceInteraction interaction, in nbl_glsl_AnisotropicMicrofacetCache _cache, in float nx, in float ny, in mat2x3 ior)
128128
{
129-
if (interaction.isotropic.NdotV>FLT_MIN)
129+
if (interaction.isotropic.NdotV>nbl_glsl_FLT_MIN)
130130
{
131131
const float TdotH2 = _cache.TdotH*_cache.TdotH;
132132
const float BdotH2 = _cache.BdotH*_cache.BdotH;

include/nbl/builtin/glsl/bxdf/brdf/specular/ggx.glsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ vec3 nbl_glsl_ggx_height_correlated_aniso_cos_eval(in nbl_glsl_BSDFAnisotropicPa
2626
float nbl_glsl_ggx_height_correlated_aniso_cos_eval_DG_wo_clamps(in float NdotH2, in float TdotH2, in float BdotH2, in float maxNdotL, in float NdotL2, in float TdotL2, in float BdotL2, in float maxNdotV, in float NdotV2, in float TdotV2, in float BdotV2, in float ax, in float ax2, in float ay, in float ay2)
2727
{
2828
float NG = nbl_glsl_ggx_aniso(TdotH2,BdotH2,NdotH2, ax, ay, ax2, ay2);
29-
if (ax>FLT_MIN || ay>FLT_MIN)
29+
if (ax>nbl_glsl_FLT_MIN || ay>nbl_glsl_FLT_MIN)
3030
{
3131
NG *= nbl_glsl_ggx_smith_correlated_wo_numerator(
3232
maxNdotV, TdotV2, BdotV2, NdotV2,
@@ -48,7 +48,7 @@ vec3 nbl_glsl_ggx_height_correlated_aniso_cos_eval_wo_clamps(in float NdotH2, in
4848

4949
vec3 nbl_glsl_ggx_height_correlated_aniso_cos_eval(in nbl_glsl_LightSample _sample, in nbl_glsl_AnisotropicViewSurfaceInteraction interaction, in nbl_glsl_AnisotropicMicrofacetCache _cache, in mat2x3 ior, in float ax, in float ay)
5050
{
51-
if (_sample.NdotL>FLT_MIN && interaction.isotropic.NdotV>FLT_MIN)
51+
if (_sample.NdotL>nbl_glsl_FLT_MIN && interaction.isotropic.NdotV>nbl_glsl_FLT_MIN)
5252
{
5353
const float TdotH2 = _cache.TdotH*_cache.TdotH;
5454
const float BdotH2 = _cache.BdotH*_cache.BdotH;
@@ -68,7 +68,7 @@ vec3 nbl_glsl_ggx_height_correlated_aniso_cos_eval(in nbl_glsl_LightSample _samp
6868
float nbl_glsl_ggx_height_correlated_cos_eval_DG_wo_clamps(in float NdotH2, in float maxNdotL, in float NdotL2, in float maxNdotV, in float NdotV2, in float a2)
6969
{
7070
float NG = nbl_glsl_ggx_trowbridge_reitz(a2, NdotH2);
71-
if (a2>FLT_MIN)
71+
if (a2>nbl_glsl_FLT_MIN)
7272
NG *= nbl_glsl_ggx_smith_correlated_wo_numerator(maxNdotV, NdotV2, maxNdotL, NdotL2, a2);
7373

7474
return NG;
@@ -85,7 +85,7 @@ vec3 nbl_glsl_ggx_height_correlated_cos_eval_wo_clamps(in float NdotH2, in float
8585

8686
vec3 nbl_glsl_ggx_height_correlated_cos_eval(in nbl_glsl_LightSample _sample, in nbl_glsl_IsotropicViewSurfaceInteraction interaction, in nbl_glsl_IsotropicMicrofacetCache _cache, in mat2x3 ior, in float a2)
8787
{
88-
if (_sample.NdotL>FLT_MIN && interaction.NdotV>FLT_MIN)
88+
if (_sample.NdotL>nbl_glsl_FLT_MIN && interaction.NdotV>nbl_glsl_FLT_MIN)
8989
return nbl_glsl_ggx_height_correlated_cos_eval_wo_clamps(_cache.NdotH2,max(_sample.NdotL,0.0),_sample.NdotL2, max(interaction.NdotV,0.0), interaction.NdotV_squared, _cache.VdotH,ior,a2);
9090
else
9191
return vec3(0.0);
@@ -175,7 +175,7 @@ vec3 nbl_glsl_ggx_cos_remainder_and_pdf(out float pdf, in nbl_glsl_LightSample _
175175
const float devsh_v = nbl_glsl_smith_ggx_devsh_part(interaction.NdotV_squared, a2, one_minus_a2);
176176
pdf = nbl_glsl_ggx_pdf_wo_clamps(ndf, devsh_v, interaction.NdotV);
177177
vec3 rem = vec3(0.0);
178-
if (_sample.NdotL>FLT_MIN && interaction.NdotV>FLT_MIN)
178+
if (_sample.NdotL>nbl_glsl_FLT_MIN && interaction.NdotV>nbl_glsl_FLT_MIN)
179179
{
180180
const vec3 reflectance = nbl_glsl_fresnel_conductor(ior[0], ior[1], _cache.VdotH);
181181
const float G2_over_G1 = nbl_glsl_ggx_smith_G2_over_G1_devsh(_sample.NdotL, _sample.NdotL2, interaction.NdotV, devsh_v, a2, one_minus_a2);
@@ -217,7 +217,7 @@ vec3 nbl_glsl_ggx_aniso_cos_remainder_and_pdf(out float pdf, in nbl_glsl_LightSa
217217
const float ndf = nbl_glsl_ggx_aniso(TdotH2, BdotH2, _cache.isotropic.NdotH2, ax, ay, ax2, ay2);
218218
pdf = nbl_glsl_ggx_pdf_wo_clamps(ndf, devsh_v, interaction.isotropic.NdotV);
219219
vec3 rem = vec3(0.0);
220-
if (_sample.NdotL>FLT_MIN && interaction.isotropic.NdotV>FLT_MIN)
220+
if (_sample.NdotL>nbl_glsl_FLT_MIN && interaction.isotropic.NdotV>nbl_glsl_FLT_MIN)
221221
{
222222
const float TdotL2 = _sample.TdotL*_sample.TdotL;
223223
const float BdotL2 = _sample.BdotL*_sample.BdotL;

include/nbl/builtin/glsl/bxdf/common_samples.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ nbl_glsl_LightSample nbl_glsl_transmission_cos_generate(in nbl_glsl_AnisotropicV
1717
- The `remainder_and_pdf` functions are meant to be used with MIS
1818
- Our own generator can never pick an improbable path, so no checking necessary
1919
- For other generators the estimator will be `f_BSDF*f_Light*f_Visibility*clampedCos(theta)/(1+(p_BSDF^alpha+p_otherNonChosenGenerator^alpha+...)/p_ChosenGenerator^alpha)`
20-
when `p_BSDF` equals `FLT_INF` it will drive the overall MIS estimator for the other generators to 0 so no checking necessary
20+
when `p_BSDF` equals `nbl_glsl_FLT_INF` it will drive the overall MIS estimator for the other generators to 0 so no checking necessary
2121
**/
2222
float nbl_glsl_transmission_cos_remainder_and_pdf(out float pdf)
2323
{

include/nbl/builtin/glsl/ext/RadeonRays/ray.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
struct nbl_glsl_ext_RadeonRays_ray
55
{
66
vec3 origin;
7-
float maxT; // FLT_MAX
7+
float maxT; // nbl_glsl_FLT_MAX
88
vec3 direction;
99
float time;
1010
int mask; // want to have it to -1

include/nbl/builtin/glsl/format/encode.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ uvec3 nbl_glsl_impl_sharedExponentEncodeCommon(in vec3 clamped, in int newExpBia
77
{
88
const float maxrgb = max(max(clamped.r,clamped.g),clamped.b);
99
// TODO: optimize this
10-
const int f32_exp = ((floatBitsToInt(maxrgb)>>23) & 0xff) - 126;
10+
const int f32_exp = int(nbl_glsl_ieee754_extract_biased_exponent(maxrgb))-126;
1111

1212
shared_exp = clamp(f32_exp,-newExpBias,newMaxExp+1);
1313

include/nbl/builtin/glsl/limits/numeric.glsl

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,78 @@
55
#ifndef _NBL_LIMITS_NUMERIC_INCLUDED_
66
#define _NBL_LIMITS_NUMERIC_INCLUDED_
77

8-
#ifndef INT_MIN
9-
#define INT_MIN -2147483648
8+
#ifndef nbl_glsl_INT_MIN
9+
#define nbl_glsl_INT_MIN -2147483648
1010
#endif
11-
#ifndef INT_MAX
12-
#define INT_MAX 2147483647
11+
#ifndef nbl_glsl_INT_MAX
12+
#define nbl_glsl_INT_MAX 2147483647
1313
#endif
1414

15-
#ifndef UINT_MIN
16-
#define UINT_MIN 0u
15+
#ifndef nbl_glsl_UINT_MIN
16+
#define nbl_glsl_UINT_MIN 0u
1717
#endif
18-
#ifndef UINT_MAX
19-
#define UINT_MAX 4294967295u
18+
#ifndef nbl_glsl_UINT_MAX
19+
#define nbl_glsl_UINT_MAX 4294967295u
2020
#endif
2121

22-
#ifndef FLT_MIN
23-
#define FLT_MIN 1.175494351e-38
22+
#ifndef nbl_glsl_FLT_MIN
23+
#define nbl_glsl_FLT_MIN 1.175494351e-38
2424
#endif
2525

26-
#ifndef FLT_MAX
27-
#define FLT_MAX 3.402823466e+38
26+
#ifndef nbl_glsl_FLT_MAX
27+
#define nbl_glsl_FLT_MAX 3.402823466e+38
2828
#endif
2929

30-
#ifndef FLT_INF
31-
#define FLT_INF (1.0/0.0)
30+
#ifndef nbl_glsl_FLT_INF
31+
#define nbl_glsl_FLT_INF (1.f/0.f)
3232
#endif
3333

34+
#ifndef nbl_glsl_FLT_NAN
35+
#define nbl_glsl_FLT_NAN uintBitsToFloat(0xFFffFFffu)
36+
#endif
37+
38+
#ifndef nbl_glsl_FLT_EPSILON
39+
#define nbl_glsl_FLT_EPSILON 5.96046447754e-08
40+
#endif
41+
42+
43+
// TODO: move to some other header (maybe ieee754.glsl)
44+
uint nbl_glsl_ieee754_extract_biased_exponent(float x)
45+
{
46+
return bitfieldExtract(floatBitsToUint(x),23,8);
47+
}
48+
float nbl_glsl_ieee754_replace_biased_exponent(float x, uint exp_plus_bias)
49+
{
50+
return uintBitsToFloat(bitfieldInsert(floatBitsToUint(x),exp_plus_bias,23,8));
51+
}
52+
// performs no overflow tests, returns x*exp2(n)
53+
float nbl_glsl_ieee754_fast_mul_exp2(float x, int n)
54+
{
55+
return nbl_glsl_ieee754_replace_biased_exponent(x,nbl_glsl_ieee754_extract_biased_exponent(x)+uint(n));
56+
}
57+
58+
59+
float nbl_glsl_numeric_limits_float_epsilon(float n)
60+
{
61+
return nbl_glsl_ieee754_fast_mul_exp2(n,-24);
62+
}
63+
float nbl_glsl_numeric_limits_float_epsilon(int n)
64+
{
65+
return nbl_glsl_numeric_limits_float_epsilon(float(n));
66+
}
67+
float nbl_glsl_numeric_limits_float_epsilon()
68+
{
69+
return nbl_glsl_FLT_EPSILON;
70+
}
71+
72+
float nbl_glsl_ieee754_gamma(float n)
73+
{
74+
const float a = nbl_glsl_numeric_limits_float_epsilon(n);
75+
return a/(1.f-a);
76+
}
77+
float nbl_glsl_ieee754_gamma(uint n)
78+
{
79+
return nbl_glsl_ieee754_gamma(float(n));
80+
}
81+
3482
#endif

include/nbl/builtin/glsl/material_compiler/common.glsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ void nbl_glsl_MC_instr_eval_and_pdf_execute(in nbl_glsl_MC_instr_t instr, in nbl
563563
vec3 eval = vec3(0.0);
564564
float pdf = 0.0;
565565

566-
if (is_bxdf && run && (NdotV > FLT_MIN))
566+
if (is_bxdf && run && (NdotV > nbl_glsl_FLT_MIN))
567567
{
568568
//speculative execution
569569
uint ndf = nbl_glsl_MC_instr_getNDF(instr);
@@ -583,7 +583,7 @@ void nbl_glsl_MC_instr_eval_and_pdf_execute(in nbl_glsl_MC_instr_t instr, in nbl
583583
#if defined(OP_DIFFUSE) || defined(OP_DIFFTRANS)
584584
if (nbl_glsl_MC_op_isDiffuse(op))
585585
{
586-
if (NdotL > FLT_MIN)
586+
if (NdotL > nbl_glsl_FLT_MIN)
587587
{
588588
eval = albedo * nbl_glsl_oren_nayar_cos_remainder_and_pdf_wo_clamps(pdf, a2, s.VdotL, NdotL, NdotV);
589589
pdf *= is_bsdf ? 0.5 : 1.0;
@@ -871,7 +871,7 @@ nbl_glsl_LightSample nbl_bsdf_cos_generate(in nbl_glsl_MC_precomputed_t precomp,
871871
const vec3 albedo = nbl_glsl_MC_params_getReflectance(params);
872872

873873
const float NdotV = nbl_glsl_conditionalAbsOrMax(is_bsdf, currInteraction.inner.isotropic.NdotV, 0.0);
874-
const bool positiveNdotV = (NdotV > FLT_MIN);
874+
const bool positiveNdotV = (NdotV > nbl_glsl_FLT_MIN);
875875

876876
float localPdf = 0.0;
877877
vec3 rem = vec3(0.0);
@@ -1070,7 +1070,7 @@ vec3 nbl_glsl_MC_runGenerateAndRemainderStream(in nbl_glsl_MC_precomputed_t prec
10701070

10711071
vec3 num = restEval;
10721072
float den = restPdf;
1073-
if (generator_pdf>FLT_MIN)
1073+
if (generator_pdf>nbl_glsl_FLT_MIN)
10741074
{
10751075
out_pdf += generator_pdf;
10761076
// guaranteed less than INF
@@ -1079,7 +1079,7 @@ vec3 nbl_glsl_MC_runGenerateAndRemainderStream(in nbl_glsl_MC_precomputed_t prec
10791079
num = num*rcp_generator_pdf+generator_rem;
10801080
den = den*rcp_generator_pdf+1.0;
10811081
}
1082-
return out_pdf>FLT_MIN ? (num/den):vec3(0.0);
1082+
return out_pdf>nbl_glsl_FLT_MIN ? (num/den):vec3(0.0);
10831083
}
10841084

10851085
#endif //GEN_CHOICE_STREAM

include/nbl/builtin/glsl/material_compiler/rasterization/impl.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void nbl_glsl_MC_instr_eval_execute(in nbl_glsl_MC_instr_t instr, in nbl_glsl_MC
1414
const bool is_bsdf = !nbl_glsl_MC_op_isBRDF(op); //note: true for everything besides BRDF ops (combiners, SET_GEOM_NORMAL and BUMPMAP too)
1515
const float cosFactor = nbl_glsl_conditionalAbsOrMax(is_bsdf, s.NdotL, 0.0);
1616
const float NdotV = nbl_glsl_conditionalAbsOrMax(is_bsdf, currInteraction.inner.isotropic.NdotV, 0.0);
17-
const bool positiveCosFactors = (cosFactor > FLT_MIN) && (NdotV > FLT_MIN);
17+
const bool positiveCosFactors = (cosFactor > nbl_glsl_FLT_MIN) && (NdotV > nbl_glsl_FLT_MIN);
1818
const bool is_bxdf_or_combiner = nbl_glsl_MC_op_isBXDForCoatOrBlend(op);
1919

2020
uvec3 regs = nbl_glsl_MC_instr_decodeRegisters(instr);

include/nbl/builtin/glsl/math/constants.glsl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,4 @@
1111
#define nbl_glsl_RECIPROCAL_PI 0.318309886183
1212
#define nbl_glsl_SQRT_RECIPROCAL_PI 0.56418958354
1313

14-
#define nbl_glsl_FLT_INF float(1.0/0.0)
15-
16-
#ifndef nbl_glsl_FLT_NAN
17-
#define nbl_glsl_FLT_NAN uintBitsToFloat(0xFFffFFffu)
18-
#endif
19-
2014
#endif

0 commit comments

Comments
 (0)