I’m modifying the tutorial sample
Optix Prime 3.8
Windows 7 Enterprise
Visual Studio 2012
CUDA 7.0
I’ve modified the perRayData Struct in order to claculate additional data.
struct PerRayData_radiance
{
float3 result;
float doppler;
float runtime;
float amplitude;
float importance;
int depth;
}
My Problem:
The result for the calculation of the doppler in the closest hit program differed from what was written to file from the Buffer.
In order to find the error I saved the current launch_index instead of runtime and amplitude.
When i Use
RT_PROGRAM void closest_hit_radiance2()
.....
.....
float2 d = make_float2(launch_index);
prd_radiance.doppler = dopplerfrequency;
prd_radiance.runtime = d.x;
prd_radiance.amplitude = d.y;
printf("Dopp %.2f L_indx %.2f L_indy %.2f\n", prd_radiance.doppler, prd_radiance.amplitude, prd_radiance.importance);
And save the connected Buffer with:
float4 element = result_buffer_data[y*result_buffer_height + x];
file << std::to_string(element.x) << ", " << std::to_string(element.y) << ", " << std::to_string(element.z) << ", " << std::to_string(element.w) << ", " << std::to_string(x) << ", " << std::to_string(y) << " \n ";
My Command Line Output and my File Output do not match up on a number of Differences:
[Picture Size: width = 5u, height = 3u]
Bild “gpu_output3csod.png” anzeigen.
[img=http://abload.de/thumb/gpu_output3csod.png]
0.000000, 0.000000, 0.000000, 21346.941406, 0, 0
1.000000, 0.000000, 0.000000, 21373.595703, 1, 0
2.000000, 0.000000, 0.000000, 21386.957031, 2, 0
3.000000, 0.000000, 0.000000, 21386.957031, 3, 0
4.000000, 0.000000, 0.000000, 21373.595703, 4, 0
3.000000, 0.000000, 0.000000, 21386.957031, 0, 1
4.000000, 0.000000, 0.000000, 21373.595703, 1, 1
0.000000, 1.000000, 1.000000, 21360.255859, 2, 1
1.000000, 1.000000, 1.000000, 21386.957031, 3, 1
2.000000, 1.000000, 1.000000, 21400.345703, 4, 1
1.000000, 1.000000, 1.000000, 21386.957031, 0, 2
2.000000, 1.000000, 1.000000, 21400.345703, 1, 2
3.000000, 1.000000, 1.000000, 21400.345703, 2, 2
4.000000, 1.000000, 1.000000, 21386.957031, 3, 2
0.000000, 2.000000, 2.000000, 21360.255859, 4, 2
Difference 1: Launch index y is not divided evenly anymore but is smaller…
Difference 2: The values of the Dopplerfrequency which are the same for the same distances between source and object hava a different distribution,
The direct output has four 21400.34570, the saved file has three 21400.34570.
I do not modify launch_index or any other part of the buffer at any other place.
where can this difference come from?
Thank you very much for your input,
lg Mike