Commit ec9b17ab authored by Jan Möbius's avatar Jan Möbius
Browse files

Disabled shader support for windows

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2702 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 19e084a6
...@@ -193,36 +193,40 @@ ...@@ -193,36 +193,40 @@
std::string shaderDirectory = std::string( shaderDir.toUtf8() ); std::string shaderDirectory = std::string( shaderDir.toUtf8() );
shaderNode_->setShaderDir( shaderDirectory ); shaderNode_->setShaderDir( shaderDirectory );
if ( QFile( shaderDir + "Phong/Vertex.glsl").exists() && QFile( shaderDir + "Phong/Fragment.glsl" ).exists() ) { if ( !OpenFlipper::Options::isWindows ) {
shaderNode_->setShader(ACG::SceneGraph::DrawModes::SOLID_PHONG_SHADED,
"Phong/Vertex.glsl" , if ( QFile( shaderDir + "Phong/Vertex.glsl").exists() && QFile( shaderDir + "Phong/Fragment.glsl" ).exists() ) {
"Phong/Fragment.glsl" ); shaderNode_->setShader(ACG::SceneGraph::DrawModes::SOLID_PHONG_SHADED,
} else "Phong/Vertex.glsl" ,
std::cerr << "Shader Files for Phong not found!" << std::endl; "Phong/Fragment.glsl" );
} else
std::cerr << "Shader Files for Phong not found!" << std::endl;
if ( QFile( shaderDir + "Ward/Vertex.glsl").exists() && QFile( shaderDir + "Ward/Fragment.glsl" ).exists() ) { if ( QFile( shaderDir + "Ward/Vertex.glsl").exists() && QFile( shaderDir + "Ward/Fragment.glsl" ).exists() ) {
shaderNode_->setShader(ACG::SceneGraph::DrawModes::SOLID_SHADER, shaderNode_->setShader(ACG::SceneGraph::DrawModes::SOLID_SHADER,
"Ward/Vertex.glsl" , "Ward/Vertex.glsl" ,
"Ward/Fragment.glsl" ); "Ward/Fragment.glsl" );
// Ward shader uses 3 parameters so activate shader, set params and deactivate it again // Ward shader uses 3 parameters so activate shader, set params and deactivate it again
GLSL::PtrProgram shader = shaderNode_->getShader( ACG::SceneGraph::DrawModes::SOLID_SHADER ); GLSL::PtrProgram shader = shaderNode_->getShader( ACG::SceneGraph::DrawModes::SOLID_SHADER );
if ( shader == 0 ) { if ( shader == 0 ) {
std::cerr << "Unable to get shader for shader mode" << std::endl; std::cerr << "Unable to get shader for shader mode" << std::endl;
} else { } else {
shader->use(); shader->use();
shader->setUniform("ward_specular" , 0.5f); shader->setUniform("ward_specular" , 0.5f);
shader->setUniform("ward_diffuse" , 1.0f); shader->setUniform("ward_diffuse" , 1.0f);
shader->setUniform("ward_alpha" , 0.1f); shader->setUniform("ward_alpha" , 0.1f);
shader->disable(); shader->disable();
} }
} else } else
std::cerr << "Shader Files for Ward not found!!" << std::endl; std::cerr << "Shader Files for Ward not found!!" << std::endl;
} else
std::cerr << "Shader support disabled for windows " << std::endl;
// Update all nodes // Update all nodes
update(); update();
......
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