Skip to content

Commit bcb7419

Browse files
Revert the test stuff.
1 parent 7e74551 commit bcb7419

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

examples_tests/42.FragmentShaderPathTracer/common.glsl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// basic settings
2-
#define MAX_DEPTH 2
3-
#define SAMPLES 512
2+
#define MAX_DEPTH 8
3+
#define SAMPLES 16
44

55
// firefly and variance reduction techniques
66
//#define KILL_DIFFUSE_SPECULAR_PATHS
@@ -177,7 +177,6 @@ mat2x3 BSDFNode_getEta(in BSDFNode node)
177177

178178
float BSDFNode_getMISWeight(in BSDFNode bsdf)
179179
{
180-
return 0.5;
181180
const float alpha = BSDFNode_getRoughness(bsdf);
182181
const bool notDiffuse = BSDFNode_isNotDiffuse(bsdf);
183182
const float DIFFUSE_MIS_WEIGHT = 0.5;
@@ -312,7 +311,7 @@ void missProgram()
312311
vec2 uv = SampleSphericalMap(rayStack[stackPtr]._immutable.direction);
313312
finalContribution *= textureLod(envMap, uv, 0.0).rgb;
314313
#else
315-
const vec3 kConstantEnvLightRadiance = vec3(0.0);// 0.15, 0.21, 0.3);
314+
const vec3 kConstantEnvLightRadiance = vec3(0.15, 0.21, 0.3);
316315
finalContribution *= kConstantEnvLightRadiance;
317316
#endif
318317
}

examples_tests/42.FragmentShaderPathTracer/litByTriangle.frag

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ Sphere spheres[SPHERE_COUNT] = {
1717
};
1818
#define TRIANGLE_COUNT 1
1919
Triangle triangles[TRIANGLE_COUNT] = {
20-
//Triangle_Triangle(mat3(vec3(-1.8,0.35,0.3),vec3(-1.2,0.35,0.0),vec3(-1.5,0.8,-0.3)),INVALID_ID_16BIT,0u)
21-
Triangle_Triangle(mat3(vec3(-4,0.7,-4),vec3(0.0,0.7,0.0),vec3(-4.0,0.8,4.0)),INVALID_ID_16BIT,0u)
20+
Triangle_Triangle(mat3(vec3(-1.8,0.35,0.3),vec3(-1.2,0.35,0.0),vec3(-1.5,0.8,-0.3)),INVALID_ID_16BIT,0u)
2221
};
2322

2423

2524
#define LIGHT_COUNT 1
2625
Light lights[LIGHT_COUNT] = {
27-
//{vec3(30.0,25.0,15.0),0u}
28-
{vec3(30.0,25.0,15.0)*0.01,0u}
26+
{vec3(30.0,25.0,15.0),0u}
2927
};
3028

3129

@@ -285,13 +283,13 @@ float irr_glsl_sampling_probProjectedSphericalTriangleSample(in mat3 sphericalVe
285283

286284
// the interaction here is the interaction at the illuminator-end of the ray, not the receiver
287285
vec3 irr_glsl_light_deferred_eval_and_prob(
288-
out float pdf, in Light light, in vec3 L,
286+
out float pdf, in Light light, in vec3 L
289287
#if TRIANGLE_METHOD==0
290-
in float intersectionT,
288+
,in float intersectionT
291289
#else
292-
in vec3 origin,
290+
,in vec3 origin
293291
#if TRIANGLE_METHOD==2
294-
in vec3 normalAtOrigin, in bool wasBSDFAtOrigin
292+
,in vec3 normalAtOrigin, in bool wasBSDFAtOrigin
295293
#endif
296294
#endif
297295
)
@@ -404,13 +402,13 @@ void closestHitProgram(in ImmutableRay_t _immutable, inout irr_glsl_xoroshiro64s
404402
{
405403
float lightPdf;
406404
vec3 lightVal = irr_glsl_light_deferred_eval_and_prob(
407-
lightPdf,lights[lightID],_immutable.direction,
405+
lightPdf,lights[lightID],_immutable.direction
408406
#if TRIANGLE_METHOD==0
409-
mutable.intersectionT,
407+
,mutable.intersectionT
410408
#else
411-
_immutable.origin,
409+
,_immutable.origin
412410
#if TRIANGLE_METHOD==2
413-
_immutable.normalAtOrigin,_immutable.wasBSDFAtOrigin
411+
,_immutable.normalAtOrigin,_immutable.wasBSDFAtOrigin
414412
#endif
415413
#endif
416414
);

0 commit comments

Comments
 (0)