Skip to content

Commit

Permalink
Some changes related to issue #61
Browse files Browse the repository at this point in the history
  • Loading branch information
knightcrawler25 committed Dec 30, 2021
1 parent 39a66c3 commit 9ba3bd3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void SaveFrame(const std::string filename)
stbi_flip_vertically_on_write(true);
stbi_write_png(filename.c_str(), w, h, 4, data, w * 4);
printf("Frame saved: %s\n", filename.c_str());
delete data;
delete[] data;
}

void Render()
Expand Down
4 changes: 3 additions & 1 deletion src/core/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace GLSLPT
else
{
printf("Unable to load model %s\n", filename.c_str());
delete mesh;
id = -1;
}
return id;
Expand All @@ -97,6 +98,7 @@ namespace GLSLPT
else
{
printf("Unable to load texture %s\n", filename.c_str());
delete texture;
id = -1;
}

Expand Down Expand Up @@ -282,7 +284,7 @@ namespace GLSLPT
unsigned char* resizedTex = new unsigned char[reqWidth * reqHeight * 4];
stbir_resize_uint8(&textures[i]->texData[0], texWidth, texHeight, 0, resizedTex, reqWidth, reqHeight, 0, 4);
textureMapsArray.insert(textureMapsArray.end(), resizedTex, resizedTex + (reqWidth * reqHeight * 4));
delete resizedTex;
delete[] resizedTex;
}
else
textureMapsArray.insert(textureMapsArray.end(), textures[i]->texData.begin(), textures[i]->texData.end());
Expand Down
4 changes: 2 additions & 2 deletions src/core/TiledRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ namespace GLSLPT
delete outputShader;
delete tonemapShader;

delete denoiserInputFramePtr;
delete frameOutputPtr;
delete[] denoiserInputFramePtr;
delete[] frameOutputPtr;

Renderer::Finish();
}
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/common/anyhit.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
bool AnyHit(Ray r, float maxDist)
{

#ifdef LIGHTS
#ifdef OPT_LIGHTS
// Intersect Emitters
for (int i = 0; i < numOfLights; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/common/pathtrace.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void GetMaterials(inout State state, in Ray r)
{
vec3 texNormal = texture(textureMapsArrayTex, vec3(state.texCoord, texIDs.z)).rgb;

#ifdef OPENGL_NORMALMAP
#ifdef OPT_OPENGL_NORMALMAP
texNormal.y = 1.0 - texNormal.y;
#endif
texNormal = normalize(texNormal * 2.0 - 1.0);
Expand Down
1 change: 0 additions & 1 deletion src/shaders/common/uniforms.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/

uniform bool isCameraMoving;
uniform bool useEnvMap;
uniform vec3 randomVector;
uniform vec2 screenResolution;
uniform float hdrTexSize;
Expand Down

0 comments on commit 9ba3bd3

Please sign in to comment.