104 core::vector2di m_uvMin;
105 core::vector2di m_uvMax;
107 core::vector2df m_uvf[3];
109 core::vector3df m_position[3];
110 core::vector2df m_uv[3];
111 core::vector3df m_normal[3];
112 core::vector3df m_tangent[3];
114 core::array<SBakePixel> m_bakePixels;
116 ERasterPass m_currentPass;
118 unsigned char *m_lightmapData;
119 unsigned char *m_testBakedData;
121 float m_interpolationThreshold;
124 core::vector3df sampleVector3(
const core::vector3df* p,
const core::vector2df& uv);
127 CRasterisation(
int width,
int height);
129 virtual ~CRasterisation();
133 int getPixelStep(ERasterPass pass);
135 int getPassOffsetX(ERasterPass pass);
137 int getPassOffsetY(ERasterPass pass);
139 bool isInterpolateX(ERasterPass pass);
141 bool isInterpolateY(ERasterPass pass);
143 core::vector2di setTriangle(
144 const core::vector3df *position,
145 const core::vector2df *uv,
146 const core::vector3df *normal,
147 const core::vector3df *tangent,
150 bool samplingTrianglePosition(
151 core::vector3df& outPosition,
152 core::vector3df& outNormal,
153 core::vector3df& outTangent,
154 core::vector3df& outBinormal,
155 core::vector2di& lmPixel);
159 bool moveNextPixel(core::vector2di& lmPixel);
161 bool isFinished(
const core::vector2di& lmPixel);
163 inline void setInterpolationThreshold(
float f)
165 m_interpolationThreshold = f;
168 inline int getWidth()
173 inline int getHeight()
178 unsigned char* getTestBakeImage()
180 return m_testBakedData;
183 unsigned char* getLightmapData()
185 return m_lightmapData;
188 bool tryInterpolate(
int x,
int y);
190 void getLightmapPixel(
int x,
int y,
float *color);
192 bool isBaked(
int x,
int y);
194 core::array<SBakePixel>& getBakePixelQueue()
199 void flushPixel(std::vector<CSH9>& bakeResults);