Commit 14cfe548 authored by Christopher Tenter's avatar Christopher Tenter
Browse files

More render and shader data output in debugging mode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15825 383ad7c9-94d9-4d36-a494-682f7c89f535
parent cb56f993
......@@ -215,9 +215,28 @@ QString RenderObject::toString() const
<< "\nindexOffset: " << indexOffset;
resultStrm << "\nvbo-id: " << vertexBuffer
<< "\nibo-id: " << indexBuffer
<< "\nsysmemIndexBuffer: " << sysmemIndexBuffer;
resultStrm << "\n" << shaderDesc.toString();
resultStrm << "\nmodelview: "
<< "{" << modelview(0, 0) << ", " << modelview(0, 1) << ", " << modelview(0, 2) << ", " << modelview(0, 3) << "} "
<< "{" << modelview(1, 0) << ", " << modelview(1, 1) << ", " << modelview(1, 2) << ", " << modelview(1, 3) << "} "
<< "{" << modelview(2, 0) << ", " << modelview(2, 1) << ", " << modelview(2, 2) << ", " << modelview(2, 3) << "} "
<< "{" << modelview(3, 0) << ", " << modelview(3, 1) << ", " << modelview(3, 2) << ", " << modelview(3, 3) << "} ";
resultStrm << "\nproj: "
<< "{" << proj(0, 0) << ", " << proj(0, 1) << ", " << proj(0, 2) << ", " << proj(0, 3) << "} "
<< "{" << proj(1, 0) << ", " << proj(1, 1) << ", " << proj(1, 2) << ", " << proj(1, 3) << "} "
<< "{" << proj(2, 0) << ", " << proj(2, 1) << ", " << proj(2, 2) << ", " << proj(2, 3) << "} "
<< "{" << proj(3, 0) << ", " << proj(3, 1) << ", " << proj(3, 2) << ", " << proj(3, 3) << "} ";
resultStrm << "\nculling: " << culling
<< "\nblending: " << blending
<< "\nalphaTest: " << alphaTest;
......
......@@ -104,8 +104,35 @@ GLSL::Program* ACG::ShaderCache::getProgram( const ShaderGenDesc* _desc, unsigne
ShaderProgGenerator progGen(_desc, _usage);
#ifdef SG_DEBUG_OUTPUT
progGen.saveFragmentShToFile("../../../dbg_frag.glsl");
progGen.saveVertexShToFile("../../../dbg_vert.glsl");
{
static int counter = 0;
char fileName[0x100];
sprintf(fileName, "../../shader_%02d.glsl", counter++);
QFile fileOut(fileName);
if (fileOut.open(QFile::WriteOnly | QFile::Truncate))
{
QTextStream outStrm(&fileOut);
outStrm << _desc->toString();
outStrm << "\nusage: " << _usage << "\n";
outStrm << "\n---------------------vertex-shader--------------------\n\n";
for (int i = 0; i < progGen.getVertexShaderCode().size(); ++i)
outStrm << progGen.getVertexShaderCode()[i] << "\n";
outStrm << "\n---------------------fragment-shader--------------------\n\n";
for (int i = 0; i < progGen.getFragmentShaderCode().size(); ++i)
outStrm << progGen.getFragmentShaderCode()[i] << "\n";
fileOut.close();
}
}
#endif
GLSL::FragmentShader* fragShader = new GLSL::FragmentShader();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment