Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Trofimm committed Aug 8, 2019
1 parent 0e7478c commit 44a2269
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hydra_app/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
9 changes: 6 additions & 3 deletions hydra_drv/clight.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down

0 comments on commit 44a2269

Please sign in to comment.