[2954] | 1 | #include "SkyPreetham.h"
|
---|
[2955] | 2 | #include "common.h"
|
---|
| 3 | #include "Vector3.h"
|
---|
[2957] | 4 | #include "SceneEntity.h"
|
---|
| 5 | #include "Transform3.h"
|
---|
| 6 | #include "Camera.h"
|
---|
| 7 | #include "RenderState.h"
|
---|
[3036] | 8 | #include "ShaderProgram.h"
|
---|
| 9 | #include "Shape.h"
|
---|
| 10 | #include "Material.h"
|
---|
[2955] | 11 |
|
---|
[3021] | 12 |
|
---|
| 13 | #ifdef _CRT_SET
|
---|
| 14 | #define _CRTDBG_MAP_ALLOC
|
---|
| 15 | #include <stdlib.h>
|
---|
| 16 | #include <crtdbg.h>
|
---|
| 17 |
|
---|
| 18 | // redefine new operator
|
---|
| 19 | #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
|
---|
| 20 | #define new DEBUG_NEW
|
---|
| 21 | #endif
|
---|
| 22 |
|
---|
| 23 |
|
---|
[2957] | 24 | using namespace CHCDemoEngine;
|
---|
| 25 | using namespace std;
|
---|
[2955] | 26 |
|
---|
[2954] | 27 |
|
---|
[3036] | 28 | static ShaderProgram *sCgSkyProgram = NULL;
|
---|
| 29 | static ShaderProgram *sCgMrtFragmentSkyDomeProgram = NULL;
|
---|
[2959] | 30 |
|
---|
[3021] | 31 | ShaderContainer SkyPreetham::sShaders;
|
---|
[2957] | 32 |
|
---|
[2982] | 33 |
|
---|
[2955] | 34 | inline float CBQ(float x)
|
---|
| 35 | {
|
---|
| 36 | return x * x * x;
|
---|
| 37 | }
|
---|
[2954] | 38 |
|
---|
| 39 |
|
---|
[2955] | 40 | inline float SQR(float x)
|
---|
| 41 | {
|
---|
| 42 | return x * x ;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 |
|
---|
[3021] | 46 | void SkyPreetham::InitCG(CGcontext context)
|
---|
[2957] | 47 | {
|
---|
[3036] | 48 | sCgSkyProgram = new ShaderProgram(context,
|
---|
| 49 | "src/shaders/sky_preetham.cg",
|
---|
| 50 | RenderState::sCgVertexProfile,
|
---|
| 51 | "default_vs");
|
---|
[3021] | 52 |
|
---|
[3036] | 53 | if (sCgSkyProgram->IsValid())
|
---|
[2957] | 54 | {
|
---|
[3036] | 55 | sCgSkyProgram->AddParameter("lightDir", 0);
|
---|
| 56 | sCgSkyProgram->AddParameter("thetaSun", 1);
|
---|
| 57 | sCgSkyProgram->AddParameter("zenithColor", 2);
|
---|
| 58 | sCgSkyProgram->AddParameter("aColor", 3);
|
---|
| 59 | sCgSkyProgram->AddParameter("bColor", 4);
|
---|
| 60 | sCgSkyProgram->AddParameter("cColor", 5);
|
---|
| 61 | sCgSkyProgram->AddParameter("dColor", 6);
|
---|
| 62 | sCgSkyProgram->AddParameter("eColor", 7);
|
---|
| 63 | sCgSkyProgram->AddParameter("multiplier", 8);
|
---|
[2957] | 64 | }
|
---|
| 65 | else
|
---|
| 66 | cerr << "sky program failed to load" << endl;
|
---|
[2959] | 67 |
|
---|
[3036] | 68 | sShaders.push_back(sCgSkyProgram);
|
---|
| 69 |
|
---|
[2959] | 70 | sCgMrtFragmentSkyDomeProgram =
|
---|
[3036] | 71 | new ShaderProgram(context,
|
---|
| 72 | "src/shaders/sky_preetham.cg",
|
---|
| 73 | RenderState::sCgFragmentProfile,
|
---|
| 74 | "frag_skydome");
|
---|
[2959] | 75 |
|
---|
[3036] | 76 | // simple shader used for just pushing out the fragments to the mrts
|
---|
| 77 | if (!sCgMrtFragmentSkyDomeProgram->IsValid())
|
---|
[2959] | 78 | cerr << "fragment skyprogram failed to load" << endl;
|
---|
[3036] | 79 |
|
---|
| 80 | sShaders.push_back(sCgMrtFragmentSkyDomeProgram);
|
---|
[2957] | 81 | }
|
---|
| 82 |
|
---|
| 83 |
|
---|
[3021] | 84 | void SkyPreetham::ReleaseCG()
|
---|
| 85 | {
|
---|
| 86 | CLEAR_CONTAINER(sShaders);
|
---|
| 87 | }
|
---|
| 88 |
|
---|
| 89 |
|
---|
[2957] | 90 | SkyPreetham::SkyPreetham(float turbitity, SceneEntity *skyDome):
|
---|
| 91 | mSkyDome(skyDome),
|
---|
| 92 | mTurbidity(turbitity)
|
---|
[2981] | 93 | //, mSunQuad(NULL)
|
---|
[2954] | 94 | {
|
---|
[2955] | 95 | CreateSunQuad();
|
---|
[3036] | 96 | Shape *shape = mSkyDome->GetShape(0);
|
---|
| 97 |
|
---|
| 98 | Material *mat = shape->GetMaterial();
|
---|
| 99 |
|
---|
| 100 | mat->SetFragmentProgram(sCgMrtFragmentSkyDomeProgram);
|
---|
| 101 | mat->SetVertexProgram(sCgSkyProgram);
|
---|
[2954] | 102 | }
|
---|
| 103 |
|
---|
| 104 |
|
---|
| 105 | SkyPreetham::~SkyPreetham()
|
---|
| 106 | {
|
---|
[2955] | 107 | //DEL_PTR(mSunQuad);
|
---|
[2954] | 108 | }
|
---|
| 109 |
|
---|
| 110 |
|
---|
[2983] | 111 | void SkyPreetham::RenderSkyDome(const Vector3 &sunDir,
|
---|
| 112 | Camera *camera,
|
---|
| 113 | RenderState *state,
|
---|
| 114 | bool scaleToRange)
|
---|
[2954] | 115 | {
|
---|
[2960] | 116 | pair<float, float> sun_theta;
|
---|
[2955] | 117 | Vector3 zenithColor;
|
---|
[2960] | 118 | vector<Vector3> ABCDE;
|
---|
[3036] | 119 |
|
---|
[2960] | 120 | ComputeFactors(sunDir, zenithColor, ABCDE, sun_theta);
|
---|
[2954] | 121 |
|
---|
| 122 | // Move skybox with camera.
|
---|
[2957] | 123 | Vector3 position = camera->GetPosition();
|
---|
[2954] | 124 |
|
---|
[2959] | 125 | const float scaleFactor = 80.0f;
|
---|
[2961] | 126 | //const float scaleFactor = 5.0f;
|
---|
[2954] | 127 |
|
---|
[2959] | 128 | position.z -= 3 * scaleFactor;
|
---|
[2957] | 129 | Matrix4x4 m = TranslationMatrix(position);
|
---|
| 130 |
|
---|
| 131 | Matrix4x4 s = ScaleMatrix(scaleFactor, scaleFactor, scaleFactor);
|
---|
| 132 | mSkyDome->GetTransform()->SetMatrix(s * m);
|
---|
| 133 |
|
---|
[3036] | 134 | GPUProgramParameters *vtxParams = mSkyDome->GetShape(0)->GetMaterial()->GetVertexProgramParameters();
|
---|
[2957] | 135 |
|
---|
[3036] | 136 | vtxParams->SetValue3f(0, sunDir.x, sunDir.y, sunDir.z);
|
---|
| 137 | vtxParams->SetValue2f(1, sun_theta.first, sun_theta.second);
|
---|
| 138 | vtxParams->SetValue3f(2, zenithColor.x, zenithColor.y, zenithColor.z);
|
---|
[2957] | 139 |
|
---|
[3036] | 140 | vtxParams->SetValue3f(3, ABCDE[0].x, ABCDE[0].y, ABCDE[0].z);
|
---|
| 141 | vtxParams->SetValue3f(4, ABCDE[1].x, ABCDE[1].y, ABCDE[1].z);
|
---|
| 142 | vtxParams->SetValue3f(5, ABCDE[2].x, ABCDE[2].y, ABCDE[2].z);
|
---|
| 143 | vtxParams->SetValue3f(6, ABCDE[3].x, ABCDE[3].y, ABCDE[3].z);
|
---|
| 144 | vtxParams->SetValue3f(7, ABCDE[4].x, ABCDE[4].y, ABCDE[4].z);
|
---|
[2983] | 145 |
|
---|
| 146 |
|
---|
| 147 | if (!scaleToRange)
|
---|
| 148 | {
|
---|
| 149 | // use tone mapping
|
---|
[3036] | 150 | sCgSkyProgram->SetValue1f(8, 1.0f);
|
---|
[2983] | 151 | }
|
---|
| 152 | else
|
---|
[2982] | 153 | {
|
---|
| 154 | // no tone mapping => scale
|
---|
[3036] | 155 | sCgSkyProgram->SetValue1f(8, 8e-5f);
|
---|
[2982] | 156 | }
|
---|
[2954] | 157 |
|
---|
[2982] | 158 | cgGLEnableProfile(RenderState::sCgVertexProfile);
|
---|
| 159 |
|
---|
[2954] | 160 | // Render sky dome.
|
---|
[2957] | 161 | mSkyDome->Render(state);
|
---|
[2954] | 162 |
|
---|
| 163 | // Render additively blended sun disc.
|
---|
[2958] | 164 | //RenderSunDisk(sunDir, camera);
|
---|
[2954] | 165 | }
|
---|
| 166 |
|
---|
| 167 |
|
---|
[2958] | 168 | void SkyPreetham::RenderSunDisk(const Vector3 &sunDir, Camera *camera)
|
---|
[2954] | 169 | {
|
---|
[3036] | 170 | #if TODOD
|
---|
[2958] | 171 | // Move skybox with camera.
|
---|
| 172 | Vector3 position = camera->GetPosition();
|
---|
[2954] | 173 |
|
---|
[2958] | 174 | const float scaleFactor = 100.0f;
|
---|
| 175 | position.z -= 10 * scaleFactor;
|
---|
| 176 |
|
---|
[2954] | 177 | // Set world matrix to sun disc position.
|
---|
[2958] | 178 | Matrix4x4 sunPos = TranslationMatrix(position);
|
---|
[2954] | 179 |
|
---|
[2958] | 180 | Vector3 ndir = -Normalize(sunDir);
|
---|
[2954] | 181 |
|
---|
[2958] | 182 | const float pitch = -atan2(ndir.x, ndir.y);
|
---|
| 183 | const float yaw = atan2(ndir.z, sqrt((ndir.x * ndir.x) + (ndir.y * ndir.y)));
|
---|
[2954] | 184 |
|
---|
[2958] | 185 | Matrix4x4 roty = RotationYMatrix(pitch);
|
---|
| 186 | Matrix4x4 rotx = RotationXMatrix(yaw);
|
---|
| 187 |
|
---|
| 188 | sunPos *= roty;
|
---|
| 189 | sunPos *= rotx;;
|
---|
| 190 |
|
---|
[3036] | 191 | sunposition.rotateAroundY(-D().getScene().getLight().getHorizontalOrientation() + 90.0f);
|
---|
| 192 | sunposition.rotateAroundX(-D().getScene().getLight().getVerticalOrientation());
|
---|
[2954] | 193 |
|
---|
[2958] | 194 | glMatrixMode(GL_MODELVIEW);
|
---|
| 195 | glMultMatrixf((float *)sunPos.x);
|
---|
| 196 |
|
---|
| 197 | float ambient[] = {1.0f, 1.0f, 1.0f, 1.0f};
|
---|
| 198 |
|
---|
| 199 | glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
|
---|
| 200 |
|
---|
[3036] | 201 | Float size = 0.5f + (1.0f - lightdirection.y) * 0.5f;
|
---|
[2958] | 202 |
|
---|
[3036] | 203 | mSunEffect->setVariableVector3("LightDiffuseColor", D().getScene().getLight().getDiffuseColor());
|
---|
| 204 | mSunEffect->setVariableFloat("SunSize", size);
|
---|
| 205 | mSunEffect->setVariableTexture2D("SunTexture", mSunTexture);
|
---|
[2958] | 206 |
|
---|
[3036] | 207 | mSunEffect->activate();
|
---|
[2958] | 208 |
|
---|
[2954] | 209 | mSunQuad->render();
|
---|
| 210 |
|
---|
| 211 | mSunEffect->deactivate();
|
---|
[3036] | 212 | F().getRenderDevice().setDefaultBlendingMode(FRenderDevice::BLENDING_NONE);
|
---|
[2954] | 213 |
|
---|
[2958] | 214 | glPopMatrix();
|
---|
[3036] | 215 | #endif
|
---|
[2954] | 216 | }
|
---|
| 217 |
|
---|
| 218 |
|
---|
[2955] | 219 | void SkyPreetham::CreateSunQuad()
|
---|
[2954] | 220 | {
|
---|
[3036] | 221 | #if TODO
|
---|
[2954] | 222 | mSunQuad = new FVertexBuffer();
|
---|
| 223 | mSunQuad->setupPrimitiveType(FVertexBuffer::PRIMITIVES_TRIANGLES);
|
---|
| 224 | mSunQuad->setupVertexFormat(3, 0, 0, true);
|
---|
| 225 | mSunQuad->setupTexCoordSet(0, 2);
|
---|
| 226 | mSunQuad->setVertexBufferSize(4, 6);
|
---|
| 227 |
|
---|
| 228 | mSunQuad->setVertexPosition(0, FVector3(-0.1f, 0.1f, 1.0f));
|
---|
| 229 | mSunQuad->setVertexPosition(1, FVector3( 0.1f, 0.1f, 1.0f));
|
---|
| 230 | mSunQuad->setVertexPosition(2, FVector3(-0.1f, -0.1f, 1.0f));
|
---|
| 231 | mSunQuad->setVertexPosition(3, FVector3( 0.1f, -0.1f, 1.0f));
|
---|
| 232 | mSunQuad->setVertexTexCoord(0, 0, FVector2(0.0f, 0.0f));
|
---|
| 233 | mSunQuad->setVertexTexCoord(1, 0, FVector2(1.0f, 0.0f));
|
---|
| 234 | mSunQuad->setVertexTexCoord(2, 0, FVector2(0.0f, 1.0f));
|
---|
| 235 | mSunQuad->setVertexTexCoord(3, 0, FVector2(1.0f, 1.0f));
|
---|
| 236 |
|
---|
| 237 | mSunQuad->setIndex(0, 0);
|
---|
| 238 | mSunQuad->setIndex(1, 1);
|
---|
| 239 | mSunQuad->setIndex(2, 2);
|
---|
| 240 | mSunQuad->setIndex(3, 2);
|
---|
| 241 | mSunQuad->setIndex(4, 1);
|
---|
| 242 | mSunQuad->setIndex(5, 3);
|
---|
[3036] | 243 | #endif
|
---|
[2960] | 244 | }
|
---|
| 245 |
|
---|
| 246 |
|
---|
| 247 | void SkyPreetham::ComputeFactors(const Vector3 &sunDir,
|
---|
| 248 | Vector3 &zenithColor,
|
---|
| 249 | vector<Vector3> &ABCDE,
|
---|
| 250 | std::pair<float, float> &sunThetha) const
|
---|
| 251 | {
|
---|
| 252 | sunThetha.first = acos(sunDir.z);
|
---|
| 253 |
|
---|
| 254 | const float cos_theta = cos(sunThetha.first);
|
---|
| 255 | sunThetha.second = cos_theta * cos_theta;
|
---|
| 256 |
|
---|
| 257 | zenithColor.x = ( 0.00165f * CBQ(sunThetha.first) - 0.00374f * SQR(sunThetha.first) + 0.00208f * sunThetha.first + 0.0f) * SQR(mTurbidity) +
|
---|
| 258 | (-0.02902f * CBQ(sunThetha.first) + 0.06377f * SQR(sunThetha.first) - 0.03202f * sunThetha.first + 0.00394f) * mTurbidity +
|
---|
| 259 | ( 0.11693f * CBQ(sunThetha.first) - 0.21196f * SQR(sunThetha.first) + 0.06052f * sunThetha.first + 0.25885f);
|
---|
| 260 |
|
---|
| 261 | zenithColor.y = ( 0.00275f * CBQ(sunThetha.first) - 0.00610f * SQR(sunThetha.first) + 0.00316f * sunThetha.first + 0.0f) * SQR(mTurbidity) +
|
---|
| 262 | (-0.04214f * CBQ(sunThetha.first) + 0.08970f * SQR(sunThetha.first) - 0.04153f * sunThetha.first + 0.00515f) * mTurbidity +
|
---|
| 263 | ( 0.15346f * CBQ(sunThetha.first) - 0.26756f * SQR(sunThetha.first) + 0.06669f * sunThetha.first + 0.26688f);
|
---|
| 264 |
|
---|
| 265 | zenithColor.z = (float)((4.0453f * mTurbidity - 4.9710f) * tan((4.0f / 9.0f - mTurbidity / 120.0f) *
|
---|
| 266 | (M_PI - 2.0f * sunThetha.first)) - 0.2155f * mTurbidity + 2.4192f);
|
---|
| 267 |
|
---|
| 268 | // convert kcd/m² to cd/m²
|
---|
| 269 | zenithColor.z *= 1000.0f;
|
---|
| 270 |
|
---|
| 271 | ABCDE.push_back(Vector3(-0.01925 * mTurbidity - 0.25922, -0.01669 * mTurbidity - 0.26078, 0.17872 * mTurbidity - 1.46303));
|
---|
| 272 | ABCDE.push_back(Vector3(-0.06651 * mTurbidity + 0.00081, -0.09495 * mTurbidity + 0.00921, -0.35540 * mTurbidity + 0.42749));
|
---|
| 273 | ABCDE.push_back(Vector3(-0.00041 * mTurbidity + 0.21247, -0.00792 * mTurbidity + 0.21023, -0.02266 * mTurbidity + 5.32505));
|
---|
| 274 | ABCDE.push_back(Vector3(-0.06409 * mTurbidity - 0.89887, -0.04405 * mTurbidity - 1.65369, 0.12064 * mTurbidity - 2.57705));
|
---|
| 275 | ABCDE.push_back(Vector3(-0.00325 * mTurbidity + 0.04517, -0.01092 * mTurbidity + 0.05291, -0.06696 * mTurbidity + 0.37027));
|
---|
| 276 | }
|
---|
| 277 |
|
---|
| 278 |
|
---|
[2983] | 279 | void SkyPreetham::ComputeSunColor(const Vector3 &sunDir,
|
---|
| 280 | Vector3 &ambient,
|
---|
| 281 | Vector3 &diffuse,
|
---|
| 282 | bool scaleToRange) const
|
---|
[2960] | 283 | {
|
---|
| 284 | // sunDir is sun direction
|
---|
| 285 | // ambient color: shadow color
|
---|
| 286 | // diffuse color: sun color
|
---|
| 287 | pair<float, float> sun_theta;
|
---|
| 288 | Vector3 zenithColor;
|
---|
| 289 | vector<Vector3> ABCDE;
|
---|
| 290 |
|
---|
| 291 | ComputeFactors(sunDir, zenithColor, ABCDE, sun_theta);
|
---|
| 292 |
|
---|
| 293 | Vector3 zenith_XYZ;
|
---|
| 294 |
|
---|
[2967] | 295 | zenith_XYZ.x = (zenithColor.x / zenithColor.y) * zenithColor.z;
|
---|
| 296 | zenith_XYZ.y = zenithColor.z;
|
---|
| 297 | zenith_XYZ.z = ((1.0f - zenithColor.x - zenithColor.y) / zenithColor.y) * zenithColor.z;
|
---|
[2960] | 298 |
|
---|
| 299 | ambient.x = 3.240479f * zenith_XYZ.x - 1.537150f * zenith_XYZ.y - 0.498535f * zenith_XYZ.z;
|
---|
| 300 | ambient.y = -0.969256f * zenith_XYZ.x + 1.875992f * zenith_XYZ.y + 0.041556f * zenith_XYZ.z;
|
---|
| 301 | ambient.z = 0.055648f * zenith_XYZ.x - 0.204043f * zenith_XYZ.y + 1.057311f * zenith_XYZ.z;
|
---|
| 302 |
|
---|
| 303 | // downscale ambient color
|
---|
[2982] | 304 | if (scaleToRange)
|
---|
| 305 | ambient *= 2e-5f;
|
---|
[2981] | 306 | else
|
---|
| 307 | ambient *= 1e-1f;
|
---|
[2960] | 308 |
|
---|
| 309 | // simulate the sun intensity by modulating the ambient term.
|
---|
[2970] | 310 | ambient *= (10.0f - 9.0f * DotProd(sunDir, Vector3::UNIT_Z()));
|
---|
[2968] | 311 | //ambient += Vector3(0.2f);
|
---|
[2960] | 312 |
|
---|
| 313 | Vector3 num;
|
---|
| 314 |
|
---|
| 315 | num.x = (1.0f + ABCDE[0].x * exp(ABCDE[1].x / sunDir.z)) * (1.0f + ABCDE[2].x)+ ABCDE[4].x;
|
---|
| 316 | num.y = (1.0f + ABCDE[0].y * exp(ABCDE[1].y / sunDir.z)) * (1.0f + ABCDE[2].y)+ ABCDE[4].y;
|
---|
| 317 | num.z = (1.0f + ABCDE[0].z * exp(ABCDE[1].z / sunDir.z)) * (1.0f + ABCDE[2].z)+ ABCDE[4].z;
|
---|
| 318 |
|
---|
| 319 | Vector3 den;
|
---|
| 320 |
|
---|
| 321 | den.x = (1.0f + ABCDE[0].x * exp(ABCDE[1].x)) * (1.0f + ABCDE[2].x * exp(ABCDE[3].x * sun_theta.first) + ABCDE[4].x * sun_theta.second);
|
---|
| 322 | den.y = (1.0f + ABCDE[0].y * exp(ABCDE[1].y)) * (1.0f + ABCDE[2].y * exp(ABCDE[3].y * sun_theta.first) + ABCDE[4].y * sun_theta.second);
|
---|
| 323 | den.z = (1.0f + ABCDE[0].z * exp(ABCDE[1].z)) * (1.0f + ABCDE[2].z * exp(ABCDE[3].z * sun_theta.first) + ABCDE[4].z * sun_theta.second);
|
---|
| 324 |
|
---|
| 325 |
|
---|
[2967] | 326 | Vector3 xyY = zenithColor * num / den;
|
---|
[2960] | 327 |
|
---|
| 328 | Vector3 XYZ;
|
---|
| 329 |
|
---|
| 330 | XYZ.x = (xyY.x / xyY.y) * xyY.z;
|
---|
| 331 | XYZ.y = xyY.z;
|
---|
| 332 | XYZ.z = ((1.0f - xyY.x - xyY.y) / xyY.y) * xyY.z;
|
---|
| 333 |
|
---|
| 334 |
|
---|
[2967] | 335 | /////////////
|
---|
| 336 | //-- transform to rgb
|
---|
| 337 |
|
---|
[2960] | 338 | Vector3 color;
|
---|
| 339 | color.x = 3.240479f * XYZ.x - 1.537150f * XYZ.y - 0.498535f * XYZ.z;
|
---|
| 340 | color.y = -0.969256f * XYZ.x + 1.875992f * XYZ.y + 0.041556f *XYZ.z;
|
---|
| 341 | color.z = 0.055648f * XYZ.x - 0.204043f * XYZ.y + 1.057311f * XYZ.z;
|
---|
| 342 |
|
---|
| 343 | // Calculate final sun diffuse color.
|
---|
[2982] | 344 | if (scaleToRange)
|
---|
| 345 | diffuse = color * 5e-2f;
|
---|
[2981] | 346 | else
|
---|
| 347 | diffuse = color * 3e-1f;
|
---|
| 348 |
|
---|
[3017] | 349 | // diffuse component should be more saturated (and less blueish) for high sun positions
|
---|
[3020] | 350 | diffuse.x *= 1.3f;
|
---|
| 351 | diffuse.z *= 0.7f;
|
---|
[3017] | 352 |
|
---|
| 353 | // scale diffuse component in order to make sky look less bright in relation to
|
---|
| 354 | // the geometry in the evening
|
---|
[2971] | 355 | diffuse *= (2.0f - 1.0f * DotProd(sunDir, Vector3::UNIT_Z()));
|
---|
[2967] | 356 |
|
---|
[2968] | 357 | //cout << "diffuse: " << Magnitude(diffuse) << " ambient: " << Magnitude(ambient) << endl;
|
---|
[2954] | 358 | } |
---|