Skip to content

Commit 7132754

Browse files
committed
WIP
1 parent c4a79d8 commit 7132754

12 files changed

+63
-137
lines changed

extensions/pl_renderer_ext.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ pl_renderer_cleanup_scene(plScene* ptScene)
840840
{
841841
plEnvironmentProbeData* ptProbe = &ptScene->sbtProbeData[j];
842842

843-
gptGfx->queue_texture_for_deletion(gptData->ptDevice, ptProbe->tGGXLUTTexture);
843+
gptGfx->queue_texture_for_deletion(gptData->ptDevice, ptProbe->tBrdfLutTexture);
844844
gptGfx->queue_texture_for_deletion(gptData->ptDevice, ptProbe->tLambertianEnvTexture);
845845
gptGfx->queue_texture_for_deletion(gptData->ptDevice, ptProbe->tGGXEnvTexture);
846846
gptGfx->queue_texture_for_deletion(gptData->ptDevice, ptProbe->tAlbedoTexture);
@@ -2373,7 +2373,7 @@ pl_renderer_prepare_scene(plScene* ptScene)
23732373
.fRangeSqr = ptProbe->fRange * ptProbe->fRange,
23742374
.uGGXEnvSampler = ptScene->sbtProbeData[i].uGGXEnvSampler,
23752375
.uLambertianEnvSampler = ptScene->sbtProbeData[i].uLambertianEnvSampler,
2376-
.uGGXLUT = ptScene->sbtProbeData[i].uGGXLUT,
2376+
.tBrdfLutIndex = ptScene->sbtProbeData[i].tBrdfLutIndex,
23772377
.tMin.xyz = ptObject->tAABB.tMin,
23782378
.tMax.xyz = ptObject->tAABB.tMax,
23792379
.iParallaxCorrection = (int)(ptProbe->tFlags & PL_ENVIRONMENT_PROBE_FLAGS_PARALLAX_CORRECTION_BOX)

extensions/pl_renderer_internal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ pl__renderer_create_probe_data(plScene* ptScene, plEntity tProbeHandle)
27182718
.tType = PL_TEXTURE_TYPE_2D,
27192719
.tUsage = PL_TEXTURE_USAGE_SAMPLED
27202720
};
2721-
tProbeData.tGGXLUTTexture = pl__renderer_create_texture(&tLutTextureDesc, "lut texture", 0, PL_TEXTURE_USAGE_SAMPLED);
2721+
tProbeData.tBrdfLutTexture = pl__renderer_create_texture(&tLutTextureDesc, "lut texture", 0, PL_TEXTURE_USAGE_SAMPLED);
27222722

27232723
const plTextureDesc tSpecularTextureDesc = {
27242724
.tDimensions = {(float)ptProbe->uResolution, (float)ptProbe->uResolution, 1},
@@ -2740,7 +2740,7 @@ pl__renderer_create_probe_data(plScene* ptScene, plEntity tProbeHandle)
27402740
};
27412741
tProbeData.tGGXEnvTexture = pl__renderer_create_texture(&tTextureDesc, "tGGXEnvTexture", 0, PL_TEXTURE_USAGE_SAMPLED);
27422742

2743-
tProbeData.uGGXLUT = pl__renderer_get_bindless_texture_index(ptScene, tProbeData.tGGXLUTTexture);
2743+
tProbeData.tBrdfLutIndex = pl__renderer_get_bindless_texture_index(ptScene, tProbeData.tBrdfLutTexture);
27442744
tProbeData.uLambertianEnvSampler = pl__renderer_get_bindless_cube_texture_index(ptScene, tProbeData.tLambertianEnvTexture);
27452745
tProbeData.uGGXEnvSampler = pl__renderer_get_bindless_cube_texture_index(ptScene, tProbeData.tGGXEnvTexture);
27462746

@@ -3305,7 +3305,7 @@ pl__renderer_create_environment_map_from_texture(plScene* ptScene, plEnvironment
33053305
.szBufferOffset = 0,
33063306
.uBaseArrayLayer = 0,
33073307
};
3308-
gptGfx->copy_buffer_to_texture(ptBlitEncoder, ptScene->atFilterWorkingBuffers[6], ptProbe->tGGXLUTTexture, 1, &tBufferImageCopy0);
3308+
gptGfx->copy_buffer_to_texture(ptBlitEncoder, ptScene->atFilterWorkingBuffers[6], ptProbe->tBrdfLutTexture, 1, &tBufferImageCopy0);
33093309

