Trajce Nikolov NICK | 29 Jan 00:23 2015
Picon

shader composition

Hi Community,

I read the shader composition code and the used classes - which are really without any documentation :-). Can someone give a fast intro into this, the sample for example?

Thanks a bunch as always

Nick

--
trajce nikolov nick
<div><div dir="ltr">
<div>
<div>Hi Community,<br><br>
</div>I read the shader composition code and the used classes - which are really without any documentation :-). Can someone give a fast intro into this, the sample for example?<br><br>
</div>Thanks a bunch as always<br><br>Nick<br clear="all"><div><div><div><div>
<br>-- <br><div class="gmail_signature">trajce nikolov nick<br>
</div>
</div></div></div></div>
</div></div>
Christian Buchner | 28 Jan 11:40 2015
Picon

common conventions for multitexturing & bumpmapped sample OSG model

Hi all,

I was wondering if there are commonly used conventions which texture units do what in 3D models used for realtime rendering (games etc).

For example I see that most 3D models enable texture unit #1 for the diffuse texture, whereas unit #0 is unused most of the time.

Now what if the model also contained a bump or normal map? On which texture unit would such maps typically use?

Would anyone have an example OSG file that uses both a diffuse and a normal texture, rendered with the fixed function pipeline? I am trying to get started with normal maps now and this would be a big help, especially if such a model follows the usual conventions.

Christian



<div><div dir="ltr">
<div>Hi all,<br><br>I was wondering if there are commonly used conventions which texture units do what in 3D models used for realtime rendering (games etc).<br><br>For example I see that most 3D models enable texture unit #1 for the diffuse texture, whereas unit #0 is unused most of the time.<br><br>
</div>Now what if the model also contained a bump or normal map? On which texture unit would such maps typically use?<br><br>Would anyone have an example OSG file that uses both a diffuse and a normal texture, rendered with the fixed function pipeline? I am trying to get started with normal maps now and this would be a big help, especially if such a model follows the usual conventions.<br><br>Christian<br><br><div>
<br><br>
</div>
</div></div>
Ash Pat | 27 Jan 11:54 2015
Picon

SmoothingVisitor normals doesn't seem right

Hi,

I am trying to use the SmoothingVisitor to generate the normals. I am not explicitly setting the normals
array. However, when rendered it appears as though the normals generated are flipped. The geometry
consists of triangle and quad primitives.

I tried it in two ways.

Code:
osgUtil::SmoothingVisitor::smooth(*pGeometry);

Code:
osgUtil::SmoothingVisitor sv;
pGeode->accept(sv); 

Any suggestions? 
Is there something more to be done? 

Thank you!

Cheers,
AP

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62491#62491

Cary, Karl A. | 26 Jan 20:00 2015

Texture Not Found For ive, but is for osg

I am working on updating our modeling to simulation model pipeline and have ran in to an issue. If we export to a .ive file, when loaded in our program or osgviewer, there are no textures. I set the OSG_NOTIFY_LEVEL to DEBUG and it never attempts to find them. If I do an osgconv to a .osg file, the textures show up just fine. The textures themselves are .png currently (issue with nvidia texture tools to make them .dds for now). They are located in the OSG_FILE_PATH, and I would presume correctly if they get loaded by the .osg. What could I be missing that has them not showing up in the .ive? If I do our export directly to .osg, it works as well and produces the exact same file as an osgconv from .ive. Thanks in advance.

Karl Cary
<div>
<div>I am working on updating our modeling to simulation model pipeline and have ran in to an issue. If we export to a .ive file, when loaded in our program or osgviewer, there are no
 textures. I set the OSG_NOTIFY_LEVEL to DEBUG and it never attempts to find them. If I do an osgconv to a .osg file, the textures show up just fine. The textures themselves are .png currently (issue with nvidia texture tools to make them .dds for now). They
 are located in the OSG_FILE_PATH, and I would presume correctly if they get loaded by the .osg. What could I be missing that has them not showing up in the .ive? If I do our export directly to .osg, it works as well and produces the exact same file as an osgconv
 from .ive. Thanks in advance.<br><br>
Karl Cary<br>
</div>
</div>
Drake Aldwyn | 26 Jan 15:04 2015
Picon

Strange mouse behavior

