Re: [osg-users] What is the reason for using a texture image that is black on the basis of the osgmultiplerendertargets?

25 views
Skip to first unread message
Message has been deleted

OpenSceneGraph Users

unread,
Jun 23, 2020, 4:28:11 AM6/23/20
to OpenSceneGraph Users
Putting a brief description in a subject then a whole file in the body really isn't helpful as the first step in investigating problems.  Few people are going to stop their own work, pull down your code, writing a build script for it, get it compiled and try to recreate the problem, especially when you don';t provide any actual information as to what the problem might you are seeing.

The first step should be explaining what you are testing in high level terms.  Which OS, what hardware, what OSG version, how you invoked the application, a screenshot of what you see on screen.  If you are trying out an OSG example, is it the exact one in OpenSceneGraph/examples, is it a modified one?

For me the osgmultiplerendertargets is producing a yellow quad.  I'm not the author of this example, so I assume it's correct.

Mirro Xu

unread,
Jun 23, 2020, 7:52:54 AM6/23/20
to osg-...@googlegroups.com
I used a texture here in the example, but I don't know why display error.
I fixed it now.This needs to be changed to the following code.

  osg::ref_ptr<osg::Vec3Array> quad_coords = new osg::Vec3Array; // vertex coords
    // counter-clockwise
    quad_coords->push_back(osg::Vec3d(0, 0, -1));
    quad_coords->push_back(osg::Vec3d(tex_width, 0, -1));
    quad_coords->push_back(osg::Vec3d(tex_width, tex_height, -1));
    quad_coords->push_back(osg::Vec3d(0, tex_height, -1));

    osg::ref_ptr<osg::Vec2Array> quad_tcoords = new osg::Vec2Array; // texture coords
    quad_tcoords->push_back(osg::Vec2(0, 0));
    quad_tcoords->push_back(osg::Vec2(tex_width, 0));
    quad_tcoords->push_back(osg::Vec2(tex_width, tex_height));
    quad_tcoords->push_back(osg::Vec2(0, tex_height));



在 2020年6月23日星期二 UTC+8下午4:28:11,OpenSceneGraph Users写道:
Reply all
Reply to author
Forward
0 new messages