Page 1 of 1

very small cleanups in Luxcore code

Posted: Mon Apr 30, 2018 7:40 am
by Luxart
Hi Dade,

As I already mentioned in another thread viewtopic.php?f=4&t=142

very small cleanups in Luxcore code.

1, In GetOpenCLBSDFSize() function

Code: Select all

	// Add BSDF.isShadowCatcher

		bsdfSize += sizeof(int);
is not needed as we are only using materials - isShadowCatcher


2, In Material_Bump function.

Code: Select all

"	float3 shadeN = VLOAD3F(&hitPoint->shadeN.x);\n"
"\n"
"		shadeN = Texture_Bump(mats[matIndex].bumpTexIndex, hitPoint, mats[matIndex].bumpSampleDistance\n"
"			TEXTURES_PARAM);\n"
"\n"
The ShadeN is assigned two times. First line can be removed (with type declaration float3 moved to second line).

3, In DirectLight_BSDFSampling() function, cosThetaToLight is calculated, but never used.

Code: Select all

"	const float cosThetaToLight = fabs(dot(lightRayDir, VLOAD3F(&bsdf->hitPoint.shadeN.x)));\n"
may be previous Luxrender versions used it.

You might have missed to comment or delete these lines ;) .
All the above lines are not a big deal, but just thought of mentioning it.

Yes strictly from next time I will use github requests to make these changes :) .

Re: very small cleanups in Luxcore code

Posted: Mon Apr 30, 2018 9:37 am
by Dade
Thanks, I pushed the code on the denoiser branch so it will be merged with the main branch after the v2.0 release: https://github.com/LuxCoreRender/LuxCor ... 6fe4495a56