Hi, all
Guys, do you have met this kind of mouse behavior?
Thats what I do:
Build QTOSG application that add few object in scene (comupositeview). When I highlight object mouse
stands exactly at point where it have to be. Like in this picture. [Image:
http://i.imgur.com/9bRy3Mj.png ] (word "mouse" is actual cursor position, to highlight it have to be in
yellow square area). So all is perfect. But! When I add new item to scene in already builded application via
same code (button) it starts act like this. [Image: http://i.imgur.com/KI59HkO.png ]. To highlight it i
have to move mouse in that point as mentioned on second picture. And this behavior is applied only to new
objects that was added by button in already running application. With old ones that was added during
building mouse acting normal as on first picture. Can it be because of composite view? Or its becaus
 e of objects was added after event handler for mouse was added? Or it's qt weird interaction? Just give
direction to me and I'll try fix it. But I have searched a lot and didn't found anythi
 ng about it(except old report about same bug in osg 2.4).
OSG 3.2, QT 5.4. 

Thank you!

Cheers,
Drake[/img]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62481#62481

Alessandro Terenzi | 26 Jan 12:16 2015
Picon

GLES 2 and models loaded from files without any shader definition

Hi,
I'm trying to develop apps for iOS using GLES 2, so far I managed to build OSG 3.2.1 to use GLES 2 and as long as I
create some geometry and manually load/apply GLES 2 shaders everything is fine. On the other hand I am
experiencing some issues when I try to load models from files (not containing any shader definition - OBJ,
FBX and some OSG/OSGT).

I know that when I use such kind of models then I should provide GLES 2 shaders in order to display them and, to
my understanding, there are 3 possibilities:

1) manually apply shaders to the loaded model

2) use ShaderGenVisitor that generates shaders automatically

3) use Shader Composition

I tried using ShaderGenVisitor, but it looks like that the shaders that are generated are not GLES 2
compliant (because of missing pre-built attributes), and even though attribute aliasing is applied,
not every "gl_" attribute is translated to the corresponding "osg_" version. For instance in the
converted version I have a row like this:

  gl_Position = osg_ModelViewProjectionMatrix * gl_Vertex;

Note that only "gl_ModelViewProjectionMatrix" has been converted but for some reason "gl_Vertex" has
not changed.

Also, there are attributes that are not translated at all, like gl_TexCoord and gl_LightSource.

Searching the forum, it looks like that the ShaderGen approach should be replaced by Shader Composition,
so I wanted to try it but I'd need some directions to start with it...so far I only managed to enable it like this:

  state->SetShaderCompositionEnabled(true);

Where state comes from the viewer's window. But no model is displayed by the viewer.

Actually I am not sure at all that I should use Shader Composition, so my question is: if in my GLES 2 app I want
to display models loaded from files (not containing any shader definition), what should I use and where
should I look at to get started?

Thanks.
Alessandro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62475#62475

Dan Shebounin | 25 Jan 01:34 2015
Picon

compositeView in multithreaded Win32 MFC MDI application

Hi!

We have a mature app, that uses Microsoft's MFC library for GUI management. Application windowing model is MDI.

I have to render a multiple 3D scenes in different MDI childs, which are created elsewhere. So, I should
attach OSG context to existing window.

The threading model of our app is messy, so it is a possibility, that calls will be made from different threads.

Is there any general sources of information, how to use correctly compositeView in this environment, and
how to correctly attach View to MDI child's client window?

Thank you!

Cheers,
Dan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62465#62465

Jeremy | 25 Jan 06:30 2015
Picon

Loading .obj files inefficiently

I am working on a visualization/debugging UI and in the process of displaying the scene graph to a tree view in my gui, I noticed that there appears to be an issue with the .obj file loader that could be improved significantly.

The first problem I came to is seeing that the resulting osg::Geometry node that comes from loading the obj had 191,000+ osg::Geometry::getNumPrimitiveSets(). Turns out, the obj reader creates a osg::DrawArrays for each individual face of the model, and my particular model 191639 faces.

Not a huge deal I thought, I'll add a quick option to the reader to optimize it before returning it, as I'm not so comfortable butchering up the ReaderWriterOBJ::convertElementListToGeometry code as of yet.

if ( localOptions.mergeMeshes )
{
osgUtil::Optimizer opt;
opt.optimize( node, osgUtil::Optimizer::MERGE_GEOMETRY );
}

Surprisingly, this didn't work, and the culprit I found is that the optimizer cannot merge geometry forTRIANGLE_FAN, which is what was being used in ReaderWriterOBJ::convertElementListToGeometry for triangles. Changing this to TRIANGLES allowed the optimizer to merge this huge number of primitive sets down to 1.

Here's a shot of the UI after my fixes where the model has been merged as desired.

Hopefully someone on the dev side can at least change the TRIANGLE_FAN part trivially, though it would be nice if the reader didn't create such bad primitive sets up front.

