<div dir="ltr">Hi Uma,<div><br></div><div>you can use TextureRectangle instead of Texture2D. Then your UV mapping is in the range of s:0-imageWidth, t:0-imageHeight and the image will preserve its original size</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 22, 2016 at 2:06 PM, Christian Buchner <span dir="ltr"><<a href="mailto:christian.buchner@gmail.com" target="_blank">christian.buchner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br>Your OpenGL implementation might signal a maximum texture size of 4096.<br><br></div>Which is why there is no alternative to downsizing it.<br><br></div><div>There is also an <span class="m_8917267724100383437gmail-st">OSG_MAX_TEXTURE_SIZE environment variable. I am not sure what its default value is, or if it has a default at all. Have you tried forcing this to 8192?<span class="HOEnZb"><font color="#888888"><br></font></span></span></div><span class="HOEnZb"><font color="#888888"><div><br></div>Christian<br><br><div><div><br></div></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-11-22 13:58 GMT+01:00 Uma Devi Selvaraj <span dir="ltr"><<a href="mailto:umaselvam1503@gmail.com" target="_blank">umaselvam1503@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have simple code that renders image using osgviewer. I am able to render the image successfully with the code. My problem now is the size of the image is reduced. for example the original size of the image is 4683 * 3035, the image is reduced to 4096 * 3035. Is this expected behaviour or is there anything I need to add in my code. I have added my code.<br>
<br>
<br>
//required header files<br>
<br>
int main(int argc,char**argv)<br>
{<br>
<br>
osg::ref_ptr<osg::Image> image;<br>
image = osgDB::readImageFile("C:\\User<wbr>s\\mcw\\Desktop\\DemModel.tif.<wbr>gdal");<br>
std::cout << "Image info are " << image->s() << "\n" <<image->t() <<"\n" <<image->r() << std::endl;<br>
if (!(image.valid()))<br>
{<br>
std::cout << "Unable to read image file " << std::endl;<br>
getchar();<br>
return 0;<br>
}<br>
<br>
osg::ref_ptr<osg::Geode> geode =(osg::createGeodeForImage(ima<wbr>ge));<br>
<br>
osg::Texture2D *texture = new osg::Texture2D();<br>
texture->setFilter(osg::Textur<wbr>e::MIN_FILTER, osg::Texture::LINEAR);<br>
texture->setFilter(osg::Textur<wbr>e::MAG_FILTER, osg::Texture::LINEAR);<br>
texture->setWrap(osg::Texture:<wbr>:WRAP_R, osg::Texture::REPEAT);<br>
texture->setResizeNonPowerOfTw<wbr>oHint(false);<br>
texture->setImage(image);<br>
texture->setBorderColor(osg::V<wbr>ec4d(0.4f, 0.5f, 0.6f, 1.0f));<br>
osg::StateSet* stateset = new osg::StateSet;<br>
<br>
stateset->setTextureAttributeA<wbr>ndModes(0, texture, osg::StateAttribute::ON);<br>
<br>
geode->setStateSet(stateset);<br>
osgViewer::Viewer viewer;<br>
viewer.setSceneData(geode.get(<wbr>));<br>
getchar();<br>
return viewer.run();<br>
<br>
}<br>
<br>
...<br>
<br>
Thank you!<br>
<br>
Cheers,<br>
Uma<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=69470#69470" rel="noreferrer" target="_blank">http://forum.openscenegraph.or<wbr>g/viewtopic.php?p=69470#69470</a><br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph<wbr>.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.or<wbr>g/listinfo.cgi/osg-users-opens<wbr>cenegraph.org</a><br>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</div>