if(!mState.currentProgram)\r
{\r
//return;// error(GL_INVALID_OPERATION);\r
- device->setProjectionMatrix(projection.current());\r
+\r
+ const sw::Matrix Z(1, 0, 0, 0,\r
+ 0, 1, 0, 0,\r
+ 0, 0, 0.5, 0.5,\r
+ 0, 0, 0, 1); // Map depth range from [-1, 1] to [0, 1]\r
+\r
+ device->setProjectionMatrix(Z * projection.current());\r
device->setViewMatrix(modelView.current());\r
device->setTextureMatrix(0, texture[0].current());\r
device->setTextureMatrix(1, texture[1].current());\r
return error(GL_INVALID_OPERATION);\r
}\r
\r
- device->setProjectionMatrix(projection.current());\r
+ const sw::Matrix Z(1, 0, 0, 0,\r
+ 0, 1, 0, 0,\r
+ 0, 0, 0.5, 0.5,\r
+ 0, 0, 0, 1); // Map depth range from [-1, 1] to [0, 1]\r
+\r
+ device->setProjectionMatrix(Z * projection.current());\r
device->setViewMatrix(modelView.current());\r
device->setTextureMatrix(0, texture[0].current());\r
device->setTextureMatrix(1, texture[1].current());\r
device->setAmbientMaterialSource(sw::MATERIAL_MATERIAL);\r
device->setEmissiveMaterialSource(sw::MATERIAL_MATERIAL);\r
\r
- device->setProjectionMatrix(projectionStack.current());\r
+ const sw::Matrix Z(1, 0, 0, 0,\r
+ 0, 1, 0, 0,\r
+ 0, 0, 0.5, 0.5,\r
+ 0, 0, 0, 1); // Map depth range from [-1, 1] to [0, 1]\r
+\r
+ device->setProjectionMatrix(Z * projectionStack.current());\r
device->setModelMatrix(modelViewStack.current());\r
device->setTextureMatrix(0, textureStack0.current());\r
device->setTextureMatrix(1, textureStack1.current());\r
r.o[pos].y = r.o[pos].y + *Pointer<Float4>(r.data + OFFSET(DrawData,halfPixelY)) * r.o[pos].w;
}
- if(symmetricNormalizedDepth)
+ if(symmetricNormalizedDepth && !state.fixedFunction)
{
r.o[pos].z = (r.o[pos].z + r.o[pos].w) * Float4(0.5f);
}