-1

I have an .obj textured mesh. I am using OpenSceneGraph for loading and display my mesh.

    osg::Node * cytBuilding = osgDB::readNodeFile( "model/level_2_0_0.obj");
    osg::Group * root = new osg::Group();
    root->addChild( cytBuilding );
    osgViewer::Viewer viewer;
    viewer.setSceneData( root );
    viewer.realize();
    viewer.setCameraManipulator(new osgGA::TerrainManipulator());
    while( !viewer.done() )
    {
         viewer.frame();
    }

I get a display something like enter image description here

Which is too dark. I tried to add my own light, it helps a bit. But it is not very bright. How to increase the brightness of the rendered view.

I am aware it depends on material/texture properties. How to manipulate it?

I would also like to add that as I load the mesh I get following messages printed

*** line not handled *** :map_kS
*** line not handled *** :map_Ns
*** line not handled *** :map_bump
*** line not handled *** :bump
*** line not handled *** :map_opacity
*** line not handled *** :map_d
*** line not handled *** :refl

What are some alternate ways?

mkuse
  • 2,250
  • 4
  • 32
  • 61
  • I am not setting my lighting, using the system lighting. Any pointers to setting Sun like lighting is what I need. – mkuse Aug 02 '16 at 13:35
  • Have you loaded some model that has build in light? I got a very similar result when I loaded a model that I had exported from Blender without first removing the camera and light objects from the scene. – HelloGoodbye Aug 31 '18 at 08:35

1 Answers1

0

Since I can't tell which light you tried, I'll give an answer in that direction anyway. A sun like light is a directional light. You can create one in OSG via a standard light, but you don't give it any position. The easiest way is probably to just give it colors for diffuse, specular and ambient components. The brightness then depends on the colors you choose.

Maybe have a look at this question: Create Sun light source in OSG

Community
  • 1
  • 1
Tare
  • 482
  • 1
  • 9
  • 25
  • I did try that, but the images are still too dark. How can I have a say brighter sun-like source? – mkuse Aug 10 '16 at 13:42
  • you can choose the color components all white or you change the angle, with which light falls onto your surface (by changing the direction of the light). otherwise, create a Material for your objects in which you set the colors and add that as an Attribute to their statesets (I'm not sure however, if the standard is bright white already and I can't currently try it). – Tare Sep 23 '16 at 09:01