Renderer14::Renderer14(int width, int height): RenderingEngine(width, height) { glViewport(0, 0, width, height); PrepareProgram(); LoadTexture(); SetupUniforms(); GenerateBuffers(); }
void D3DOverdrawWindow:: SetupDraw(int iViewpoint) { SetupViewport(); SetupWorld(); SetupView(iViewpoint); SetupProjection(); SetupTransforms(); SetupUniforms(); Clear(); }
void TerrainShaderPatchNode::AddShader() { //добавить шейдер //формирование сцены с шейдером osg::StateSet* ss = m_rootNode->getOrCreateStateSet(); //создать экземпл¤р программы osg::Program* program = new osg::Program; program->setName( "only_geom" ); osg::Shader *VertObj = new osg::Shader( osg::Shader::VERTEX ); osg::Shader *FragObj = new osg::Shader( osg::Shader::FRAGMENT ); program->addShader( VertObj ); program->addShader( FragObj ); LoadShaderSource( VertObj , "glsl/only_geom.vert" ); LoadShaderSource( FragObj , "glsl/only_geom.frag" ); ss->setAttributeAndModes( program, osg::StateAttribute::ON ); //настроить uniform'ы SetupUniforms( ss ); }