33103310
for(uint32_t i = 0; i < 6; i++)
33113311
{

extensions/pl_renderer_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ typedef struct _plEnvironmentProbeData
258258
plDirectionLightShadowData tDirectionLightShadowData;
259259

260260
// textures
261-
plTextureHandle tGGXLUTTexture;
262-
uint32_t uGGXLUT;
261+
plTextureHandle tBrdfLutTexture;
262+
uint32_t tBrdfLutIndex;
263263
plTextureHandle tLambertianEnvTexture;
264264
uint32_t uLambertianEnvSampler;
265265
plTextureHandle tGGXEnvTexture;

shaders/brdf.glsl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ pl_masking_shadowing_ggx(float NdotL, float NdotV, float alphaRoughness)
4444
float
4545
pl_masking_shadowing_fast_ggx(float NdotL, float NdotV, float alphaRoughness)
4646
{
47-
float a2 = alphaRoughness * alphaRoughness;
48-
float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - a2) + a2);
49-
float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - a2) + a2);
47+
float a = alphaRoughness;
48+
float GGXV = NdotL * (NdotV * (1.0 - a) + a);
49+
float GGXL = NdotV * (NdotL * (1.0 - a) + a);
5050
float GGX = GGXV + GGXL;
5151
if (GGX > 0.0)
5252
{
@@ -59,22 +59,23 @@ pl_masking_shadowing_fast_ggx(float NdotL, float NdotV, float alphaRoughness)
5959
// Simple Lambertian BRDF (fd)
6060
// Real-Time Rendering 4th Edition, Page 314, Equation 9.11
6161
vec3
62-
pl_brdf_lambertian(vec3 diffuseColor)
62+
pl_brdf_diffuse(vec3 diffuseColor)
6363
{
64-
return diffuseColor / M_PI;
65-
6664
// disney
6765
// float Fd_Burley(float NoV, float NoL, float LoH, float roughness) {
6866
// float f90 = 0.5 + 2.0 * roughness * LoH * LoH;
6967
// float lightScatter = F_Schlick(NoL, 1.0, f90);
7068
// float viewScatter = F_Schlick(NoV, 1.0, f90);
7169
// return lightScatter * viewScatter * (1.0 / PI);
7270
// }
71+
72+
return diffuseColor / M_PI;
7373
}
7474

75-
// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#acknowledgments AppendixB
75+
// BRDF for specular (fs)
76+
// Real-Time Rendering 4th Edition, Page 337, Equation 9.34
7677
vec3
77-
BRDF_specularGGX(float alphaRoughness, float NdotL, float NdotV, float NdotH)
78+
pl_brdf_specular(float alphaRoughness, float NdotL, float NdotV, float NdotH)
7879
{
7980
float G2 = pl_masking_shadowing_ggx(NdotL, NdotV, alphaRoughness);
8081
float D = pl_distribution_ggx(NdotH, alphaRoughness);

shaders/deferred_lighting.frag

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ void main()
209209

210210
vec3 intensity = getLightIntensity(tLightData, pointToLight);
211211

212-
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_lambertian(tBaseColor.rgb);
212+
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_diffuse(tBaseColor.rgb);
213213
vec3 l_specular_dielectric = vec3(0.0);
214214
vec3 l_specular_metal = vec3(0.0);
215215
vec3 l_dielectric_brdf = vec3(0.0);
216216
vec3 l_metal_brdf = vec3(0.0);
217217

218-
l_specular_metal = shadow * intensity * NdotL * BRDF_specularGGX(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
218+
l_specular_metal = shadow * intensity * NdotL * pl_brdf_specular(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
219219
l_specular_dielectric = l_specular_metal;
220220

221221
l_metal_brdf = metal_fresnel * l_specular_metal;
@@ -274,13 +274,13 @@ void main()
274274

275275
vec3 intensity = getLightIntensity(tLightData, pointToLight);
276276

277-
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_lambertian(tBaseColor.rgb);
277+
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_diffuse(tBaseColor.rgb);
278278
vec3 l_specular_dielectric = vec3(0.0);
279279
vec3 l_specular_metal = vec3(0.0);
280280
vec3 l_dielectric_brdf = vec3(0.0);
281281
vec3 l_metal_brdf = vec3(0.0);
282282

283-
l_specular_metal = shadow * intensity * NdotL * BRDF_specularGGX(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
283+
l_specular_metal = shadow * intensity * NdotL * pl_brdf_specular(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
284284
l_specular_dielectric = l_specular_metal;
285285

286286
l_metal_brdf = metal_fresnel * l_specular_metal;
@@ -330,13 +330,13 @@ void main()
330330

331331
vec3 intensity = getLightIntensity(tLightData, pointToLight);
332332

333-
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_lambertian(tBaseColor.rgb);
333+
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_diffuse(tBaseColor.rgb);
334334
vec3 l_specular_dielectric = vec3(0.0);
335335
vec3 l_specular_metal = vec3(0.0);
336336
vec3 l_dielectric_brdf = vec3(0.0);
337337
vec3 l_metal_brdf = vec3(0.0);
338338

339-
l_specular_metal = shadow * intensity * NdotL * BRDF_specularGGX(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
339+
l_specular_metal = shadow * intensity * NdotL * pl_brdf_specular(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
340340
l_specular_dielectric = l_specular_metal;
341341

342342
l_metal_brdf = metal_fresnel * l_specular_metal;

shaders/filter_environment.comp

Lines changed: 2 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#extension GL_ARB_separate_shader_objects : enable
33

44
#include "math.glsl"
5+
#include "brdf.glsl"
56
#include "pl_shader_interop.h"
67
#include "pl_shader_interop_renderer.h"
78

@@ -18,7 +19,6 @@ layout(std140, set = 0, binding = 8) buffer _tBufferOut6{ vec4 atPixelData[]; }
1819
// enum
1920
const int cLambertian = 0;
2021
const int cGGX = 1;
21-
const int cCharlie = 2;
2222

2323
//-----------------------------------------------------------------------------
2424
// [SECTION] dynamic bind group
@@ -74,37 +74,6 @@ pl_write_face(int iPixel, int iFace, vec3 tColorIn)
7474
tFaceOut5.atPixelData[iPixel] = tColor;
7575
}
7676

77-
vec2
78-
pl_hammersley_2d(int i, int iN)
79-
{
80-
// Hammersley Points on the Hemisphere
81-
// CC BY 3.0 (Holger Dammertz)
82-
// http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
83-
// with adapted interface
84-
uint uBits = uint(i);
85-
uBits = (uBits << 16u) | (uBits >> 16u);
86-
uBits = ((uBits & 0x55555555u) << 1u) | ((uBits & 0xAAAAAAAAu) >> 1u);
87-
uBits = ((uBits & 0x33333333u) << 2u) | ((uBits & 0xCCCCCCCCu) >> 2u);
88-
uBits = ((uBits & 0x0F0F0F0Fu) << 4u) | ((uBits & 0xF0F0F0F0u) >> 4u);
89-
uBits = ((uBits & 0x00FF00FFu) << 8u) | ((uBits & 0xFF00FF00u) >> 8u);
90-
float rdi = float(uBits) * 2.3283064365386963e-10; // / 0x100000000
91-
92-
// hammersley2d describes a sequence of points in the 2d unit square [0,1)^2
93-
// that can be used for quasi Monte Carlo integration
94-
return vec2(float(i)/float(iN), rdi);
95-
}
96-
97-
float
98-
pl_random(vec2 co)
99-
{
100-
float a = 12.9898;
101-
float b = 78.233;
102-
float c = 43758.5453;
103-
float dt = dot(co.xy, vec2(a, b));
104-
float sn = mod(dt, 3.14);
105-
return fract(sin(sn) * c);
106-
}
107-
10877
mat3
10978
pl_generate_tbn(vec3 tNormal)
11079
{
@@ -179,35 +148,6 @@ pl_ggx(vec2 tXi, float fRoughness)
179148
return tGgx;
180149
}
181150

182-
float
183-
pl_d_charlie(float fSheenRoughness, float fNdotH)
184-
{
185-
fSheenRoughness = max(fSheenRoughness, 0.000001); //clamp (0,1]
186-
const float fInvR = 1.0 / fSheenRoughness;
187-
const float fCos2h = fNdotH * fNdotH;
188-
const float fSin2h = 1.0 - fCos2h;
189-
return (2.0 + fInvR) * pow(fSin2h, fInvR * 0.5) / (2.0 * PL_PI);
190-
}
191-
192-
MicrofacetDistributionSample
193-
pl_charlie(vec2 tXi, float fRoughness)
194-
{
195-
MicrofacetDistributionSample tCharlie;
196-
197-
const float fAlpha = fRoughness * fRoughness;
198-
tCharlie.sinTheta = pow(tXi.y, fAlpha / (2.0 * fAlpha + 1.0));
199-
tCharlie.cosTheta = sqrt(1.0 - tCharlie.sinTheta * tCharlie.sinTheta);
200-
tCharlie.phi = 2.0 * PL_PI * tXi.x;
201-
202-
// evaluate Charlie pdf (for half vector)
203-
tCharlie.pdf = pl_d_charlie(fAlpha, tCharlie.cosTheta);
204-
205-
// Apply the Jacobian to obtain a pdf that is parameterized by l
206-
tCharlie.pdf /= 4.0;
207-
208-
return tCharlie;
209-
}
210-
211151
MicrofacetDistributionSample
212152
pl_lambertian(vec2 tXi, float fRoughness)
213153
{
@@ -246,10 +186,6 @@ pl_get_importance_sample(int iSampleIndex, vec3 tN, float fRoughness)
246186
// https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.html
247187
tImportanceSample = pl_ggx(tXi, fRoughness);
248188
}
249-
else if(tDynamicData.tData.iDistribution == cCharlie)
250-
{
251-
tImportanceSample = pl_charlie(tXi, fRoughness);
252-
}
253189

254190
tImportanceSample.phi = tImportanceSample.phi + pl_random(tN.xz) * 0.1;
255191

@@ -327,26 +263,6 @@ pl_filter_color(vec3 tN)
327263

328264
tColor += tLambertian;
329265
}
330-
else if(tDynamicData.tData.iDistribution == cGGX || tDynamicData.tData.iDistribution == cCharlie)
331-
{
332-
// Note: reflect takes incident vector.
333-
const vec3 tV = tN;
334-
const vec3 tL = normalize(reflect(-tV, tH));
335-
const float fNdotL = dot(tN, tL);
336-
337-
if (fNdotL > 0.0)
338-
{
339-
if(tDynamicData.tData.fRoughness == 0.0)
340-
{
341-
// without this the roughness=0 lod is too high
342-
fLod = tDynamicData.tData.fLodBias;
343-
}
344-
vec3 sampleColor = textureLod(samplerCube(uCubeMap, tDefaultSampler), tL, fLod).rgb;
345-
// sampleColor = pl_linear_to_srgb(sampleColor);
346-
tColor += sampleColor * fNdotL;
347-
fWeight += fNdotL;
348-
}
349-
}
350266
}
351267

352268
if(fWeight != 0.0)
@@ -420,23 +336,12 @@ pl_lut(float fNdotV, float fRoughness)
420336
// Taken from: https://bruop.github.io/ibl
421337
// Shadertoy: https://www.shadertoy.com/view/3lXXDB
422338
// Terms besides V are from the GGX PDF we're dividing by.
423-
float fVPdf = pl_v_smith_ggx_correlated(fNdotV, fNdotL, fRoughness) * fVdotH * fNdotL / fNdotH;
339+
float fVPdf = pl_v_smith_ggx_correlated(fNdotL, fNdotV, fRoughness) * fVdotH * fNdotL / fNdotH;
424340
float fFc = pow(1.0 - fVdotH, 5.0);
425341
fA += (1.0 - fFc) * fVPdf;
426342
fB += fFc * fVPdf;
427343
fC += 0.0;
428344
}
429-
430-
if (tDynamicData.tData.iDistribution == cCharlie)
431-
{
432-
// LUT for Charlie distribution.
433-
float fSheenDistribution = pl_d_charlie(fRoughness, fNdotH);
434-
float fSheenVisibility = pl_v_ashikhmin(fNdotL, fNdotV);
435-
436-
fA += 0.0;
437-
fB += 0.0;
438-
fC += fSheenVisibility * fSheenDistribution * fNdotL * fVdotH;
439-
}
440345
}
441346
}
442347

shaders/forward.frag

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,13 @@ void main()
362362

363363
vec3 intensity = getLightIntensity(tLightData, pointToLight);
364364

365-
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_lambertian(tBaseColor.rgb);
365+
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_diffuse(tBaseColor.rgb);
366366
vec3 l_specular_dielectric = vec3(0.0);
367367
vec3 l_specular_metal = vec3(0.0);
368368
vec3 l_dielectric_brdf = vec3(0.0);
369369
vec3 l_metal_brdf = vec3(0.0);
370370

371-
l_specular_metal = shadow * intensity * NdotL * BRDF_specularGGX(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
371+
l_specular_metal = shadow * intensity * NdotL * pl_brdf_specular(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
372372
l_specular_dielectric = l_specular_metal;
373373

374374
l_metal_brdf = metal_fresnel * l_specular_metal;
@@ -431,13 +431,13 @@ void main()
431431

432432
vec3 intensity = getLightIntensity(tLightData, pointToLight);
433433

434-
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_lambertian(tBaseColor.rgb);
434+
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_diffuse(tBaseColor.rgb);
435435
vec3 l_specular_dielectric = vec3(0.0);
436436
vec3 l_specular_metal = vec3(0.0);
437437
vec3 l_dielectric_brdf = vec3(0.0);
438438
vec3 l_metal_brdf = vec3(0.0);
439439

440-
l_specular_metal = shadow * intensity * NdotL * BRDF_specularGGX(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
440+
l_specular_metal = shadow * intensity * NdotL * pl_brdf_specular(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
441441
l_specular_dielectric = l_specular_metal;
442442

443443
l_metal_brdf = metal_fresnel * l_specular_metal;
@@ -494,13 +494,13 @@ void main()
494494

495495
vec3 intensity = getLightIntensity(tLightData, pointToLight);
496496

497-
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_lambertian(tBaseColor.rgb);
497+
vec3 l_diffuse = shadow * intensity * NdotL * pl_brdf_diffuse(tBaseColor.rgb);
498498
vec3 l_specular_dielectric = vec3(0.0);
499499
vec3 l_specular_metal = vec3(0.0);
500500
vec3 l_dielectric_brdf = vec3(0.0);
501501
vec3 l_metal_brdf = vec3(0.0);
502502

503-
l_specular_metal = shadow * intensity * NdotL * BRDF_specularGGX(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
503+
l_specular_metal = shadow * intensity * NdotL * pl_brdf_specular(materialInfo.alphaRoughness, NdotL, NdotV, NdotH);
504504
l_specular_dielectric = l_specular_metal;
505505

506506
l_metal_brdf = metal_fresnel * l_specular_metal;

shaders/lighting.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ getIBLGGXFresnel(vec3 n, vec3 v, float roughness, vec3 F0, float specularWeight,
2323
// Roughness dependent fresnel, from Fdez-Aguera
2424
float NdotV = clampedDot(n, v);
2525
vec2 brdfSamplePoint = clamp(vec2(NdotV, roughness), vec2(0.0, 0.0), vec2(1.0, 1.0));
26-
vec2 f_ab = texture(sampler2D(at2DTextures[nonuniformEXT(tProbeData.atData[iProbeIndex].uGGXLUT)], tSamplerNearestRepeat), brdfSamplePoint).rg;
26+
vec2 f_ab = texture(sampler2D(at2DTextures[nonuniformEXT(tProbeData.atData[iProbeIndex].tBrdfLutIndex)], tSamplerNearestRepeat), brdfSamplePoint).rg;
2727
vec3 Fr = max(vec3(1.0 - roughness), F0) - F0;
2828
vec3 k_S = F0 + Fr * pow(1.0 - NdotV, 5.0);
2929
vec3 FssEss = specularWeight * (k_S * f_ab.x + f_ab.y);

shaders/math.glsl

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,41 @@ pl_saturate(float fV)
3838
}
3939

4040
float
41-
random(vec3 seed, int i)
41+
pl_random(vec3 seed, int i)
4242
{
4343
vec4 seed4 = vec4(seed, float(i));
4444
float dot_product = dot(seed4, vec4(12.9898,78.233,45.164,94.673));
4545
return fract(sin(dot_product) * 43758.5453);
4646
}
4747

48+
float
49+
pl_random(vec2 co)
50+
{
51+
float dt = dot(co.xy, vec2(12.9898, 78.233));
52+
float sn = mod(dt, 3.14);
53+
return fract(sin(sn) * 43758.5453);
54+
}
55+
56+
vec2
57+
pl_hammersley_2d(int i, int iN)
58+
{
59+
// Hammersley Points on the Hemisphere
60+
// CC BY 3.0 (Holger Dammertz)
61+
// http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
62+
// with adapted interface
63+
uint uBits = uint(i);
64+
uBits = (uBits << 16u) | (uBits >> 16u);
65+
uBits = ((uBits & 0x55555555u) << 1u) | ((uBits & 0xAAAAAAAAu) >> 1u);
66+
uBits = ((uBits & 0x33333333u) << 2u) | ((uBits & 0xCCCCCCCCu) >> 2u);
67+
uBits = ((uBits & 0x0F0F0F0Fu) << 4u) | ((uBits & 0xF0F0F0F0u) >> 4u);
68+
uBits = ((uBits & 0x00FF00FFu) << 8u) | ((uBits & 0xFF00FF00u) >> 8u);
69+
float rdi = float(uBits) * 2.3283064365386963e-10; // / 0x100000000
70+
71+
// hammersley2d describes a sequence of points in the 2d unit square [0,1)^2
72+
// that can be used for quasi Monte Carlo integration
73+
return vec2(float(i)/float(iN), rdi);
74+
}
75+
4876
vec2
4977
OctWrap( vec2 v )
5078
{

0 commit comments

Comments
 (0)