<div dir="ltr"><div>Hi,</div><div><br></div><div>you can use the normals pseudoloader. just append .normals to your osgb file on reading - mymodel.osgb.normals<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 11, 2019 at 10:20 AM Han Hu <<a href="mailto:huhan8807@gmail.com">huhan8807@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I would like to do offscreen rendering of a mesh.<br>
Currently, I have suceeded to do this for both the color (RGB) and depth data using the built-in functions as below.<br>
<br>
<br>
Code:<br>
<br>
<br>
osg::ref_ptr<osg::Image> rttImage = new osg::Image;<br>
osg::ref_ptr<osg::Image> depthImage = new osg::Image;<br>
<br>
camera->attach(osg::Camera::COLOR_BUFFER, rttImage.get());<br>
camera->attach(osg::Camera::DEPTH_BUFFER, depthImage.get());<br>
<br>
rttImage->allocateImage(ATInfo.width, ATInfo.height, 1, GL_RGB, GL_UNSIGNED_BYTE);<br>
depthImage->allocateImage(ATInfo.width, ATInfo.height, 1, GL_DEPTH_COMPONENT, GL_FLOAT);<br>
<br>
<br>
<br>
<br>
But I also need to render the normal vectors to images too. I have googled this topic using native opengl, it seems that I have to write shaders for it. But my mesh are defined using the osgb plugin format, so I must implement in the osg.<br>
<br>
I would like to know, is there an approach to do this in osg? Thanks!<br>
<br>
Thank you!<br>
<br>
Cheers,<br>
Han<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=76892#76892" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=76892#76892</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">trajce nikolov nick<br></div>