void Channel::frameClear( const eq::uint128_t& /*frameID*/ ) { if( stopRendering( )) return; _initJitter(); resetRegions(); const FrameData& frameData = _getFrameData(); const int32_t eyeIndex = lunchbox::getIndexOfLastBit( getEye() ); if( _isDone() && !_accum[ eyeIndex ].transfer ) return; applyBuffer(); applyViewport(); const eq::View* view = getView(); if( view && frameData.getCurrentViewID() == view->getID( )) glClearColor( 1.f, 1.f, 1.f, 0.f ); #ifndef NDEBUG else if( getenv( "EQ_TAINT_CHANNELS" )) { const eq::Vector3ub color = getUniqueColor(); glClearColor( color.r()/255.f, color.g()/255.f, color.b()/255.f, 0.f ); } #endif // NDEBUG else glClearColor( 0.f, 0.f, 0.f, 0.0f ); glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); }
inline auto& operator<<(LOut& mLOut, const T& mValue) { std::lock_guard<std::mutex> SSVU_UNIQUE_NAME{lo().mtx}; if(!getLogSuppressed()) { if(!mLOut.title.empty()) { auto tStr("[" + mLOut.title + "] "); std::cout << getUniqueColor(tStr) << Console::setStyle(Console::Style::Bold) << std::left << std::setw(LOut::leftW) << tStr; getLogStream() << std::left << std::setw(LOut::leftW) << tStr; mLOut.title.clear(); } mLOut.stream << Console::resetFmt(); stringify<true>(mLOut.stream, mValue); mLOut.stream << Console::resetFmt(); stringify<false>(getLogStream(), mValue); } return mLOut; }
void Channel::frameDraw( const eq::uint128_t& ) { // Setup frustum EQ_GL_CALL( applyBuffer( )); EQ_GL_CALL( applyViewport( )); EQ_GL_CALL( glMatrixMode( GL_PROJECTION )); EQ_GL_CALL( glLoadIdentity( )); EQ_GL_CALL( applyFrustum( )); EQ_GL_CALL( glMatrixMode( GL_MODELVIEW )); EQ_GL_CALL( glLoadIdentity( )); // Setup lights before applying head transform, so the light will be // consistent in the cave const FrameData& frameData = _getFrameData(); const eq::Matrix4f& rotation = frameData.getRotation(); const eq::Vector3f& translation = frameData.getTranslation(); eq::Matrix4f invRotationM; rotation.inverse( invRotationM ); setLights( invRotationM ); EQ_GL_CALL( applyHeadTransform( )); glTranslatef( translation.x(), translation.y(), translation.z() ); glMultMatrixf( rotation.array ); Pipe* pipe = static_cast<Pipe*>( getPipe( )); Renderer* renderer = pipe->getRenderer(); LBASSERT( renderer ); const eq::Matrix4f& modelview = _computeModelView(); // set fancy data colors const eq::Vector4f taintColor = _getTaintColor( frameData.getColorMode(), getUniqueColor( )); const int normalsQuality = _getFrameData().getNormalsQuality(); const eq::Range& range = getRange(); renderer->render( range, modelview, invRotationM, taintColor, normalsQuality ); checkError( "error during rendering " ); _drawRange = range; #ifndef NDEBUG outlineViewport(); #endif }
bool Channel::configInit( const eq::uint128_t& initID ) { if( !eq::Channel::configInit( initID )) return false; setNearFar( 0.001f, 10.0f ); if( getenv( "EQ_TAINT_CHANNELS" )) { _bgColor = getUniqueColor(); _bgColor /= 255.f; } return true; }
void Channel::frameStart( const eq::uint128_t& frameID, const uint32_t frameNumber ) { _image.reset(); _bgColor = eq::Vector3f( 0.f, 0.f, 0.f ); const BackgroundMode bgMode = _getFrameData().getBackgroundMode(); if( bgMode == BG_WHITE ) _bgColor = eq::Vector3f( 1.f, 1.f, 1.f ); else if( bgMode == BG_COLOR || _taint ) _bgColor = eq::Vector3f( getUniqueColor( )) / 255.f; eq::Channel::frameStart( frameID, frameNumber ); }
cPlug::cPlug() { this->debugColor = getUniqueColor(Plug.size(), 4, 0xFF, true, true); }
void Channel::frameDraw( const eq::uint128_t& frameID ) { if( stopRendering( )) return; _initJitter(); if( _isDone( )) return; Window* window = static_cast< Window* >( getWindow( )); VertexBufferState& state = window->getState(); const Model* oldModel = _model; const Model* model = _getModel(); if( oldModel != model ) state.setFrustumCulling( false ); // create all display lists/VBOs if( model ) _updateNearFar( model->getBoundingSphere( )); eq::Channel::frameDraw( frameID ); // Setup OpenGL state glLightfv( GL_LIGHT0, GL_POSITION, lightPosition ); glLightfv( GL_LIGHT0, GL_AMBIENT, lightAmbient ); glLightfv( GL_LIGHT0, GL_DIFFUSE, lightDiffuse ); glLightfv( GL_LIGHT0, GL_SPECULAR, lightSpecular ); glMaterialfv( GL_FRONT, GL_AMBIENT, materialAmbient ); glMaterialfv( GL_FRONT, GL_DIFFUSE, materialDiffuse ); glMaterialfv( GL_FRONT, GL_SPECULAR, materialSpecular ); glMateriali( GL_FRONT, GL_SHININESS, materialShininess ); const FrameData& frameData = _getFrameData(); glPolygonMode( GL_FRONT_AND_BACK, frameData.useWireframe() ? GL_LINE : GL_FILL ); const eq::Vector3f& position = frameData.getCameraPosition(); glMultMatrixf( frameData.getCameraRotation().array ); glTranslatef( position.x(), position.y(), position.z() ); glMultMatrixf( frameData.getModelRotation().array ); if( frameData.getColorMode() == COLOR_DEMO ) { const eq::Vector3ub color = getUniqueColor(); glColor3ub( color.r(), color.g(), color.b() ); } else glColor3f( .75f, .75f, .75f ); if( model ) _drawModel( model ); else { glNormal3f( 0.f, -1.f, 0.f ); glBegin( GL_TRIANGLE_STRIP ); glVertex3f( .25f, 0.f, .25f ); glVertex3f( -.25f, 0.f, .25f ); glVertex3f( .25f, 0.f, -.25f ); glVertex3f( -.25f, 0.f, -.25f ); glEnd(); } state.setFrustumCulling( true ); Accum& accum = _accum[ lunchbox::getIndexOfLastBit( getEye()) ]; accum.stepsDone = LB_MAX( accum.stepsDone, getSubPixel().size * getPeriod( )); accum.transfer = true; }