diff --git a/hydra_app/input.cpp b/hydra_app/input.cpp index 0f70f9c..7c8d949 100644 --- a/hydra_app/input.cpp +++ b/hydra_app/input.cpp @@ -16,9 +16,9 @@ Input::Input() //inLibraryPath = "tests/test_224_sphere"; //inLibraryPath = "tests/test_224_sphere_microfacet"; //inLibraryPath = "tests/test_pool"; - //inLibraryPath = "/home/frol/PROG/CLSP_gitlab/database/temp"; + //inLibraryPath = "C:/[Hydra]/pluginFiles/scenelib/"; - inDevelopment = true; ///< recompile shaders each time; note that nvidia have their own shader cache! + inDevelopment = false; ///< recompile shaders each time; note that nvidia have their own shader cache! inDeviceId = 0; ///< opencl device id cpuFB = true; ///< store frame buffer on CPU. Automaticly enabled if enableMLT = false; ///< if use MMLT, you MUST enable it early, when render process just started (here or via command line). diff --git a/hydra_drv/clight.h b/hydra_drv/clight.h index f8b17c2..b5e1d4b 100644 --- a/hydra_drv/clight.h +++ b/hydra_drv/clight.h @@ -306,11 +306,14 @@ static inline float3 skyLightGetIntensityTexturedENV(__global const PlainLight* return envColor*texColor; } -static inline float evalMap2DPdf(const float2 texCoordT, __global const float* intervals, const int sizeX, const int sizeY) +static inline float evalMap2DPdf(float2 texCoordT, __global const float* intervals, const int sizeX, const int sizeY) { const float fw = (float)sizeX; const float fh = (float)sizeY; + if (texCoordT.x < 0.0f || texCoordT.x > 1.0f) texCoordT.x -= (float)((int)(texCoordT.x)); + if (texCoordT.y < 0.0f || texCoordT.x > 1.0f) texCoordT.y -= (float)((int)(texCoordT.y)); + int pixelX = (int)(fw*texCoordT.x - 0.5f); int pixelY = (int)(fh*texCoordT.y - 0.5f); @@ -320,8 +323,8 @@ static inline float evalMap2DPdf(const float2 texCoordT, __global const float* i if (pixelX < 0) pixelX += sizeX; if (pixelY < 0) pixelY += sizeY; - if (pixelX < 0 || pixelY < 0) - return 1.0f; + //if (pixelX < 0 || pixelY < 0) + //return 1.0f; const int pixelOffset = pixelY*sizeX + pixelX; const int maxSize = sizeX*sizeY;