|
本帖最后由 victording 于 2013-5-21 16:57 编辑
各位:
在使用OverlayNode将KML线包裹在地球表面时,线的边缘锯齿很严重,不知道如何消除。
我能想到的设置texture2D和Camera的参数都修改过了,可还是不行,都将texture大小弄成8196*8196了,还是有锯齿。
核心代码如下:
osg::Texture2D* texture = new osg::Texture2D;
texture->setTextureSize(8196, 8196);
texture->setInternalFormat(GL_RGBA);
texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D:INEAR);
texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
texture->setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_BORDER);
texture->setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_BORDER);
texture->setWrap(osg::Texture2D::WRAP_R,osg::Texture2D::CLAMP_TO_BORDER);
_camera = new osg::Camera;
_camera->setName("overlay_camera");
_camera->setClearColor(_overlayClearColor);
_camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT);
_camera->setViewport(0,0,tex_width,tex_height);
_camera->setComputeNearFarMode(osg::CullSettings:O_NOT_COMPUTE_NEAR_FAR);
_camera->setRenderOrder(osg::Camera:RE_RENDER);
_camera->setRenderTargetImplementation(_renderTargetImpl);
_camera->attach(osg::Camera::COLOR_BUFFER, overlayData->_texture.get() );
if (_overlaySubgraph.valid())
_camera->addChild(_overlaySubgraph.get());
|
|