Update krov_engine_main.cu
This commit is contained in:
parent
f51d81ad6d
commit
d8b69f01c8
@ -21,6 +21,7 @@
|
||||
#include <curand_kernel.h>
|
||||
#include "cudamathOld.cuh"
|
||||
#include <thrust/device_vector.h>
|
||||
#include "OpenImageDenoise/oidn.hpp"
|
||||
#define RESOLUTION 512
|
||||
#define ALLOC_MEM_TRIS_NUM 800
|
||||
__host__ __device__ struct Triangle
|
||||
@ -355,6 +356,9 @@ void main()
|
||||
float cameraDist = 4.0f;
|
||||
float depth_UNDERCOVER = 1.0f;
|
||||
int depth = 1.0f;
|
||||
oidn::DeviceRef device = oidn::newDevice();
|
||||
device.commit();
|
||||
oidn::FilterRef filter = device.newFilter("RT"); // generic ray tracing filter
|
||||
while (true)
|
||||
{
|
||||
frameCount++;
|
||||
@ -440,6 +444,17 @@ void main()
|
||||
}
|
||||
mesh.triangles = oldTris;
|
||||
std::cout << (clock() - s) / CLOCKS_PER_SEC << std::endl;
|
||||
|
||||
|
||||
// Create a denoising filter
|
||||
if (depth_UNDERCOVER > 4.0f)
|
||||
{
|
||||
canvas.convertTo(canvas, CV_32FC3);
|
||||
filter.setImage("color", canvas.data, oidn::Format::Float3, RESOLUTION, RESOLUTION);
|
||||
filter.setImage("output", canvas.data, oidn::Format::Float3, RESOLUTION, RESOLUTION);
|
||||
filter.commit();
|
||||
filter.execute();
|
||||
}
|
||||
cv::imshow("Output", canvas);
|
||||
cv::setMouseCallback("Output", mouseCallback);
|
||||
cv::waitKey(1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user