model light problem

classic Classic list List threaded Threaded
4 messages Options
peckham peckham
Reply | Threaded
Open this post in threaded view
|

model light problem

Hi,
    In my earth file, a ive model is loaded by osgearth_viewer as:
    <map version="2">
        <options lighting="true">
                <terrain driver="mp" blending="false" lighting="true">
                </terrain>
        </options>
       
        <image name="im" driver="gdal">
                <url>image.tif</url>
        </image>
       
        <elevation name="el" driver="gdal">
                <url>elevation.tif</url>
        </elevation>
       
        <model name="bs" driver="simple">
                <url>D:\model\bs.ive</url>
                <location>102.633633 26.324982 764</location>
                <lighting>true</lighting>
        </model>
    </map>
    As you know, all possible lighting is enabled there. However, the model looks very plain with a single color as:

    Actually, if I load the model by osgviewer, a proper result can be achieved as:

    So, what's the matter? Any hint will be appreciated.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: model light problem

peckham,

Are you using a sky model?

  osgearth_viewer --sky file.earth
Glenn Waldron / Pelican Mapping
peckham peckham
Reply | Threaded
Open this post in threaded view
|

Re: model light problem

Hi, Glenn
     Thanks! I am so sorry for my late reply. I have tried the argument --sky on your suggestion, and got a proper result for the model as follows:

     However, as you see, the image's color is much lighter than that not using --sky because of the sky light. So, I turn off the lighting option of terrain in my earth file as "<terrain lighting="false"/>", and get the same "model light problem" as I posted before, i.e., the ive model is still plain, but the image is proper. Maybe, it is another question? I am looking forward for your reply, thanks very much!
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: model light problem

--sky uses an atmospheric scattering model, so it's not the same as the built-in OpenGL lighting. You can try the GL phong shader model and see if you like it better:

osgearth_viewer file.earth --extension sky_gl

Glenn Waldron / Pelican Mapping