HI Robert,
Thanks again:). Now I noticed the problem may caused by TexEnvCombine.The 
following code works well in 1.2 and draw a pure white model. But in 2.33 it 
draws a gray one . no codes changed. And I am also sure that vertex color and 
materials has been set to white. 
and the result of using 
te->setCombine_RGB(osg::TexEnvCombine::ADD);is brighter than 
te->setCombine_RGB(osg::TexEnvCombine::MODULATE); but also far to be pure white

 ref_ptr<osg::Image> img=new osg::Image;
 img->allocateImage(texmap.width,texmap.height ,1,GL_RGBA,GL_UNSIGNED_BYTE);
//set to pure white
 memset(img->data(),255,img->getImageSizeInBytes());
 Texture2D  *tex=new Texture2D;
 tex->setImage(0,img.get());

 
m_param_osg.m_lightmaped_model_node->getOrCreateStateSet()->setTextureAttributeAndModes(m_param_osg.m_lightmap_texcoord_level,tex,StateAttribute::ON|StateAttribute::OVERRIDE);

 osg::TexEnvCombine *te = new osg::TexEnvCombine;    
 te->setCombine_RGB(osg::TexEnvCombine::ADD);

 te->setSource1_RGB(osg::TexEnvCombine::TEXTURE);
 te->setOperand1_RGB(osg::TexEnvCombine::SRC_COLOR);

 te->setSource0_RGB(osg::TexEnvCombine::PREVIOUS);
 te->setOperand0_RGB(osg::TexEnvCombine::SRC_COLOR);
Thanks ! 
  ----- Original Message ----- 
  From: Robert Osfield 
  To: OpenSceneGraph Users 
  Sent: Monday, April 14, 2008 4:01 PM
  Subject: Re: [osg-users] problem when using multi-sceneview in 2.3


  Hi Wangmiao,

  Using multiple SceneViews does work in 2.x, osgViewer uses SceneViews under 
the hood to implement rendering, and it supports multiple views across one or 
more graphics context without any problems.

  As to why things are working your app I can't really even have a guess at as 
I don't know the code.

  Robert.


  On Mon, Apr 14, 2008 at 6:56 AM, wangmiao <[EMAIL PROTECTED]> wrote:

    Hello every one,
    I meet a problem when switching to osg 2.33 , multi-sceneviews doesn't work 
for 2 or more contextes.
    I do it like these:
    1. build opengl contex by opengl call
    2.sceneview.Init()
    loop................loop
    3.destory sceneview AND  releaseAllGLObjects
    4.destory context  wglDeleteContext
    every context has an individual contextid set by 
m_sceneview->getState()->setContextID
    this works perfect with osg 1.2.
    Is there any change may cause this problem? Thanks!

                                                                       wangmiao
    _______________________________________________
    osg-users mailing list
    [email protected]
    http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





------------------------------------------------------------------------------


  _______________________________________________
  osg-users mailing list
  [email protected]
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to