Thanks
Jeremy
<div><div dir="ltr">I am working on a visualization/debugging UI and in the process of displaying the scene graph to a tree view in my gui, I noticed that there appears to be an issue with the .obj file loader that could be improved significantly.<div><br></div>
<div>The first problem I came to is seeing that the resulting osg::Geometry node that comes from loading the obj had 191,000+ osg::Geometry::getNumPrimitiveSets(). Turns out, the obj reader creates a&nbsp;osg::DrawArrays for each individual face of the model, and my particular model 191639 faces.</div>
<div><br></div>
<div>Not a huge deal I thought, I'll add a quick option to the reader to optimize it before returning it, as I'm not so comfortable butchering up the&nbsp;ReaderWriterOBJ::convertElementListToGeometry code as of yet.</div>
<div><br></div>
<div>
<div>if ( localOptions.mergeMeshes )</div>
<div>{</div>
<div>
<span class="">	</span>osgUtil::Optimizer opt;</div>
<div>
<span class="">	</span>opt.optimize( node, osgUtil::Optimizer::MERGE_GEOMETRY );</div>
<div>}</div>
</div>
<div><br></div>
<div>Surprisingly, this didn't work, and the culprit I found is that the optimizer cannot merge geometry forTRIANGLE_FAN, which is what was being used in&nbsp;ReaderWriterOBJ::convertElementListToGeometry for triangles. Changing this to TRIANGLES allowed the optimizer to merge this huge number of primitive sets down to 1.</div>
<div><br></div>
<div>
<div>Here's a shot of the UI after my fixes where the model has been merged as desired.</div>
<div>
<a href="https://www.dropbox.com/s/07t5zk7hw8jp2r7/Screenshot%202015-01-24%2023.06.38.png?dl=0">https://www.dropbox.com/s/07t5zk7hw8jp2r7/Screenshot%202015-01-24%2023.06.38.png?dl=0</a><br>
</div>
</div>
<div><br></div>
<div>Hopefully someone on the dev side can at least change the TRIANGLE_FAN part trivially, though it would be nice if the reader didn't create such bad primitive sets up front.</div>
<div><br></div>
<div>Thanks</div>
<div>Jeremy</div>
</div></div>
Chris Hidden | 23 Jan 17:26 2015

How to Preserve FBX baked in textures when running running hardware skinning

I run skinning.vert on my fbx model which has rigging.  Ive attached the shader program as in the osg hardware
animation example.

I have a texture that accompanies the hand model in the FBX file that I export from 3Ds max.  If I don't attach
the shader program the hand models show up with the texture fine.  

I assume that when I run the shader on the hands it overrides the texture information.  So my question is, is
there a way to tell the shader not to override existing texture information or can I get the embedded
texture on the fbx hand model and then pass it to the shader, and if so how?

Or is there another approach I should be taking?

Cheers!
/Chris

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62458#62458

Goutham Mudide | 23 Jan 08:00 2015
Picon

How to rotate camera in openscenegraph(Walk Through in Model)?

Hi,

I have loaded 3D Model in my scene and i want to walk through in the world. i achieved
forward,backward,left,right,up and down but i need to rotate my camera at that camera location about
x,y,z but i aam not able to get please help me??

please look at my code which is attached to this topic.

Thank you!

Cheers,
Goutham

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62452#62452

Attachment (Main_WT.cpp): application/octet-stream, 18 KiB
Hi,

I have loaded 3D Model in my scene and i want to walk through in the world. i achieved
forward,backward,left,right,up and down but i need to rotate my camera at that camera location about
x,y,z but i aam not able to get please help me??

please look at my code which is attached to this topic.

Thank you!

Cheers,
Goutham

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62452#62452

Nicolas MORENO | 22 Jan 15:05 2015

[Qt] Create a HUD (by using QGraphicsView / QGraphicsScene )

Hi,

I work on a project using OSG (with OSG Earth). I create HMI with Qt and add OSG (Earth) view using
osgQt::GLWidget devived class (osgEarth::QtGui::ViewerWidget ) and it's work fine.

My application needs a HUD over the OSG widget but when I display QWdiget over the GLWidget, it has a black
background (only when it is over the GLWidget). It's look like Qt can do transparency when OSG widget is
behind. There is a solution for this ?

On the net, I found information about QGraphicsView and QGraphicsScene to make a HUD but when I try to use it,
ma application crash to runtime with a lot of OpenGl error. 

My code looks like :

Code:
_viewerWidget = new GLWidget(viewer);
_viewerWidget->setAutoFillBackground(true);;

_views.clear();
_viewerWidget->getViews( _views );

_viewerWidget->makeCurrent();

QGraphicsView* view = new QGraphicsView();
view->setViewport(_viewerWidget);
view->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);

QGraphicsScene* scene = new QGraphicsScene();
scene->addWidget(new LeftPanel());
view->setScene(scene);

// Add to MainWindow
_ui.widgetForOsg->layout()->addWidget(view);

I have a look to osgQtWidgets example but I don't found how to use correctly QGraphicsView and QGraphicsScene.

Can you help me please ?

Thank you!

Cheers,
Nicolas

PS: sorry for my (low) level of english[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62437#62437


Gmane