Skip to content

Commit

Permalink
Merge pull request #59 from owl-project/development
Browse files Browse the repository at this point in the history
Fixed some bugs with solid color dome light
  • Loading branch information
natevm authored Aug 27, 2020
2 parents f98f5ea + 8765286 commit 7b8fa8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/visii/devicecode/path_tracer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ float3 missColor(const float3 dir)
return make_float3(texColor);
}

if (glm::any(glm::greaterThan(optixLaunchParams.domeLightColor, glm::vec3(0.f)))) return make_float3(optixLaunchParams.domeLightColor);
if (glm::any(glm::greaterThanEqual(optixLaunchParams.domeLightColor, glm::vec3(0.f)))) return make_float3(optixLaunchParams.domeLightColor);

float t = 0.5f*(rayDir.z + 1.0f);
float3 c = (1.0f - t) * make_float3(pow(vec3(1.0f), vec3(2.2f))) + t * make_float3( pow(vec3(0.5f, 0.7f, 1.0f), vec3(2.2f)) );
Expand Down
14 changes: 11 additions & 3 deletions src/visii/visii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@ void initializeOptix(bool headless)
));

OD.placeholder = owlDeviceBufferCreate(OD.context, OWL_USER_TYPE(void*), 1, nullptr);

setDomeLightSky(glm::vec3(0,0,10));
}

void initializeImgui()
Expand Down Expand Up @@ -782,6 +784,7 @@ void setDomeLightIntensity(float intensity)

void setDomeLightColor(vec3 color)
{
clearDomeLightTexture();
color.r = glm::max(0.f, glm::min(color.r, 1.f));
color.g = glm::max(0.f, glm::min(color.g, 1.f));
color.b = glm::max(0.f, glm::min(color.b, 1.f));
Expand All @@ -803,7 +806,8 @@ void clearDomeLightTexture()

resetAccumulation();
auto future = enqueueCommand(func);
future.wait();
if (ViSII.render_thread_id != std::this_thread::get_id())
future.wait();
}

void generateDomeCDF()
Expand Down Expand Up @@ -898,7 +902,8 @@ void setDomeLightSky(vec3 sunPos, vec3 skyTint, float atmosphereThickness)
resetAccumulation();
};
auto future = enqueueCommand(func);
future.wait();
if (ViSII.render_thread_id != std::this_thread::get_id())
future.wait();
}

void setDomeLightTexture(Texture* texture)
Expand Down Expand Up @@ -953,7 +958,8 @@ void setDomeLightTexture(Texture* texture)
resetAccumulation();
};
auto future = enqueueCommand(func);
future.wait();
if (ViSII.render_thread_id != std::this_thread::get_id())
future.wait();
}

void setDomeLightRotation(glm::quat rotation)
Expand Down Expand Up @@ -1246,6 +1252,8 @@ void updateComponents()
OptixData.LP.viewT0 = transform.getWorldToLocalMatrix(/*previous = */ true);
OptixData.LP.viewT1 = transform.getWorldToLocalMatrix(/*previous = */ false);
}


}

void updateLaunchParams()
Expand Down

0 comments on commit 7b8fa8a

Please sign in to comment.