Ejemplo n.º 1
0
	virtual int get_more_samples(Sample *sample, RNG &rng) override {
		//const int w = x_pixel_end - x_pixel_start;
		//const int h = y_pixel_end - y_pixel_start;
		if (sample_pos == samples_per_pixel) { // to next pixel
			if (++x_pos == x_pixel_end) {	// -> next line
				x_pos = x_pixel_start;
				++y_pos;
			}
			if (y_pos == y_pixel_end)	// all samples in all pixels has been generate
				return 0;
			sample_pos = 0;
		}

		sample->image_x = x_pos + rng.random_float();
		sample->image_y = y_pos + rng.random_float();
		++sample_pos;
		return 1;
	}