-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRT_TaskRenderTile.h
More file actions
48 lines (35 loc) · 1.05 KB
/
RT_TaskRenderTile.h
File metadata and controls
48 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef _RT_TASKRENDERTILE_H
#define _RT_TASKRENDERTILE_H
#include <math.h>
#include <stdio.h>
#include "CVector2i.h"
#include "CVector3.h"
#include "Engine.h"
#include "RT_Task.h"
#include "RT_FrameBuffer.h"
#include "RT_Camera.h"
#include "RT_RayQuery.h"
#include "EmbreeStuff.h"
using namespace std;
class RT_TaskRenderTile : public RT_Task {
public:
RT_TaskRenderTile(CVector2i* startPixel_, RT_Camera* camera_, RT_FrameBuffer* frameBuffer_, int tileNumber_);
~RT_TaskRenderTile(){};
void run();
private:
CVector2i startPixel;
RT_Camera* camera;
RT_FrameBuffer* frameBuffer;
int tileNumber;
unsigned char* fBuffer;
int sizeX;
int sizeXtimes4;
finline void putColorInFrameBuffer(int x, int y, CVector3* color){
Assert(color, "putColorInFrameBuffer");
const int offset = x * 4 + y * sizeXtimes4;
fBuffer[offset] = color->x * 255.0f;
fBuffer[offset + 1] = color->y * 255.0f;
fBuffer[offset + 2] = color->z * 255.0f;
}
};
#endif