@ Dade...thx for helping out....
Here´s the result:
Jens
Moderators: Dade, jromang, tomb, coordinators
jensverwiebe wrote:@ Dade...thx for helping out....
Here´s the result:
#include "camera.h"
#include "geomfunc.h"
__kernel void RadianceGPU(
__global Vec *colors, __global unsigned int *seedsInput,
__constant Sphere *sphere, __constant Camera *camera,
const unsigned int sphereCount,
const int width, const int height,
const int currentSample,
__global int *pixels,
const unsigned int renderingFlags) {
const int gid = get_global_id(0);
const int x = gid % width;
const int y = gid / width;
/* Check if we have to do something */
if (y >= height)
return;
Vec r;
vinit(r, 0.001f, 0.001f, 0.001f);
const int i = (height - y - 1) * width + x;
if (currentSample == 0) {
// Jens's patch for MacOS
vinit(colors[i], 0.f, 0.f, 0.f);
} else {
vadd(colors[i], colors[i], r);
if (colors[i].x > 1.f) {
vclr(colors[i]);
}
}
pixels[y * width + x] = toInt(colors[i].x) |
(toInt(colors[i].y) << 8) |
(toInt(colors[i].z) << 16);
}
/* LordCRC: move seed to local store */
unsigned int seed0 = seedsInput[gid2];
unsigned int seed1 = seedsInput[gid2 + 1];
jensverwiebe wrote:@ Dade
With this kernel the render started uniform black and got brighter and brighter until it was pure white, then resetting to black and start over.....
i compared both cpu and gpu-mode, same behaviour.
Right this way?
Jens, if you go back to the 1.6alpha and you try to resize the window, what does happen ? ... it could start to work
jensverwiebe wrote:Jens, if you go back to the 1.6alpha and you try to resize the window, what does happen ? ... it could start to work
Dade my Dade...unfortunately not.
I started with different initial sizesand rezided, but only got some patterned distortions in some resizings, no correct renderoutput.
jensverwiebe wrote:Keep in mind i got with cpu 1500k for cornell and 9000k for simple, but 75000k for cornell and simple in gpu mode, sounds not realistic to me, cornell should do around 12000k, no ?
.... please not now, we can do that later, much much later..you could just be in the middle of nowhere looking to nothing
jensverwiebe wrote:At start the pattern shows up for a short time and disappers, but shows up again on every resize.
#define GPU_KERNEL
#include "camera.h"
#include "geomfunc.h"
__kernel void RadianceGPU(
__global Vec *colors, __global unsigned int *seedsInput,
__constant Sphere *sphere, __constant Camera *camera,
const unsigned int sphereCount,
const int width, const int height,
const int currentSample,
__global int *pixels,
const unsigned int renderingFlags) {
const int gid = get_global_id(0);
const int x = gid % width;
const int y = gid / width;
/* Check if we have to do something */
if (y >= height)
return;
int cameraOK = 1;
if ((camera->orig.x != 50.f) ||
(camera->orig.y != 45.f) ||
(camera->orig.z != 205.6f) ||
(camera->target.x != 50.f) ||
(camera->target.y != 44.957388f) ||
(camera->target.z != 204.6f))
cameraOK = 0;
int sceneOK = 1;
if ((sphere[0].rad != 10000.f) || (sphere[1].rad != 10000.f) ||
(sphere[0].p.x != 10001.f))
sceneOK = 0;
int col = 0;
if (cameraOK && sceneOK)
col = 0x00ff00;
else if (!cameraOK && sceneOK)
col = 0xff0000;
else if (cameraOK && !sceneOK)
col = 0x0000ff;
else if (!cameraOK && !sceneOK)
col = 0xff00ff;
pixels[y * width + x] = col;
}
Users browsing this forum: No registered users and 2 guests