Re: [osg-users] Compiling vertext shader fails on Intel

2018-12-18 Thread Christian Buchner
To debug this further, the nvidia driver supports

#pragma optionNV(strict on)

in the shader where it might indicate what could possibly be wrong with the
code  (this is assuming that there is something wrong in the shader code).

Christian



Am Sa., 15. Dez. 2018 um 22:41 Uhr schrieb Chris Hanson <
xe...@alphapixel.com>:

> There are some tricks you can use to trigger the Nvidia/Intel
> autoswitching to force it to run on the NVidia chipset, even if you don't
> set it up in the NVidia control panel.
>
> On Sat, Dec 15, 2018 at 3:56 AM Andrew Cunningham  wrote:
>
>> Hi Chris,
>> I managed to work around the issue by falling back to a slower rendering
>> system. Also it turns out the laptop has a switchable graphics subsystem to
>> nVidia ( which works perfectly) or Intel, so there are two workarounds.
>>
>> I'll check out that validator.
>>
>> Thanks
>>
>> Andrew
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=75312#75312
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
> http://www.alphapixel.com/
> Training • Consulting • Contracting
> 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4
> • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
> Legal/IP • Forensics • Imaging • UAVs • GIS • GPS •
> osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
> iPhone/iPad/iOS • Android
> @alphapixel  facebook.com/alphapixel (775)
> 623-PIXL [7495]
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TriangleStrip mesh is not smooth...

2018-06-07 Thread Christian Buchner
Updating a mesh in real time could be done using some a displacement
mapping in a vertex shader. The height field can be then updated as a
texture.

The base mash would be essentially static and flat, but the z coordinate is
updated on the GPU based on texture input.

Christian




2018-06-04 19:33 GMT+02:00 Mike Raider :

> Hi,
>
> "it kinds seems like an odd thing that are doing,
> shifting and replacing rows for some reason is not normally how one
> manages terrain. Could you take a step back and explain what you are
> trying to achieve in your application w.r.t terrain"
>
> I am just starting to develop a 3D app my usual domain is deep learning
> and searching.  I saw a demo of OSG using a simple terrain and thought I
> could turn my boring 2D app into a sexy 3D app.  I underestimated the
> effort involved.  I use linux named pipe message queue to send real time
> data from my java application to my osg application.  Once in osg I fill my
> terrain matrix as data is received.  The shifting of rows is to move data
> from front to back as data is received.  It works very well and much better
> than my old 2D user interface.
>
> I started this tread trying to solve a mesh problem and fixed that problem
> by cleaning my original data much better.  Now my terrain is looking very
> nice.  Thank you for your comments that made me stop and look at data again.
>
> Your comment 'this is not normally how one manages terrain'.  Probably,
> what approach would you suggest to build a 3d mesh that is filled in real
> time?  Can you point me to an example?
>
> ...
>
> Thank you!
>
> Cheers,
> Mike
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=73960#73960
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Scaling visitor not working as expected

2018-01-09 Thread Christian Buchner
I just checked a recent osg::Drawable header file and it seems
dirtyDisplayList() is deprecated
and has been replaced with dirtyGLObjects(). Relevant snippet follows:

#ifdef OSG_USE_DEPRECATED_API
/** Deprecated, use dirtyGLObjects() instead. */
inline void dirtyDisplayList()
{
dirtyGLObjects();
}
#endif

/** Force a recompile on next draw() of any OpenGL objects associated with
this geoset.*/
virtual void dirtyGLObjects();


2018-01-09 17:57 GMT+01:00 Christian Buchner <christian.buch...@gmail.com>:

>
> Are display lists active in your scene? if so, maybe a dirtyDisplayList()
> call might be required
> on the affected drawables.
>
> drawable->dirtyDisplayList()
>
> As far as I know display lists are still the default in OSG, unless you
> explicitly disable them on
> geometry objects (and possibly enable vertex buffer objects instead, for
> performance reasons)
>
> the corresponding API calls on drawables would be
>
> drawable->setUseDisplayList( false )
> drawable->setUseVertexBufferObjects( true )
>
> you could use a visitor right after loading the scene to switch off
> display lists and enabling
> vertex buffer objects instead.
>
> Christian
>
>
> 2018-01-09 14:58 GMT+01:00 Werner Modenbach <werner.modenb...@texion.eu>:
>
>> Hi all,
>>
>> I'm loading 3ds scenes as subnodes into my scene. The 3ds coordinates are
>> in a different scale than my scene.
>> Usually I would solve this by a transform. But because of internal
>> reasons I need the vertices being
>> in MY coordinate measure.
>> So I wrote a scaling visitor, that multiplies al vertices of geometries
>> by a given factor.
>> That works perfectly fine when loading the 3ds scene:
>> *osg::ref_ptr<osg::Node**>* *node* *=* *osgDB*
>> *::readRefNodeFile(**path**); *
>> *ScaleVisitor* *sv(**initialObjectScale* ***
>> *correctiveObjectScale**); *
>> *node->**accept**(sv); *
>> *addChild**(node); *
>>
>> Unfortunately when rescaling the object after being added as a child this
>> doesn't work any more:
>> *osg::ref_ptr node* *=* *getChild(0);*
>> *ScaleVisitor* *sv(scaleChange);*
>> *node->accept(sv);*
>>
>> The 3ds scene doesn't change size on my screen.
>> The visitor calls:
>> vertices->dirty();
>> geom.dirtyBound();
>>
>> But nothing happens. What am I missing? Deleting the 3ds scene and
>> recreating it from scratch works OK but is very inefficient.
>>
>> Thanks for any hint.
>>
>> - Werner -
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Scaling visitor not working as expected

2018-01-09 Thread Christian Buchner
Are display lists active in your scene? if so, maybe a dirtyDisplayList()
call might be required
on the affected drawables.

drawable->dirtyDisplayList()

As far as I know display lists are still the default in OSG, unless you
explicitly disable them on
geometry objects (and possibly enable vertex buffer objects instead, for
performance reasons)

the corresponding API calls on drawables would be

drawable->setUseDisplayList( false )
drawable->setUseVertexBufferObjects( true )

you could use a visitor right after loading the scene to switch off display
lists and enabling
vertex buffer objects instead.

Christian


2018-01-09 14:58 GMT+01:00 Werner Modenbach :

> Hi all,
>
> I'm loading 3ds scenes as subnodes into my scene. The 3ds coordinates are
> in a different scale than my scene.
> Usually I would solve this by a transform. But because of internal reasons
> I need the vertices being
> in MY coordinate measure.
> So I wrote a scaling visitor, that multiplies al vertices of geometries by
> a given factor.
> That works perfectly fine when loading the 3ds scene:
> *osg::ref_ptr* *node* *=* *osgDB**::readRefNodeFile(*
> *path**); *
> *ScaleVisitor* *sv(**initialObjectScale* ***
> *correctiveObjectScale**); *
> *node->**accept**(sv); *
> *addChild**(node); *
>
> Unfortunately when rescaling the object after being added as a child this
> doesn't work any more:
> *osg::ref_ptr node* *=* *getChild(0);*
> *ScaleVisitor* *sv(scaleChange);*
> *node->accept(sv);*
>
> The 3ds scene doesn't change size on my screen.
> The visitor calls:
> vertices->dirty();
> geom.dirtyBound();
>
> But nothing happens. What am I missing? Deleting the 3ds scene and
> recreating it from scratch works OK but is very inefficient.
>
> Thanks for any hint.
>
> - Werner -
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Access to gl context

2017-11-13 Thread Christian Buchner
Is this the function you're looking for?

osgViewer::GraphicsHandleWin32::getWGLContext
()


I am having some trouble (despite the powers of Google) to find any OSG
example code using getWGLContext()

Christian


2017-11-10 14:33 GMT+01:00 Poojan Prabhu :

> Hi,
>
> We are using shared context, but have custom drawables that use Vertex
> Array Objects. This causes a problem in the case of multiple windows (where
> each is a separate gl context).
>
> We can manage/create vaos depending on the gl context id that we are
> currently rendering with.
>
> But, we can't use context id as reported by render info, because that
> represents the shared context id and not the HGLRC
>
> Prefer to avoid wglGetCurrentContext in each draw call obviously. And we
> _do_ want to use shared contexts.
>
> How can we work around this so that we have access to the HGLRC or an id
> representing it?
>
> Thank you!
>
> Cheers,
> Poojan
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72358#72358
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Warning: Error in reading to jpg images

2017-11-06 Thread Christian Buchner
Could this be caused by a static osg::Image() object (or another static
object that creates the osg::Image in its constructor) that's getting
initialized before the program's main() function is even called? This is
too early, as OSG plugins would not be registered at that point. It might
work with a fully static OSG build (including the JPEG plugin)

Christian


2017-11-06 9:42 GMT+01:00 Robert Osfield :

> Hi Rômulo,
>
> I have had a look at the debug output and the error message is being
> reported prior to any of the OSG messages. I had done a search for the
> warning string in the OSG using:
>
>
> cd OpenSceneGraph
> grep -r "Warning: Error in reading to" .
>
>
> But don't get any hits.  It looks to me like the OSG isn't coming from
> the OSG side.
>
> Robert.
>
> On 4 November 2017 at 22:37, Rômulo Cerqueira
>  wrote:
> > Hi community!
> >
> > I got some problems by loading JPG images using OSG.
> >
> > When I read them directly using osgviewer, the images are loaded with
> success.
> >
> >
> > Code:
> >
> > osgviewer --image /home/romulo/gray_texture_n.jpg
> >
> >
> >
> >
> > However, the problem occurs when I read the images by OSG code, as
> presented in my unitary test code: https://github.com/Brazilian-
> Institute-of-Robotics/simulation-normal_depth_map/blob/master/test/
> NormalMapping_test.cpp
> >
> > I got the following output message:
> >
> > Code:
> >
> > Warning: Error in reading to "/home/romulo/gray_texture_n.jpg".
> >
> >
> >
> >
> > How can I fix this? I will appreciate any information or help on the
> same.
> >
> > Cheers,
> > Rômulo[/code][/b]
> >
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=72307#72307
> >
> >
> >
> >
> > Attachments:
> > http://forum.openscenegraph.org//files/screenshot_from_
> 2017_11_04_19_31_10_130.png
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Obj model visualization using osg

2017-10-11 Thread Christian Buchner
nVidia is about to publish a tool called Virtual Holodeck which has exactly
that use case (CAD models, engineering visualization) in mind. Uses VR and
virtual presence.

It will be made public soon (on Steam I heard), I think interested parties
can currently ask for early access.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Obj model visualization using osg

2017-10-10 Thread Christian Buchner
What you are describing is a highly specialized application, not a generic
3D model viewer.

This application also has a lot of requirements concerning the 3D model
itself. All parts must be explicitly modeled. Most 3D models of cars do not
fulfill this requirement as these would simply consist of a single mesh for
the car's body to speed up rendering. Hidden parts (like the engine) are
not modeled for rendering performance reasons and often back faces of said
mesh are culled.

Furthermore the logic to decide in which order to explode the parts, and in
what direction they need to move in order to not intersect with other parts
is quite complex. It's probably best if this is done manually for each 3D
model.

As one example for such an exploded view of a model, the Steam VR Lab demo
"Robot Repair" comes into my mind. It's fun to look at, as parts are moving
and rotating in exploded view.

Christian


2017-10-10 10:53 GMT+02:00 Jai Singla :

> Hi,
>
> Sorry Robert.
>
> I will again attempt to put my point .
>
> Suppose I have a model of car in osg .ive format
>
> Disassembly mode : To disintegrate car's different parts like steering,
> doors, wheels etc.
>
> and again assembly mode : Integrate all the parts back to original
> position.
>
> Actually, we want to have it for VR kind of stuff.
>
> I am aware of some open source viewers for integration of HMD devices.
> But, actual training or experience purpose this integration /
> disintegration of models will be a great help.
>
>
> Thank you!
>
> Cheers,
> Jai
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72144#72144
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Frame rate improvement

2017-09-22 Thread Christian Buchner
897 ms culling time sounds excessive to me, even for a large scene. Is this
application built in a release configuration of the compiler?

You could attempt a hierarchical grouping of the scene graph nodes with
group objects to speed up the culling, using some kind of space
partitioning algorithm.

Christian



2017-09-22 11:44 GMT+02:00 Ale Maro :

> Hi,
>
> until now I improved visualization performance of my application in
> several way thanks to your suggestions.
> Now I would like to go another step ahead.
>
> May be this is common topics but it is not clear to me how to solve it.
>
> I have a CAD-like application.
> Potentially a scene can contain objects with thousand of sub-objects, each
> one can be managed separately (e.g. I can select, modify or delete a
> sub-object). This means that the scene contains nodes with thousand of
> children and each children is a MatrixTransform with a geometry children.
> Typically children are small geometries and root nodes can be huge
> geometries.
>
> I would like to improve frame rate for this type of scene.
>
> What I see in a sample scene is (view is single threaded):
>
> Cull: ~897 (after some time often it go down to 300/400, I do not know why)
> Draw: ~37
> GPU: ~20
> Frame rate: 1 FPS
>
> The same scene merged in one node gives me:
>
> Cull: ~0.30
> Draw: ~0.45
> GPU: ~29
> Frame rate: 32 FPS
>
> Do you think I can improve the performance without merging nodes?
>
> Thanks a lot.
>
> Ale
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72047#72047
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] A problem of depth on osgText::Text in programmable pipeline

2017-07-14 Thread Christian Buchner
Okay, so you are modifying depth testing by attaching an osg::Depth object
to the stateset... which OSG maps to glDepthFunc() glDepthRange() OpenGL
API calls.

As you are not modifying gl_FragDepth and not using any fragment discard,
the early Z testing would still apply before entering the fragment shader.

But I am not an expert with this, so I will leave it to other people to
jump in with possible explanations for any mismatch between fixed function
and shader pipeline that you are seeing.

Christian


2017-07-14 14:37 GMT+02:00 Yanwei Guo :

> Hi,
>   The code is in the attachment.
>   And the shader files are at end of the code.
>
>   TIA.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71275#71275
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] A problem of depth on osgText::Text in programmable pipeline

2017-07-14 Thread Christian Buchner
I think we need code and screenshots to understand your problem.

I don't know about any "Depth" parameter in OpenGL. I know about a
polygonOffset that affects rendering order for triangles located at similar
Z buffer depths.

Christian


2017-07-10 9:29 GMT+02:00 Yanwei Guo :

> Hi,
>
> I meet such a problem. I put some text nodes in the scene. And they are
> all located on the same plane. I set the 'Depth' in order to control their
> z-order. The result is right at the fixed pipeline version of osg. But at
> the programmable pipeline, the result is not always right.
>   I'm using the osg version 3.2.1. But this problem also exist in the
> latest osg-master, which I get from github.
>
>   Thanks for any help!
>
> Thank you!
>
> Cheers,
> Yanwei
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71110#71110
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CityGML import into OSG or other 3D engines?

2017-07-06 Thread Christian Buchner
Critical, yes. But we have software engineers too ;-)

I coded up a xyz (ASCII Gridded XYZ) file format plug-in for OSG core,
imported height maps and ortho photos and used CityGML2OBJs
<https://github.com/tudelft3d/CityGML2OBJs> to extract the building data.
We get 1km x 1km tiles with buildings in an .obj format which we can import
into Unity, if needed.

I am amazed how much data the City of Hamburg makes available for free.

The only wish I'd have for the OSG Terrain modules is that it generates
meshes with dynamic resolution based on an error metric. Right now I get
uniform meshes.

Christian


2017-07-05 18:19 GMT+02:00 Chris Hanson <xe...@alphapixel.com>:

> If it was a critical application, I probably have some software engineers
> that could update that libCityGML code to work with contemporary data sets.
>
> On Tue, Jul 4, 2017 at 2:44 AM, Christian Buchner <
> christian.buch...@gmail.com> wrote:
>
>> I've tried this, but it fails to parse the cityGML format provided by the
>> City of Hamburg with a parsing error. That library hasn't seen active
>> development since 2010.
>>
>> I've had some moderate success with this Python script to convert the
>> buildings to OBJ format. https://github.com/tudelft3d/CityGML2OBJs
>>
>> Currently I am fiddling with terrain import into OSG
>>
>> Christian
>>
>>
>>
>> 2017-07-04 8:31 GMT+02:00 Aitor Moreno <aitormor...@gmail.com>:
>>
>>> You might find this repo useful: https://github.com/jklimke/libcitygml
>>>
>>> > It was moved to github due to inactivity of the project on google code
>>> (https://code.google.com/p/libcitygml/).
>>>
>>> On Fri, Jun 30, 2017 at 3:11 PM, Christian Buchner <
>>> christian.buch...@gmail.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I was wondering if anyone has come across a solution to import CityGML
>>>> data into an OSG application or into other game engines like Unity (an open
>>>> and documented XML format for storing city geo data)
>>>>
>>>> This could by with osg import plug-ins or with 3rd party applications
>>>> that simply convert the 3D format.
>>>>
>>>> Our use case would be an attempt to bring the open data 3D LOD2 city
>>>> model of Hamburg onto the screen. http://suche.transparenz.hambu
>>>> rg.de/dataset/3d-stadtmodell-lod2-de-hamburg2
>>>>
>>>> If anyone knows about such a solution, please drop a hint. Doesn't
>>>> matter if freeware or commercial - as long as it's reasonably priced.
>>>>
>>>> Christian
>>>>
>>>>
>>>> ___
>>>> osg-users mailing list
>>>> osg-users@lists.openscenegraph.org
>>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>>>> cenegraph.org
>>>>
>>>>
>>>
>>>
>>> --
>>> Aitor Moreno
>>>aitormoreno [@] gmail.com
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>>> cenegraph.org
>>>
>>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
> http://www.alphapixel.com/
> Training • Consulting • Contracting
> 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4
> • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
> Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
> osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
> iPhone/iPad/iOS • Android
> @alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
> 623-PIXL [7495]
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] can OSG deal with BC6 and BC7 compression formats?

2017-07-05 Thread Christian Buchner
Hi,

Can OSG load BC6 (BPTC_FLOAT), *BC7* (BPTC) compressed textures from DDS
files and upload these to the GPU, provided that the graphics hardware and
driver are capable of dealing with this format?

If such support is present, what is the minimum OSG version to support this?

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CityGML import into OSG or other 3D engines?

2017-07-04 Thread Christian Buchner
I've tried this, but it fails to parse the cityGML format provided by the
City of Hamburg with a parsing error. That library hasn't seen active
development since 2010.

I've had some moderate success with this Python script to convert the
buildings to OBJ format. https://github.com/tudelft3d/CityGML2OBJs

Currently I am fiddling with terrain import into OSG

Christian



2017-07-04 8:31 GMT+02:00 Aitor Moreno <aitormor...@gmail.com>:

> You might find this repo useful: https://github.com/jklimke/libcitygml
>
> > It was moved to github due to inactivity of the project on google code (
> https://code.google.com/p/libcitygml/).
>
> On Fri, Jun 30, 2017 at 3:11 PM, Christian Buchner <
> christian.buch...@gmail.com> wrote:
>
>> Hi all,
>>
>> I was wondering if anyone has come across a solution to import CityGML
>> data into an OSG application or into other game engines like Unity (an open
>> and documented XML format for storing city geo data)
>>
>> This could by with osg import plug-ins or with 3rd party applications
>> that simply convert the 3D format.
>>
>> Our use case would be an attempt to bring the open data 3D LOD2 city
>> model of Hamburg onto the screen. http://suche.transparenz.hambu
>> rg.de/dataset/3d-stadtmodell-lod2-de-hamburg2
>>
>> If anyone knows about such a solution, please drop a hint. Doesn't matter
>> if freeware or commercial - as long as it's reasonably priced.
>>
>> Christian
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
>
> --
> Aitor Moreno
>aitormoreno [@] gmail.com
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] CityGML import into OSG or other 3D engines?

2017-06-30 Thread Christian Buchner
Hi all,

I was wondering if anyone has come across a solution to import CityGML data
into an OSG application or into other game engines like Unity (an open and
documented XML format for storing city geo data)

This could by with osg import plug-ins or with 3rd party applications that
simply convert the 3D format.

Our use case would be an attempt to bring the open data 3D LOD2 city model
of Hamburg onto the screen.
http://suche.transparenz.hamburg.de/dataset/3d-stadtmodell-lod2-de-hamburg2

If anyone knows about such a solution, please drop a hint. Doesn't matter
if freeware or commercial - as long as it's reasonably priced.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Limit rendering a texture up to a given pixel

2017-06-29 Thread Christian Buchner
A uniform specific to each tile that defines the dimensions for the valid
part of the tile? The shader would get the gl_FragCoord, compare it against
the threshold and return a transparent color for pixels outside the valid
bounds.

Christian


2017-06-29 11:28 GMT+02:00 Bruno Oliveira :

> Hello,
>
>
> I have a big image to be rendered (100k pixels each side), hence I am
> partitioning that image in Image Tiles.
>
> Each tile has 256 x 256 pixels. Each tile consists of a osg::Geometry
> quad, with a texture bound to it. I put all those tiles in an osg::Group.
> I use a fragment shader that is global to all tiles (I apply it to the
> osg::Group's StateSet). It is a very simple shader and consists only of a
> texture lookup in each tile:
>
> gl_FragColor = texture2D(texture, vec2(x, y));
>
> The problem now is that in the image limits, some extra pixels are
> rendered (because my images' size is not multiple of 256). For instance, if
> my image size is 1000 pixels in x, the last 24 pixels are not valid and
> shall be transparent (because it will have 4 tiles = 256 * 4 pixels =
> 1024). The last tile should only be rendered up to the pixel 232 ( 256 - 24
> = 232)
>
> What is the best way of limiting my rendering up to that pixel, WITHOUT
> defining a new shader for EVERY tile? ( I really want a single fragment
> shader bound to the whole group for performance reasons)
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Cannot rotate image on Windows 10 with osg 3.2.3

2017-06-28 Thread Christian Buchner
Maybe screen rotation by 90, 180 or 270 degrees was meant. In this case OSG
might have stopped working.

2017-06-28 9:45 GMT+02:00 Robert Osfield :

> Hi Clement,
>
> I'm not a Windows users so can't help with the specifics, but the
> information you provide is so vague it's impossible to know what you
> mean.  Could you start off by explaining what exactly you mean by
> "rotate image" and how you attempt to do it.
>
> Robert.
>
> On 28 June 2017 at 07:02,   wrote:
> > Hi,
> >
> >   Recently, I upgraded my machine to dell e7470 with windows 10.  I am
> using osg 3.2.3.  When I tried to rotate the image, I got the following
> error.  Please help.
> >
> > Unhandled exception at 0x7fff4080ab96 (osg100-osgViewerd.dll) in
> myprogram.exe: 0xC005: Access violation reading location
> 0x.
> >
> >
> >
> >
> > Regards,
> > Clement Chu
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [Repost while forums down] Convert from screen space to world space and back to screen space

2017-06-26 Thread Christian Buchner
The thing is... a 2D pixel on screen is essentially a line segment in 3D
(contained within the view frustum). After manipulating this line with a
rotation matrix, this would most likely become a line in 2D space too.

Are you interested in the closest intersection with an object instead? That
might not always return a valid result if there's no object intersecting.

​
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to add hello world/additional project to existing compiled OSG

2017-06-20 Thread Christian Buchner
For smaller projects, consider adding your own code as an additional
"example" by extending the CMakeLists.txt file in the examples folder, and
creating another subdirectory in it (possibly as a copy of an existing
example project. Don't forget to edit its CMakeLists.txt file too).

I found this a useful (but dirty) way to prototype new projects.

Christian


2017-06-13 12:13 GMT+02:00 Muniraj Sunderavel :

> Thanx for the reply Robert and Jinrui Sang
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71041#71041
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to convert osgb files to old version

2017-06-19 Thread Christian Buchner
osgconv is always built against one specific OSG version.  If it can read a
newer osgb format, it probably wouldn't write an older format. If it writes
an old format, it can't read the newer format properly.

So you would have to go through an intermediate file format, say, e.g.
.obj, Collada (DAE)
 and use the new osgconv version for reading and converting to DAE and an
older osgconv version for converting from DAE to osgb.

My recommendation is to use the binary osgb, ive formats only where
performance absolute requires this and where such file versioning issues
will not occur.

Christian


2017-06-19 2:56 GMT+02:00 tianzjyh :

> Hi, Yu,
> You can manually use osgconv.exe to convert between model files.  Run
> "osgconv.exe --help" for help.
> Also, u can use osgDB::readNodeFile() and osgDB::writeNodeFile()
> respectively with filenames with proper extension, such as ".osg" and
> ".osgb".
> --
>
> Cheers,
> ---
> TianZJ
>
>
> At 2017-06-18 16:14:01, "Haojia Yu"  wrote:
> >Hi,
> >
> >I am working on an application based on osg 3.5.3, and i use it to generate 
> >lots
> >of modles saved as osgb format. However, there are some other softwares based
> >on older osg versions, maybe osg 3.4.0 or 3.0.0 or even earlier, and they
> >...
>
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Fwd: Slow down with shared nodes

2017-03-08 Thread Christian Buchner
I've recently written some code to merge individual triangle strips
by joining them using some degenerate (zero area) triangles.

One issue that I've run into is that in wireframe mode this generated
some very odd looking artifacts.

Find the code here. It may need some adaptation for your use case.
http://forum.openscenegraph.org/viewtopic.php?t=16412

Christian


2017-03-08 15:32 GMT+01:00 Robert Osfield :

> Hi Andre,
>
> Thanks for the file.  I've just tried it on my Kubuntu 16.04. NVidia
> 760 with the OSG-3.4 branch and I see decent performance, the draw
> dispatch is bit more expensive than I'd usually expect for a model of
> this size but it's not widely expensive like you are seeing.
>
> The dataset itself looks like the large number of PrimitiveSets is
> very high for the number of vertices in each osg::Geometry.  The use
> of very short triangle strips rather than a single DrawElementsUShort
> GL_TRIANGLES is the core of what is wrong with how the osg::Geometry
> have been generated.
>
> The source of this issue may be down to the .obj or perhaps original
> data being very poorly set up.
>
> Robert.
>
> On 8 March 2017 at 09:39, Andre Normann  wrote:
> > Hi Robert,
> >
> > I used 3.2.3 to load the obj files and converted it into ive format. In
> > 3.2.3 I load the ive file, build my scenegraph and I get 60 fps. When I
> now
> > load the same ive file into 3.4.0, build my scenegraph, I get the slow
> down.
> >
> > - There must be something which is causing the slow down in
> OpenSceneGraph
> > - The obj loader is creating a lot of primitive sets, which is not
> optimal.
> > In near future I will try to fix that issue.
> >
> > I created a test file. Simply do an "osgviewer SlowDownTest.zip".
> >
> >
> >
> > 2017-03-08 9:45 GMT+01:00 Robert Osfield :
> >>
> >> Hi Andre,
> >>
> >> On 8 March 2017 at 08:40, Andre Normann 
> wrote:
> >> > hopefully I am getting closer. I find out, that the source model might
> >> > be
> >> > the problem. I exported an obj file from Bentley Microstation and
> >> > imported
> >> > into OpenSceneGraph. When I now export the scene into an osg file, I
> see
> >> > a
> >> > lot of PrimiteSets (e.g. > 1000). So I will end up with a lot calls to
> >> > DrawElementsUShort. When I load the obj file into 3dsmax convert it
> into
> >> > a
> >> > fbx file and reexport it from OpenSceneGraph into an osg file, I have
> >> > only
> >> > one PrimitiveSet with one DrawArrays call. This file is working well
> in
> >> > 3.4.0 with sharing nodes.
> >> >
> >> > So I guess there might be a problem with sharing osg::Geometry which
> has
> >> > a
> >> > lot of primitive sets. In 3.2.3 it was working well. What do you
> think?
> >>
> >> It sounds like data import path is the crucial part, perhaps changes
> >> to the .obj plugin between 3.2.3 and 3.4.0 are what is causing the
> >> difference.
> >>
> >> Doing an:
> >>
> >> osgconv myfile.obj myfile.osgt
> >>
> >> In 3.2.3 and 3.4.0 will tell you the differences that the plugin and
> >> any optimization passes are making.
> >>
> >> Is there any chance you could share an example of one of these .obj
> >> files that is causing the performance problems?
> >>
> >> Robert.
> >
> >
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Merge Shader::Program from differents node kits.

2017-03-01 Thread Christian Buchner
Pragmatic shader composition was introduced in OSG 3.4 only.   Awkward...

It seems that you will have to do a manual merging of the shaders and
uniform variables unless you are able to upgrade OpenSceneGraph.

Christian


2017-02-28 16:53 GMT+01:00 Dario Minieri :

> Hi,
>
> I'm planning to using osgVegetation (https://github.com/leadcoder/
> osgVegetation) with osgOcean.
>
> Unfortunately, both use a lot of shaders and there are obviously problems
> in the underwater visualization because osgVegetation shader pipeline
> (which generates the vegetation billboard instances) overwrites the
> osgOcean underwater program. So the vegetation don't get the underwater
> effects (dof, fog, scattering, etc...).
>
> Normally, I proceed to integrate physically the shaders, merging 2 vertex
> and fragment shader into one program. In this case it's a terrible
> prospective because they are huge node kits (not only shaders, but a lot of
> osg layers above).
>
> So, can you suggest to me a way to procede? I know that similar problems
> come out time to time but right now I'm not able to figure out a way. I'm
> using OSG 3.2.3 and I can't use newer version for now.
>
> Thank you!
>
> Cheers,
> Dario
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70362#70362
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Check if sampler2D is valid in fragment shader

2017-01-03 Thread Christian Buchner
Pragmatic shader composition was added to the repository around Feb 13,
2015, and most likely into OSG 3.4 and newer only.

A link to the relevant thread started by Robert Osfield is here:
http://markmail.org/message/mjxjn4vujpvz3wfz#query:+page:1+mid:vogwv7uwhoefcln6+state:results


2017-01-03 14:48 GMT+01:00 Rômulo Cerqueira :

> Hi Sebastian,
>
> I have used the last openscenegraph stable package in ubuntu (version
> 3.2.3 - https://launchpad.net/ubuntu/+source/openscenegraph), and there
> is no setDefine() method in osg::StateSet (only for 2.4 and newer). There
> is a different way?
>
> Cheers,
> Rômulo
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69840#69840
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] code for merging tri strips in a cache friendly way

2017-01-03 Thread Christian Buchner
When loading .obj files (e.g. exported from Blender) into OSG - especially
those that are exported with the "group by material" option - you might
find a lot of individual tri strips in the resulting OSG geometry.

Here is a piece of code (a node visitor) that will join these tri strips
into a single large strip, taking into account cache locality aspects: The
tri strips are sorted by their median vertex index before joining. This can
be useful to improve the performance of hardware instancing.

Some C++11 language features may be used in the code (range based for and
others). Feel free to modify/use/improve on this code.

Christian

/**
 * A visitor that merges triangle strip drawables by creating some
degenerate triangles.
 */
class TriStripMergeVisitor : public osg::NodeVisitor
{
public:

TriStripMergeVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {}

virtual void apply(osg::Node& node)
{
traverse(node);
}

virtual void apply(osg::Geode& node)
{
for(unsigned int i=0;i();
if (geo != NULL) apply(*geo);
}

virtual void apply(osg::Geometry& geometry)
{
osg::Geometry::PrimitiveSetList  =
geometry.getPrimitiveSetList();

// count the number of tri strips
int num_tristrips = 0;
unsigned int total_indices = 0;
std::vector< std::pair >
tristrips;
bool first = true;
for (auto  : psl)
{
osg::DrawElements *de =
dynamic_cast(ps.get());
if (de != NULL)
{
if (de->getMode() == osg::PrimitiveSet::TRIANGLE_STRIP)
{
num_tristrips++;
std::vector indices;
unsigned int num_indices = de->getNumIndices();
if (!first) total_indices += 2;
total_indices += num_indices;
indices.reserve(num_indices);
for (unsigned int i=0; i < num_indices; i++)
indices.push_back(de->index(i));

std::vector sorted_indices(indices);
std::sort(sorted_indices.begin(), sorted_indices.end());
int median_index =
sorted_indices[sorted_indices.size()/2];
tristrips.emplace_back(indices, median_index);
first = false;
}
}
}

// merge all tri-strips in a cache-friendly manner
if (num_tristrips >= 2)
{
std::sort(tristrips.begin(), tristrips.end(),
[](std::pair ,
std::pair ) {
return b.second > a.second;
});

std::vector< unsigned int > joined_tristrips;
joined_tristrips.reserve(total_indices);
first = true;
for (auto ts : tristrips)
{
if (!first)
{
joined_tristrips.push_back(joined_tristrips.back());
joined_tristrips.push_back(ts.first.front());
}
joined_tristrips.insert(joined_tristrips.end(),
ts.first.begin(), ts.first.end());

first = false;
}

unsigned int max_element =
*std::max_element(joined_tristrips.begin(), joined_tristrips.end());
osg::ref_ptr new_de;
if (max_element < 256)new_de = new
osg::DrawElementsUByte(osg::PrimitiveSet::TRIANGLE_STRIP,
joined_tristrips.size());
else if (max_element < 65536) new_de = new
osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLE_STRIP,
joined_tristrips.size());
else  new_de = new
osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLE_STRIP,
joined_tristrips.size());
for (unsigned int i=0; i < joined_tristrips.size(); i++)
new_de->setElement(i, joined_tristrips[i]);

osg::Geometry::PrimitiveSetList new_psl;
new_psl.push_back(new_de);

// append all non tri strip geometry
for (auto  : psl)
{
osg::DrawElements *de =
dynamic_cast(ps.get());
if (!(de != NULL && de->getMode() ==
osg::PrimitiveSet::TRIANGLE_STRIP))
 new_psl.push_back(ps);
}

geometry.setPrimitiveSetList(new_psl);
}
}
};
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] wireframe mode and degenerate triangles

2016-12-30 Thread Christian Buchner
Hi all,

I have just optimized a human model that had around 150 individual
GL_LINE_STRIP drawables by adjoining these. This requires doubling the last
vertex of a strip and the first vertex of the next strip which is to be
appended, generating a couple of degenerate triangles.

The model still renders fine and the OSG stats viewer now shows a much
lower drawable count.

A quirk appears when rendering this in wireframe mode (using the 'w' hotkey
implemented in one of the builtin Event handlers). I assume this enables a
GL PolygonMode of GL_FRONT_AND_BACK, GL_LINE. Now the degenerate triangles
are still rendered, making the model look broken (arms look fused to the
body).

Here's my question: Shouln't wireframe rendering mode hide degenerate
triangles, as they wouldn't be passed on to the rasterizer in any case?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Tearing hair out over simple GLSL instancing

2016-12-30 Thread Christian Buchner
Does your vertex shader code perform any lighting calculations?

I remember that in my instancing vertex shader code I had to explicitly
perform required lighting calculations for ambient, diffuse, specular
components (the usual Blinn-Phong lighting equations) and set the vertex
colors accordingly.

Christian

2016-12-29 22:23 GMT+01:00 Andrew Cunningham :

> Hi guys,
> Can you help me out with this one more time:)
>
> As I said, I am now able to draw my geometry ( a simple square) using
> hardware instancing. It works perfectly with excellent performance for
> millions of squares- except for one thing.
>
> Now I want to light the squares. I have turned on lighting, assigned a
> normal array to the geometry being instanced and assigned material colors,
> but I get  unlit 'black squares' while the rest of my scene is lit just
> fine. Clearly something to do with hardware instancing using the vertex
> shader.
>
> Do I need to add a fragment shader? I am a bit lost here.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69801#69801
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Check if sampler2D is valid in fragment shader

2016-12-29 Thread Christian Buchner
> I will receive the final scene with or without textures

You could traverse the scene graph and check the state sets to see if they
bind a texture to a texture unit.
Then depending on these findings, choose the correct shader code.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-22 Thread Christian Buchner
Just some wild guesses:

You might have to enable blending in the state set, and set an appropriate
blend function as (depending on whether your projective texturing is done
in a 2nd render pass or not)

On hardware that does not support opengl border colors
(ARB_texture_border_clamp) in hardware, you might have to explicitly set
the texture's border pixels to a transparent color, turning a 512x512 image
into effectively a 510x510 one.

Christian


2016-12-22 16:03 GMT+01:00 Ekaterina Fokina :

> Thank you your answers!
>
> Attached there is a printscreen what I get.
> For the terrain I am using lz.osgt and the image for the texture file is
> osg128.png.
>
> I set the border to transparent, but unfortunatelly it didn´t help...
>
> Guys, could you please give me a hint how is it possible to relocate the
> projected image on the terrain to a specific location on that terrain?
> I am still confused how to set the texture coordinats uning shaders.
>
> Thank you!
>
> Cheers,
> Ekaterina
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69738#69738
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] About Boat Movement

2016-12-19 Thread Christian Buchner
Have an article about the topic in the context of game programming. The
water surface is modeled as a mesh.

http://www.gamasutra.com/view/news/237528/Water_interaction_model_for_boats_in_video_games.php

As you see, it's complicated subject matter even at the level of
abstraction provided here.

Also it is a generic simulation topic not related to OSG. The OSG related
parts will be limited to providing an appropriate matrix transform to put
the boat into its final position (including any rotation) in 3D space.

Christian


2016-12-19 12:24 GMT+01:00 Christian Buchner <christian.buch...@gmail.com>:

>
> To do it correctly, you need physics simulation (mass of ship, buoyancy
> forces as a function of immersion depth at different hull sections, water
> forces due to flow currents and kinetic energy of the waves hitting the
> ship)
>
> You could simplify this problem into a mass-spring system with lots of
> damping.
>
> Again, your question is worded far too generic to provide a good answer.
>
> "Fire topedoes!"
>
> Christian
>
>
> 2016-12-19 11:43 GMT+01:00 Rambabu Repaka <ramboram...@gmail.com>:
>
>> Hi,How to make Boat oscilate whenver water hits in osg ?
>>
>> ...
>>
>> Thank you!
>>
>> Cheers,
>> Rambabu
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=69707#69707
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] About Boat Movement

2016-12-19 Thread Christian Buchner
To do it correctly, you need physics simulation (mass of ship, buoyancy
forces as a function of immersion depth at different hull sections, water
forces due to flow currents and kinetic energy of the waves hitting the
ship)

You could simplify this problem into a mass-spring system with lots of
damping.

Again, your question is worded far too generic to provide a good answer.

"Fire topedoes!"

Christian


2016-12-19 11:43 GMT+01:00 Rambabu Repaka :

> Hi,How to make Boat oscilate whenver water hits in osg ?
>
> ...
>
> Thank you!
>
> Cheers,
> Rambabu
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69707#69707
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to render (sub-)graph only into depth buffer?

2016-12-18 Thread Christian Buchner
There's also an osgoit sample program that renders a subgraph (a
non-transparent truck model) first, and then performs depth peeling render
passes (ping-pong) of the other transparent objects. The depth buffer
contents from the initial solid pass are copied via blit from one FBO to
the next one. This sample code uses Frame Buffer Objects, if I remember
correctly.

Christian


2016-12-17 10:47 GMT+01:00 Robert Osfield :

> HI Hartwig,
>
> What you describe is a multiple pass render to texture, the way one
> does this with the OSG is to use an osg::Camera placed as slave Camera
> or a Camera placed in the scene graph.  The Camera has a setRederOrder
> method this tells the cull traversal what order to draw things in.
> Have a look at the osgVolume::MultipassTechnique for an example of
> rendering to a depth texture and then using the result in the main
> pass.
>
> Robert.
>
> On 17 December 2016 at 08:14, Hartwig Wiesmann
>  wrote:
> > Hi,
> >
> > sorry, my fault.  I messed up the rendering order. If the sphere is
> rendered first, it works.
> >
> > Thank you!
> >
> > Cheers,
> > Hartwig
> >
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=69699#69699
> >
> >
> >
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Offscreen rendering with multisampling

2016-12-09 Thread Christian Buchner
Could it be that global graphics driver settings might override your
application choice for multisampling?

On Windows, sometimes you may have to set the graphics driver OpenGL
quality or antialiasing settings to "Application controlled" - details are
possibly depending very much on your particular graphics card vendor.

Christian



2016-12-09 12:21 GMT+01:00 Wojciech Lewandowski :

> Well...If you don't need too big resolution, you may try to simply
> oversample. Set PBUFFER at 2x or 4x of your desired res. Render and then
> downsample to your image res. Multisampling does not differ much from it
> (it just more effective with lower number of samples and its randomized
> sample positions).
>
> Cheers,
> Wojtek
>
>
> 2016-12-09 11:46 GMT+01:00 Krzysztof Rahn  openscenegr...@gmail.com>:
>
>>
>> Wojtek wrote:
>> > Hi Krzysztof,
>> >
>> > Not sure about PBO but FBO support in OSG works with multisampling.
>> > See
>> >
>> >
>> >
>> > Camera::attach(
>> >   BufferComponent buffer,
>> >   osg::Texture* texture,
>> >   unsigned int level,
>> >   unsigned int face,
>> >   bool mipMapGeneration,  unsigned int multisampleSamples,
>> >   unsigned int multisampleColorSamples)
>> >
>> >
>> > method.
>> >
>> >
>> > Cheers,
>> >
>> > Wojtek Lewandowski
>> >
>> >
>> > 2016-12-09 11:01 GMT+01:00 Krzysztof Rahn > (Krzysztof.Rahn+)>:
>> >
>> > > Hello everyone,
>> > >
>> > > I'm working on a company project that displays navigation maps for
>> ships with OpenSceneGraph.
>> > > The product we develop is a library that generates map images, so a
>> customer (developer)
>> > > can use our library to develop its own navigation system.
>> > >
>> > > This requires to generate a offscreen image and if possible an
>> antialiased one.
>> > > Unfortunately we can not generate a antialiased offscreen image.
>> > >
>> > > I already tried
>> > >
>> > > > osg::DisplaySettings::instance()->setNumMultiSamples(4);
>> > > >
>> > >
>> > > and
>> > >
>> > > > traits->samples = 4;
>> > > >
>> > >  to create a osg::GraphicsContext
>> > > but this only works with a window generated from OpenSceneGraph or
>> > > with a embedded context (osgViewer::GraphicsWindowEmbedded()).
>> > >
>> > > I know we can enable "GL_LINE_SMOOTH". This is what we use at this
>> moment and it is
>> > > working with offscreen rendering but we really need multisampling for
>> better results (or any other form of anitaliasing).
>> > >
>> > > I created a small peace of C++ sourcecode on a Linux system that does
>> offscreen rendering (with a pbuffer)
>> > > into a tga image file (I think you also need OpenSceneGraph plugins
>> for that to work),
>> > > so you can roughly see how we use it at this moment (without
>> GL_LINE_SMOOTH to keep it simple).
>> > >
>> > > Of course I looked into the examples and this peace of code is based
>> of one of them.
>> > > But I could not spot anything in the examples that could help me.
>> > > I also searched in the forum on this topic but most threads about
>> offscreen rendering don't consider if multisampling is enabled.
>> > >
>> > > I would really appreciate if someone could help us with this small
>> code in the right direction
>> > > or make any suggestion if there is any other way to solve this if
>> OpenSceneGraph is not able to do this.
>> > >
>> > > A main.cpp and a CMakeLists.txt should be attached to this post.
>> > >
>> > > Thank you very much,
>> > >   Kris
>> > >
>> > > --
>> > > Read this topic online here:
>> > > http://forum.openscenegraph.org/viewtopic.php?p=69644#69644 (
>> http://forum.openscenegraph.org/viewtopic.php?p=69644#69644)
>> > >
>> > >
>> > >
>> > >
>> > > Attachments:
>> > > http://forum.openscenegraph.org//files/cmakelists_664.txt (
>> http://forum.openscenegraph.org//files/cmakelists_664.txt)
>> > > http://forum.openscenegraph.org//files/main_667.cpp (
>> http://forum.openscenegraph.org//files/main_667.cpp)
>> > >
>> > >
>> > > ___
>> > > osg-users mailing list
>> > >  ()
>> > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>> cenegraph.org (http://lists.openscenegraph.o
>> rg/listinfo.cgi/osg-users-openscenegraph.org)
>> > >
>> >
>> >
>> >  --
>> > Post generated by Mail2Forum
>>
>>
>> I guess I will need to test how FBO work. I though that pbuffer and FBO
>> will not make a big difference.
>> Thank you.
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=69649#69649
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>

Re: [osg-users] x and y coordinates

2016-12-02 Thread Christian Buchner
Basic OpenGL utilities libraries like GLUT that provide some mouse events
in the mouseEvent(int button, int state, int x, int y); function, but this
functionality is not native to OpenGL.

Event->x()/y() sounds more like an OSG event handling, and there are plenty
of OSG examples out there that process mouse and keyboards events.

Christian


2016-12-02 10:20 GMT+01:00 Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de>:

> Hi,
>
> Hi,In opengl we can get event->x() and event->y() mouse events are
>> there.For osg how to get these events.
>>
> Thats non-sense. OpenGL doesn't deal with input events.
> See the osgkeyboardmouse example.
>
> Apart from the usual "try to use your brain first and present some
> questions with actual effort put into them". (This btw. starts with the
> topic-name):
>
> First advice: Check the examples first. Most of them are named very and
> executing them might give you an idea if they are what you are looking for.
>
> Second advice: There is a mailing/list, use the search functionality.
> Chances your question has been asked exist...
>
> Also you've been asking a MouseEvent-related questions a couple of days
> before. Obviously you didn't even bother to look into the
> trackball-manipulator. If you're following the bread-crumbs left there
> (parent-classes OrbitManipulator and the StandardManipulator, you will find
> a lot of example code how to use mouse events.
>
> Cheers
> Sebastian
>
>
>
>
>> ...
>>
>> Thank you!
>>
>> Cheers,
>> Rambabu
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=69577#69577
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to render the image without reducing its size.?

2016-11-22 Thread Christian Buchner
Your OpenGL implementation might signal a maximum texture size of 4096.

Which is why there is no alternative to downsizing it.

There is also an 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?

Christian



2016-11-22 13:58 GMT+01:00 Uma Devi Selvaraj :

> Hi,
>
>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.
>
>
> //required header files
>
> int main(int argc,char**argv)
> {
>
> osg::ref_ptr image;
> image = osgDB::readImageFile("C:\\Users\\mcw\\Desktop\\DemModel.
> tif.gdal");
> std::cout << "Image info are " << image->s() << "\n"  <<"\n"  if (!(image.valid()))
> {
> std::cout << "Unable to read image file " << std::endl;
> getchar();
> return 0;
> }
>
> osg::ref_ptr geode =(osg::createGeodeForImage(image));
>
> osg::Texture2D *texture = new osg::Texture2D();
> texture->setFilter(osg::Texture::MIN_FILTER,
> osg::Texture::LINEAR);
> texture->setFilter(osg::Texture::MAG_FILTER,
> osg::Texture::LINEAR);
> texture->setWrap(osg::Texture::WRAP_R, osg::Texture::REPEAT);
> texture->setResizeNonPowerOfTwoHint(false);
> texture->setImage(image);
> texture->setBorderColor(osg::Vec4d(0.4f, 0.5f, 0.6f, 1.0f));
> osg::StateSet* stateset = new osg::StateSet;
>
> stateset->setTextureAttributeAndModes(0, texture,
> osg::StateAttribute::ON);
>
> geode->setStateSet(stateset);
> osgViewer::Viewer viewer;
> viewer.setSceneData(geode.get());
> getchar();
> return viewer.run();
>
> }
>
> ...
>
> Thank you!
>
> Cheers,
> Uma
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69470#69470
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Rotation of a node starts clockwise and ends counter-clockwise.

2016-11-17 Thread Christian Buchner
It would appear the original source of the tank is the Naval Postgraduate
School tutorials page:

http://trac.openscenegraph.org/documentation/NPSTutorials/

This is from 2004. 12 years go. Man, time flies.

Christian


2016-11-17 15:25 GMT+01:00 Christian Buchner <christian.buch...@gmail.com>:

> As for an "osgtank" model, I have no idea what you are talking about,
>> it's not anything to do with the core OpenSceneGraph source code
>> distribution or the OpenSceneGraph-Data distribution.  Again this is
>> an issue of just throwing out a question without any proper context.
>>
>
> I suspect OP is looking at some older Wiki examples for OSG like this
>
> http://trac.openscenegraph.org/projects/osg//wiki/Support/Tutorials/
> FileLoadingAndTransforms
> http://trac.openscenegraph.org/projects/osg//wiki/
> Support/Tutorials/FindingNodes
>
> This (and related) pages talk about a tank model. Some of the given code
> contains a file name
> t72-tank_des.flt
>
> which according to Google can be found e.g. on github here:
> https://github.com/petercheng00/Indoor-Modeling/
> blob/master/NPS_Tutorials_src/NPS_Data/Models/t72-tank/t72-
> tank_des.flt?raw=true
>
> Also I did find some rather dated code that generates a tank model
> procedurally as a Geode
>
> http://trac.openscenegraph.org/projects/osg/browser/
> OpenSceneGraph/trunk/examples/osghangglide/tank.cpp?rev=1697
>
> Christian
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Rotation of a node starts clockwise and ends counter-clockwise.

2016-11-17 Thread Christian Buchner
>
> As for an "osgtank" model, I have no idea what you are talking about,
> it's not anything to do with the core OpenSceneGraph source code
> distribution or the OpenSceneGraph-Data distribution.  Again this is
> an issue of just throwing out a question without any proper context.
>

I suspect OP is looking at some older Wiki examples for OSG like this

http://trac.openscenegraph.org/projects/osg//wiki/Support/Tutorials/FileLoadingAndTransforms
http://trac.openscenegraph.org/projects/osg//wiki/Support/Tutorials/FindingNodes

This (and related) pages talk about a tank model. Some of the given code
contains a file name
t72-tank_des.flt

which according to Google can be found e.g. on github here:
https://github.com/petercheng00/Indoor-Modeling/blob/master/NPS_Tutorials_src/NPS_Data/Models/t72-tank/t72-tank_des.flt?raw=true

Also I did find some rather dated code that generates a tank model
procedurally as a Geode

http://trac.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/examples/osghangglide/tank.cpp?rev=1697

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [3rdparty] QVR: Virtual Reality library that supports OSG with Vive, Rift, OSVR, and others

2016-11-10 Thread Christian Buchner
This project is highly interesting, but doesn't the single threaded
approach per GPU cost a bit of performance
(FPS) in very complex scenes? Achieving stable 90 FPS is critical in VR.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] delay-loading OSG DLLs?

2016-10-26 Thread Christian Buchner
Hi, here is my code that actually enables the delay loading to function.
First I modify the PATH environment variable to actually contain the
folders where the DLLs are expected to be found.

Then using __HrLoadAllImportsForDll() I get all the import symbols from the
delay loaded DLLS (which have to be given explicitly, file by file) which
allows OSG to run successfully.

Without that second step, no graphics context could be initialized.

The only remaining issue is that in case a delay-loaded DLL isn't found at
runtime, the function __HrLoadAllImportsForDll() crashes internally
somewhere, and not even the try{} catch {} block can prevent this. I wish I
could somehow catch this.

#include 
#include 

#include 
#include 
#include 


// the DLL search paths to prepend to PATH
std::vector path_list = {
L"%CD%\\..\\deps_v2\\OSG-3.4\\bin",
L"%CD%\\..\\deps_v2\\OSG-3.4\\3rdParty\\bin" };

// prepend the PATH environment variable with the folders specified
above
wchar_t pwd[512];
_wgetcwd(pwd, sizeof(pwd) / sizeof(wchar_t));
std::wstringstream ss;
for (auto path : path_list)
{
// replace %CD% with the actual current working directory
path = std::regex_replace(path,
std::basic_regex(L"\\%CD\\%"), pwd);
ss << path << ";";
}
ss << _wgetenv(L"PATH");
ss << '\0';
const std::wstring env = ss.str();
SetEnvironmentVariable(L"PATH", env.c_str());

//
// Delay-load all import symbols from the OSG DLLs now.
//

#if _DEBUG
std::vector dll_list =
{ "osg130-osgd.dll", "osg130-osgDBd.dll", "osg130-osgViewerd.dll",
"ot20-OpenThreadsd.dll" };
#else
std::vector dll_list =
{ "osg130-osg.dll", "osg130-osgDB.dll", "osg130-osgViewer.dll",
"ot20-OpenThreads.dll" };
#endif

for (auto dllname : dll_list)
{
fprintf(stderr, "Delay-loading imports from %s\n",
dllname.c_str());
bool failed = true;
try {
failed = FAILED(__HrLoadAllImportsForDll(dllname.c_str()));
}
catch (...)
{
}
if (failed) {
   fprintf(stderr, "Delay-loading imports from %s failed!\n",
dllname.c_str());
exit(1);
}
}

init = true;
}




2016-10-25 19:24 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>:

> Hi,
>
> I was wondering if anyone of you has successfully used the /DELAYLOAD
> linker option with the OSG DLLs on Windows.
>
> For me, attempting this causes the creation of the graphics context to
> fail, because
> windowingSystemInterfaceRef() called by createGraphicsContext() returns an
> invalid reference.
>
> Any clues about how to fix this possibly? It seems that maybe constructors
> for static objects inside the OSG DLLs aren't getting called as required.
>
> Christian
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] delay-loading OSG DLLs?

2016-10-25 Thread Christian Buchner
Hi,

I was wondering if anyone of you has successfully used the /DELAYLOAD
linker option with the OSG DLLs on Windows.

For me, attempting this causes the creation of the graphics context to
fail, because
windowingSystemInterfaceRef() called by createGraphicsContext() returns an
invalid reference.

Any clues about how to fix this possibly? It seems that maybe constructors
for static objects inside the OSG DLLs aren't getting called as required.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] bug: new OpenSceneGraph-3.5.5 threading...

2016-10-10 Thread Christian Buchner
I can suggest three possible fixes in order of descending "cleanliness"

1)
You can tag your application using an application manifest that tells
Windows that the application
is DPI aware and handles all the scaling itself.

2)
Another possible fix is to force compatibility scaling individually per
executable in the Compatibility tab of the
Application properties ("Tell Windows not to scale an app that's not
DPI-aware")
https://technet.microsoft.com/en-us/library/dn528847.aspx?f=255=-2147217396

3)
Another possible fix is to tell Windows 10 to use a custom scaling of 100%
on your affected display
(Option #2 To Set Custom DPI Scaling Level for All Displays in Control
Panel)
http://www.tenforums.com/tutorials/5990-dpi-scaling-level-displays-change-windows-10-a.html


#3 might be quickest, but affects all applications
#2 has to be reapplied on every compilation of your binary
#1 seems to be the preferred solution because it sticks with the
application as it is applied on compilation

Christian


2016-10-08 23:25 GMT+02:00 Robert Osfield :

> Hi Li,
>
> I'm not a Windows expert so can't provide answers on Windows specific
> issues like this.  My guess Windows 10 has introduced some form of
> window scaling that the osgViewer isn't yet aware of so doesn't take
> account of.  To resolve this issue will require a Windows 10 dev to
> dive in an investigate.
>
> Robert.
>
> On 8 October 2016 at 18:31, Li Chi  wrote:
> > Hi,
> >
> > I tested the newest code, it works perfectly, thank you very much.
> >
> > Just another problem:
> > Under the windows 10 OS (may be other OS has the same result), when
> screen's TEXT SIZE isn't 100% (my computer's setting is 150%), the
> osgViewer.exe's full screen mode works a little odd. It just like some of
> the screen content is cutted, please see the attached screenshot picture.
> >
> > Thank you!
> >
> > Cheers,
> > Li
> >
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=68915#68915
> >
> >
> >
> >
> > Attachments:
> > http://forum.openscenegraph.org//files/screenshot_970.jpg
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] SingleThreaded leading to whole application just running on one core

2016-09-29 Thread Christian Buchner
Hi Robert,

Thank you very much for spending so much effort on the threading affinity
(re)design. It is very much appreciated.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] slow speed of osgDB::writeImageFile() for monochrome PNGs?

2016-09-12 Thread Christian Buchner
Hi, I allocate and write out an 8 bit 1024x1024 pixel map like this

osg::ref_ptr img = new osg::Image;
img->allocateImage(1024, 1024, 1, GL_LUMINANCE, GL_UNSIGNED_BYTE);
/* omitted: fill the image with science (TM) */
osgDB::writeImageFile(*img, filename);

I am a bit puzzled that writing a PNG file to disk seems to take 5 seconds
in a release build, and about twice that time in debug builds.

Using Visual Studio 2015 Express Edition and the osg-3rdparty CMAKE build
process
from here https://github.com/bjornblissing/osg-3rdparty-cmake together with
libPNG 1.6.21 (lpng1621.zip)

Any idea what might cause this extremely slow writing process? It's just a
megapixel of grayscale data. I am puzzled.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Render to texture ONLY?

2016-08-18 Thread Christian Buchner
One more thing: Rendering to a pbuffer does not automatically give you the
option to access your rendered content as a texture.

The technique to render to texture with pbuffers is called pbuffer-rtt and
implemented in several OSG samples with the "

*--pbuffer-rtt" command line option.*

*This may differ a bit from the camera setup I've outlined above.*



*Christian*

2016-08-18 17:07 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>:

>
> On Windows, create a graphics context with the pbuffer flag set to true
> and windowDecoration set to false.
>
> osg::ref_ptr traits = new
> osg::GraphicsContext::Traits;
> traits->x = 0;
> traits->y = 0;
> traits->width = 640;
> traits->height = 480;
> traits->red = 8;
> traits->green = 8;
> traits->blue = 8;
> traits->alpha = 8;
> traits->windowDecoration = false;
> traits->pbuffer = true;
> traits->doubleBuffer = false; // or true as needed
> traits->sharedContext = 0;
>
> m_pbuffer = osg::GraphicsContext::createGraphicsContext(traits.
> get());
> if (!m_pbuffer.valid())
> {
> osg::notify(osg::NOTICE) << "Pixel buffer has not been created
> successfully. NOTE: update your dependencies folder if you see this error!"
> << std::endl;
> exit(1);
> }
> else
> {
> // Create an osgViewer running on top of a pbuffer graphics
> context
> m_viewer = new osgViewer::Viewer();
>
> // in my case I use a slave camera with ortho projection
> // to render whatever is needed
> m_camera = new osg::Camera;
> m_camera->setGraphicsContext(m_pbuffer.get());
> m_camera->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
> m_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
> m_camera->setViewMatrix(osg::Matrix());
> m_camera->setProjectionMatrix(osg::Matrix::ortho2D(0, 1.0, 0,
> 1.0));
> m_camera->setViewport(new osg::Viewport(0, 0, 640, 480));
> m_camera->setDrawBuffer(GL_FRONT);
> m_camera->setReadBuffer(GL_FRONT);
> m_viewer->addSlave(m_camera.get(), osg::Matrixd(),
> osg::Matrixd());
> m_viewer->realize();
>
>
> I do not know if the same would work on Linux, as pbuffers on Linux are an
> optional extension that might not be supported.
>
> I get this to render at arbitrary frame rates, entirely decoupled from the
> screen's VBLANK interval.
>
> Christian
>
>
> 2016-08-18 16:47 GMT+02:00 Chris Thomas <ctho...@soasta.com>:
>
>> Hi,
>>
>> OK, I based my initial integration into my app on osgteapot.cpp. As with
>> all the other examples, it os run via
>>
>> viewer.run();
>>
>> And this creates an output window in OSX (and I am assuming any other OS
>> its run on). And thats the issue I have, I need OSG to run "headless", that
>> is to say, producing no visible window in the OS.
>>
>> If OSG is rendering away, to a non visible buffer, I can then expose this
>> to the user via my UI api (see above). Having this visible viewer, is the
>> issue right now. Is there an option to run viewer with no visible
>> display/window, or is there an alternative to viewer() ?
>>
>> Thank you!
>>
>> Cheers,
>> Chris
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=68420#68420
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Render to texture ONLY?

2016-08-18 Thread Christian Buchner
On Windows, create a graphics context with the pbuffer flag set to true
and windowDecoration set to false.

osg::ref_ptr traits = new
osg::GraphicsContext::Traits;
traits->x = 0;
traits->y = 0;
traits->width = 640;
traits->height = 480;
traits->red = 8;
traits->green = 8;
traits->blue = 8;
traits->alpha = 8;
traits->windowDecoration = false;
traits->pbuffer = true;
traits->doubleBuffer = false; // or true as needed
traits->sharedContext = 0;

m_pbuffer =
osg::GraphicsContext::createGraphicsContext(traits.get());
if (!m_pbuffer.valid())
{
osg::notify(osg::NOTICE) << "Pixel buffer has not been created
successfully. NOTE: update your dependencies folder if you see this error!"
<< std::endl;
exit(1);
}
else
{
// Create an osgViewer running on top of a pbuffer graphics
context
m_viewer = new osgViewer::Viewer();

// in my case I use a slave camera with ortho projection
// to render whatever is needed
m_camera = new osg::Camera;
m_camera->setGraphicsContext(m_pbuffer.get());
m_camera->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
m_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
m_camera->setViewMatrix(osg::Matrix());
m_camera->setProjectionMatrix(osg::Matrix::ortho2D(0, 1.0, 0,
1.0));
m_camera->setViewport(new osg::Viewport(0, 0, 640, 480));
m_camera->setDrawBuffer(GL_FRONT);
m_camera->setReadBuffer(GL_FRONT);
m_viewer->addSlave(m_camera.get(), osg::Matrixd(),
osg::Matrixd());
m_viewer->realize();


I do not know if the same would work on Linux, as pbuffers on Linux are an
optional extension that might not be supported.

I get this to render at arbitrary frame rates, entirely decoupled from the
screen's VBLANK interval.

Christian


2016-08-18 16:47 GMT+02:00 Chris Thomas :

> Hi,
>
> OK, I based my initial integration into my app on osgteapot.cpp. As with
> all the other examples, it os run via
>
> viewer.run();
>
> And this creates an output window in OSX (and I am assuming any other OS
> its run on). And thats the issue I have, I need OSG to run "headless", that
> is to say, producing no visible window in the OS.
>
> If OSG is rendering away, to a non visible buffer, I can then expose this
> to the user via my UI api (see above). Having this visible viewer, is the
> issue right now. Is there an option to run viewer with no visible
> display/window, or is there an alternative to viewer() ?
>
> Thank you!
>
> Cheers,
> Chris
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68420#68420
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Render to texture ONLY?

2016-08-18 Thread Christian Buchner
have a look at the osgprerender example. That one renders to texture first,
and then uses the contents of this texture for rendering to screen.

The osgscreencapture and osgposter examples also have options to render
off-screen to FBO or pbuffers.


2016-08-18 13:19 GMT+02:00 Chris Thomas :

> Hi,
>
> I have an existing app I am developing, which itself is based on OpenGL.
> It uses an API that provides a 3D windowing system, with different media
> being displayed on planes, within this 3D space. All good...
>
> Except, its API does not offer anything near the flexibility, and ease of
> use of OSG. So.. how to use OSG within this app.
>
> All of the examples I have seen so far, use a very similar patern, of the
> ilk
>
>
> Code:
> osg::ref_ptr cessna = osgDB::readNodeFile( "cessna.osg" );
> viewer.setSceneData( cessna.get() );
> return viewer.run();
>
>
>
> This is great, in that its very easy to get going, but its thew viewer()
> that is causing issues for me. Ideally the viewer would be able to render
> to a texture, rather than to a screen, or window on a screen. I basically
> need a headless 3D process running, where the OSG output is going to a
> texture.
>
> Are there any examples of how to do this? Once I have a texture, I can
> easily copy its contents to my apps planes.
>
> Thank you!
>
> Cheers,
> Chris
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68415#68415
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Deleting osg::Image that is shallow copied

2016-08-16 Thread Christian Buchner
looking at the osg::Image header file, it appears that the data storage is
not protected through reference counting.

AllocationMode _allocationMode;
unsigned char* _data;

the default allocation mode for an osg::Image is USE_NEW_DELETE, hence when
one instance of your shallow copy is destroyed, it will delete[] the _data
storage, making it unsafe to use from the 2nd instance.

You could force an allocation mode of NO_DELETE, so the osg::Image object
itself will never free its associated image data store - then your
application is responsible for freeing up these resources.

Christian



2016-08-16 12:35 GMT+02:00 Pierre-Jean Petitprez <
pierre-jean.petitp...@inria.fr>:

> Hi Sebastian,
>
> What do you mean by "reachable"? Deallocation doesn't mean the memory is
>> cleaned or something. So having a raw pointer to the deallocated memory
>> might give you the same data as long as no one is allocating memory there.
>>
>> I mean that after the first image is deleted, I still can use and perform
> operations on the data through the second image. To rewrite my question, I
> would like to know if data in an image is deallocated (and so it is not
> safe to perform operations on it through the second image) when it's
> shallow copied. I guess it is but I am not 100% sure.
>
> Thank you,
>
> Pierre-Jean
>
> Cheers
>> Sebastian
>>
>>>
>>> Thanks for enlightening me,
>>>
>>> Cheers,
>>> Pierre-Jean
>>>
>>> --
>>> Read this topic online here:
>>> http://forum.openscenegraph.org/viewtopic.php?p=68380#68380
>>>
>>>
>>>
>>>
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opens
>>> cenegraph.org
>>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to get OSG 2.5?

2016-08-04 Thread Christian Buchner
You could try the OpenSceneGraph-2.6 branch, which is essentially the
stable version of the OSG 2.5 developer branch

https://github.com/openscenegraph/OpenSceneGraph/tree/OpenSceneGraph-2.6


2016-08-04 14:04 GMT+02:00 Haixiao Liu <943719...@qq.com>:

> Hi,
>
> I have a project developed with OSG 2.5 .But I don't have the source code
> of OSG 2.5 .I tried to compile the project with OSG 3.0,but it failed and
> reported an error "C2065: “_minimumZoomScale”: Undeclared Identifier".
> How can I get OSG 2.5? Or how to solve this problem?
>
>
> Thank you!
>
> Cheers,
> Haixiao
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68277#68277
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] floating point pbuffers - not supported by current PixelBufferWin32 implementation

2016-07-22 Thread Christian Buchner
I am finding that with the following modification to PixelBufferWin32.cpp I
can get my floating point PBuffer easily (no nvidia specific extensions
required)

fAttribList.push_back(WGL_PIXEL_TYPE_ARB);
if (_traits->red == 32 && _traits->green == 32 && _traits->blue == 32)
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
fAttribList.push_back(WGL_TYPE_RGBA_FLOAT_ARB);
else
fAttribList.push_back(WGL_TYPE_RGBA_ARB);

Right now the presence of 32 bit color components in the context traits
triggers the use of floating point texture format.

My use case would be fast readback of scientific results from a GLSL
shader, performing only off-screen rendering.  I am basing this on the
osgscreencapture example.

Christian


2016-07-22 14:48 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>:

> Hi all,
>
> I spent the last 3 hours trying to coerce OSG to give me a floating point
> pbuffer. Just setting the required bits for color components to 32 bits in
> the graphicscontext traits isn't working.
>
> Turns out, on nVidia cards you also have to give the
> WGL_FLOAT_COMPONENTS_NV flag as "true" to get a valid pixel format on
> Windows. The following code does this:
>
> std::vector fAttribList;
>
> fAttribList.push_back(WGL_SUPPORT_OPENGL_ARB);
> fAttribList.push_back(true);
> fAttribList.push_back(WGL_PIXEL_TYPE_ARB);
> fAttribList.push_back(WGL_TYPE_RGBA_ARB);
>
> fAttribList.push_back(WGL_RED_BITS_ARB);
> fAttribList.push_back(32);
> fAttribList.push_back(WGL_GREEN_BITS_ARB);
> fAttribList.push_back(32);
> fAttribList.push_back(WGL_BLUE_BITS_ARB);
> fAttribList.push_back(32);
> fAttribList.push_back(WGL_ALPHA_BITS_ARB);
> fAttribList.push_back(32);
> fAttribList.push_back(WGL_STENCIL_BITS_ARB);
> fAttribList.push_back(8);
> fAttribList.push_back(WGL_DEPTH_BITS_ARB);
> fAttribList.push_back(24);
> fAttribList.push_back(WGL_FLOAT_COMPONENTS_NV);
> fAttribList.push_back(true);
> fAttribList.push_back(WGL_DRAW_TO_PBUFFER_ARB);
> fAttribList.push_back(true);
> fAttribList.push_back(WGL_DOUBLE_BUFFER_ARB);
> fAttribList.push_back(false);
>
> fAttribList.push_back(0);
>
> unsigned int nformats = 0;
> int format;
> WGLExtensions* wgle = WGLExtensions::instance();
> wgle->wglChoosePixelFormatARB(hdc, [0], NULL, 1, ,
> );
> std::cout << "Suitable pixel formats: " << nformats << std::endl;
>
> On my GTX 970 card here this returns exactly one suitable pixel format (3
> if you drop the DOUBLE_BUFFER_ARB requirement even)..
>
> It seems that the implementation of PixelBufferWin32 cannot currently be
> given any user-defined attributes to the wglChoosePixelFormatARB function.
> Is this a capability that we should consider adding? Or should we
> automatically sneak in this vendor specific flag if the color components
> the traits specify have 32 bits and a previous call to
> wglChoosePixelFormatARB returned 0 matches?
>
> I am leaving this up for debate.
>
> Is there a vendor-neutral alternative to the WGL_FLOAT_COMPONENTS_NV flag?
>
> For now, I can simply patch my local copy of the OSG libraries to support
> floating point pbuffers on nVidia cards.
>
> Christian
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] floating point pbuffers - not supported by current PixelBufferWin32 implementation

2016-07-22 Thread Christian Buchner
Hi all,

I spent the last 3 hours trying to coerce OSG to give me a floating point
pbuffer. Just setting the required bits for color components to 32 bits in
the graphicscontext traits isn't working.

Turns out, on nVidia cards you also have to give the
WGL_FLOAT_COMPONENTS_NV flag as "true" to get a valid pixel format on
Windows. The following code does this:

std::vector fAttribList;

fAttribList.push_back(WGL_SUPPORT_OPENGL_ARB);
fAttribList.push_back(true);
fAttribList.push_back(WGL_PIXEL_TYPE_ARB);
fAttribList.push_back(WGL_TYPE_RGBA_ARB);

fAttribList.push_back(WGL_RED_BITS_ARB);
fAttribList.push_back(32);
fAttribList.push_back(WGL_GREEN_BITS_ARB);
fAttribList.push_back(32);
fAttribList.push_back(WGL_BLUE_BITS_ARB);
fAttribList.push_back(32);
fAttribList.push_back(WGL_ALPHA_BITS_ARB);
fAttribList.push_back(32);
fAttribList.push_back(WGL_STENCIL_BITS_ARB);
fAttribList.push_back(8);
fAttribList.push_back(WGL_DEPTH_BITS_ARB);
fAttribList.push_back(24);
fAttribList.push_back(WGL_FLOAT_COMPONENTS_NV);
fAttribList.push_back(true);
fAttribList.push_back(WGL_DRAW_TO_PBUFFER_ARB);
fAttribList.push_back(true);
fAttribList.push_back(WGL_DOUBLE_BUFFER_ARB);
fAttribList.push_back(false);

fAttribList.push_back(0);

unsigned int nformats = 0;
int format;
WGLExtensions* wgle = WGLExtensions::instance();
wgle->wglChoosePixelFormatARB(hdc, [0], NULL, 1, ,
);
std::cout << "Suitable pixel formats: " << nformats << std::endl;

On my GTX 970 card here this returns exactly one suitable pixel format (3
if you drop the DOUBLE_BUFFER_ARB requirement even)..

It seems that the implementation of PixelBufferWin32 cannot currently be
given any user-defined attributes to the wglChoosePixelFormatARB function.
Is this a capability that we should consider adding? Or should we
automatically sneak in this vendor specific flag if the color components
the traits specify have 32 bits and a previous call to
wglChoosePixelFormatARB returned 0 matches?

I am leaving this up for debate.

Is there a vendor-neutral alternative to the WGL_FLOAT_COMPONENTS_NV flag?

For now, I can simply patch my local copy of the OSG libraries to support
floating point pbuffers on nVidia cards.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using OSG, how can I generate and render terrain from grid file format?

2016-07-09 Thread Christian Buchner
To load data through the GDAL plugin, simply append a .gdal file extension
to the file name
(even though on disk it does not have the .gdal extension)

I use this method to load ESRI GRID ASCII format height fields into our
application, then using
this data to generate a TerrainTile for an osg::Terrain.

Christian


2016-07-09 17:57 GMT+02:00 Chris Hanson :

> You could use VPB, or you could try osgEarth. osgEarth is also based on
> GDAL for data loading, and should be able to support basically any format
> GDAL supports properly.
>
> On Sat, Jul 9, 2016 at 2:21 AM, jamie robertson <
> jamieroberts...@hotmail.com> wrote:
>
>> Hi,
>>
>> I think you can use Virtual Planet Builder to generate a paged quad tree
>> terrain database from your data. It uses GDAL to read grid data, which I
>> believe supports at least one of the surfer grid formats.
>>
>> Cheers,
>>
>> Jamie
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=68073#68073
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
> http://www.alphapixel.com/
> Training • Consulting • Contracting
> 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4
> • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
> Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
> osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
> iPhone/iPad/iOS • Android
> @alphapixel  facebook.com/alphapixel (775)
> 623-PIXL [7495]
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Implement tile-based, large scale 2d map rendering

2016-07-06 Thread Christian Buchner
Isn't OsgEarth focused on meshed 3D terrain mostly? That might incur some
unnecessary overhead when displaying this in a 2D projection top view.


2016-07-05 23:33 GMT+02:00 Jason Beverage :

> Check out http://www.osgearth.org, it likely does everything you're
> trying to do.
>
> Jason
>
> On Tue, Jul 5, 2016, 5:18 AM Bruno Oliveira <
> bruno.manata.olive...@gmail.com> wrote:
>
>> Hello,
>>
>>
>> can someone give me some hints on where to start implementing a
>> tile-based, large scale 2d map renderer? This is similar to, for instance,
>> Google maps, i.e., it only shows the visible tiles, and increases scale as
>> I zoom in.
>>
>> I have a large tiled 2d raster map (e.g. 200k x 200k pixels) stored in
>> hard disk. Can I add these tiles to a PagedLOD engine?
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Pass an osg::Texture2D to CUDA driver api

2016-06-24 Thread Christian Buchner
I am wondering if the default setting to enable use of Display lists in OSG
still makes a lot of sense nowadays.

Christian


2016-06-24 18:20 GMT+02:00 Jannik Heller :

> Hi Philipp,
>
>
> >
> > Also, Im having the issue that my drawCallback is only executed during
> the first frame and then skipped. Ive disabled culling and depth testing.
> >
>
> You need to disable display lists on your drawable. With display lists
> enabled it will only draw once and then use the display list. This makes no
> sense when using Cuda obviously.
>
>
> >
> > Does anyone know why that happens? From my understanding, the renderbin
> number should determine the order of draw (and therefore also of the
> drawCallback?) operations.
> >
>
> I think this may also be related to the display list being enabled, the
> compileGLObjects() that is run in the first frame will compile display
> lists but not necessarily in the order of the render bins.
>
> Cheers,
> Jannik
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67803#67803
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Cannot stop rendering slave camera

2016-06-15 Thread Christian Buchner
What also works for me is to take my render to texture slave cameras out of
the scene graph group
they are contained in. For thread safety, this has to happen in an update
callback.

I use this method for computation in GLSL, so the computation is only
triggered when it's necessary
and not in every frame.

Christian





2016-06-15 13:59 GMT+02:00 Etienne de Sarrieu 
:

> Hi,
>
> Thank you very much Robert, this solves my problem !!!
>
> Cheers,
> Etienne
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67635#67635
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] nVidia HW: Lens Matched Shading, Single Pass Stereo - exposed in OpenGL?

2016-06-09 Thread Christian Buchner
Hi all,

has anybody looked at these new features of nVidia hardware?

Lens Matched Shading and Single Pass Stereo are using new hardware and
driver features that allow the GPU to perform single pass transform+shading
of up to 16 independent view matrices.

This could accelerate OSG's stereo rendering, provided that the features
are exposed thorugh documented OpenGL extensions.

Also rendering of cubemaps for reflections and shadows could be greatly
accelerated (six views in one pass).

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] fast texture readback from FBO?

2016-06-07 Thread Christian Buchner
Hi,

would anyone have an example for a render to texture with FBO with a fast
read-back into CPU memory? This should be an example that does not block
OpenSceneGraph's frame loop.

The current code I have uses the terribly slow glReadPixels data path.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Best Pipeline For Integrating Blender Models?

2016-06-05 Thread Christian Buchner
My workflow is to export the model from Blender to one of OBJ, DAE
(Collada) or FBX and to check in osgviewer which of these formats has less
issues. Then I run osgconv to convert it into OSG, OSGT, IVE or OSGB
formats as needed.

Christian


2016-06-05 21:05 GMT+02:00 Dave Sargrad :

> Hi.
> I'm trying to get the daereader plugin built. Not sure what I need to do
> in cmake.
>
> I've gone into the collada section and I have filled out the collada
> entries that I think I might have to set, really am not sure how to set
> them properly.
>
> https://drive.google.com/open?id=0BzUf-8Ad-iIkclpDdEpYV19FVVk
>
> I dont see the dae reader plugin show up in my project. Also I see the
> following error when i try to do an INSTALL
>
>
> > 1>  CMake Error at src/osgPlugins/dae/cmake_install.cmake:32 (file):
> > 1>file INSTALL cannot find
> > 1>
> "C:/osg/OpenSceneGraph-3.4.0/build64/bin/osgPlugins-3.4.0/osgdb_daed.dll".
> > 1>  Call Stack (most recent call first):
> > 1>src/osgPlugins/cmake_install.cmake:61 (include)
> > 1>src/cmake_install.cmake:52 (include)
> > 1>cmake_install.cmake:96 (include)
>
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67423#67423
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Arcball Camera without unexpecting 'roll' of the camera

2016-05-17 Thread Christian Buchner
Could it be that the "throw" feature of the camera manipulator is
responsible for the roll?
If so, try disabling it.

Also, post source code if you want specific help with a specific issue in
your implementation.

Christian


2016-05-16 14:59 GMT+02:00 Daniel Neos :

> Hi everyone,
>
> I have implemented a Cameramanipulator by myself, because I need more
> individually control over the camera in the scene, like rotating around a
> specific axis.
>
> I let osg compute the Boundingsphere of my scene and set the rotationpoint
> and the lookat-point or center-point at the center of the Boundingsphere.
>
> My rotation works like this
>
> 1.) Translate the camera to the center of the Boundingsphere
> (Multiplicated from the right side of the viewmatrix of the camera fist)
>
> 2.) Rotate the viewmatrix by the OSG::x_axis and OSG::y_axis (depending on
> the mousemovement)
>
> 3.) Translate the camera back with the vector from step 1.
>
> 4.) Now with the last step I ensure, that the camera stays focused at the
> samepoint by getting the eye, center and up vector and reseting the center
> vector, while eye and up remains the same.
>
> This usually works fine and it is easy to navigate through the scene with
> the mouse, but as I reach some regions the camera unexpectedly seem to
> rotate around its own z-axis which results in to a 'roll'.
>
> How can I prevent this behaviour? Sample code with arcball camera would be
> appreciated too :)
>
> Thank you!
>
> Cheers,
> Daniel
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67113#67113
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Multitouch OSG and Qt

2016-05-11 Thread Christian Buchner
There is one specific camera manipulator in OSG that supports multi-touch.
I've tried it with a multitouch display once. The zooming gesture was
extremely sensitive if I remember correctly.

Christian



2016-05-11 18:00 GMT+02:00 Christian Kunz :

> Hello,
>
> I have a Qt application with an integrated OSG scene.
> I use the standard example with "GraphicsWindowQt".
>
> The problem is that Multitouch events are not working.
> I guess thats because they are not forwarded to the Qt-Widget which holds
> the OSG scene.
>
> I found a solution here:
> https://groups.google.com/forum/#!topic/osg-users/MOTw6iREmM8
>
> Can I just replace the GraphicsWindowQt.cpp file? Or do I need to consider
> other things?
> Is it planned to integrate it into OSG? I guess it is still no Multitouch
> in OSG 3.4.0.
>
>
>
>
>
> Thank you!
>
> Cheers,
> Christian
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67076#67076
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadow projected on the opposite side too

2016-04-28 Thread Christian Buchner
Oh oops, I am sorry I misunderstood your question. I was talking about
reverse projection where the shadow is also received
inside a the frustum at the opposite side of e.g. a point light source. So
my solution would not apply to your problem. Apologies.

Christian




2016-04-28 13:57 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>:

>
> if the w coordinate of your projected shadow texture coordinate is < 0,
> you should
> reject the shadow. This is quite easy to do in GLSL.
>
> The same technique can be used both for projective texture mapping and for
> shadow
> mapping.
>
> Christian
>
>
>
> 2016-04-28 11:40 GMT+02:00 Pierre-Jean Petitprez <
> pierre-jean.petitp...@inria.fr>:
>
>> Hi dear OSG users,
>>
>> I'm wondering how to correctly use osgShadow. As you can see on the file
>> I have attached, the shadow map is projected on the receiving object also
>> on a face which should normaly not receive the shadow from the sphere (on
>> my example the light is at the top right corner). It behaves like if the
>> top face did not stop the light to continue its path through the object
>> (which is not transparent).
>> My example is with soft shadow but I tested with other techniques and it
>> is the same behaviour.
>>
>> Is there a way to avoid such behaviour with osgShadow ?
>> Thank you.
>>
>> Cheers,
>> Pierre-Jean
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Shadow projected on the opposite side too

2016-04-28 Thread Christian Buchner
if the w coordinate of your projected shadow texture coordinate is < 0, you
should
reject the shadow. This is quite easy to do in GLSL.

The same technique can be used both for projective texture mapping and for
shadow
mapping.

Christian



2016-04-28 11:40 GMT+02:00 Pierre-Jean Petitprez <
pierre-jean.petitp...@inria.fr>:

> Hi dear OSG users,
>
> I'm wondering how to correctly use osgShadow. As you can see on the file I
> have attached, the shadow map is projected on the receiving object also on
> a face which should normaly not receive the shadow from the sphere (on my
> example the light is at the top right corner). It behaves like if the top
> face did not stop the light to continue its path through the object (which
> is not transparent).
> My example is with soft shadow but I tested with other techniques and it
> is the same behaviour.
>
> Is there a way to avoid such behaviour with osgShadow ?
> Thank you.
>
> Cheers,
> Pierre-Jean
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How is this foliage artifact called and how to fix it?

2016-04-22 Thread Christian Buchner
Placing the foliage into a later render bin (e.g. the transparent bin, #10)
than most other objects would help.
Christian


2016-04-22 18:08 GMT+02:00 Chris Hanson :

> I believe your texture filtering mode is generating intermediate alpha
> values, which then blend a portion of the distant background in before the
> other "face" of the tree is drawn behind.
>
> Switching to GL_NEAREST will probably avert this, but will look ugly in
> other ways.
> ​
> Alpha to coverage might help you here:
> http://www.humus.name/?page=3D=61
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Why isn't OpenSceneGraph used in games?

2016-04-21 Thread Christian Buchner
AAA Games tend to not use OpenGL much these days.  At one pointOpenGL
development wasn't able to catch up to DirectX feature wise (simply too
much buerocracy in the decision making pipeline) - that's when OpenGL lost
developers to DirectX.

Also OpenGL driver quality on Windows was often way behind DirectX
implementations (I am looking at you, Intel)

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Different results from camera->getViewMatrix() in OSG 3.4.0 compared to OSG 3.2.1

2016-04-14 Thread Christian Buchner
The plug-in you used to load your model may behave differently and as a
result the scene's bounding sphere center could have shifted
.


2016-04-14 13:21 GMT+02:00 Robert Osfield :

> Hi Ronny,
>
> I don't recall any specific changes to view matrix management between
> OSG-3.2.1 and OSG-3.4.0.  I'm also not aware of any bugs being reported
> that look relevant to this what you are describing.
>
> Printing out two sets of view matrices for the two versions without the
> view's being identical isn't useful.  Try to create the exactly same input
> conditions - for instance by explictly setting the view matrix.  The mouse
> input are another variable you'd need to standardize.
>
> Also when describing the problem you'll need to do more than saying a
> "vertical offset", this has so many different possible interpretations that
> it's pointless even starting to guess what you mean.
>
> Robert.
>
>
>
> On 14 April 2016 at 12:02, Ronny Hatteland 
> wrote:
>
>> Hi,
>>
>> I have some code for doing picking of objects on the screen:
>>
>>
>> Code:
>> float dX = ea.getX();
>> float dY = ea.getY();
>>
>> osg::ref_ptr camera = view->getCamera();
>>
>> // compute model to window transform
>> // Model*View*Projection*WindowMatrix
>> osg::Matrixd matrix;
>> matrix.postMult(camera->getViewMatrix());
>> matrix.postMult(camera->getProjectionMatrix());
>> osg::Matrixd windowMatrix = camera->getViewport()->computeWindowMatrix();
>> matrix.postMult(windowMatrix);
>>
>> osg::Matrixd inverse;
>> inverse.invert(matrix);
>>
>> // get the coordinates in screen-space:
>> osg::Vec3 mouseloc = osg::Vec3(dX, dY, 0) * inverse;
>> osg::Vec3 normalizedMouseRay = (osg::Vec3(dX, dY, 1) * inverse) -
>> mouseloc;
>> osg::Plane _dragPlane(osg::Vec4d(0, 1, 0, 0));
>>
>>
>> Which was working perfectly fine in OSG 3.2.1.
>> However, when I updated to OSG 3.4.0 a vertical offset was introduced,
>> which seems to be constant regardless of the camera.
>>
>> Positioning the camera at approximately the same place in both cases, and
>> looking at the matrices, it looks like the offset was introduced already by
>> the getViewMatrix() method, value[3][3]:
>>
>>
>> Code:
>> matrix.postMult(camera->getViewMatrix());
>> 3.4.0:
>> [0] {1., 0.0, 0.0,
>> 0.0}
>> [1] {0.0, 0.0, -1.,
>> 0.0}
>> [2] {0.0, 1., 0.0,
>> 0.0}
>> [3] {-1009.2817596644163, 216.03970056772232, -509.02834880430618,
>> 1.}
>> 3.2.1:
>> [0] {1., 0.0, 0.0,
>> 0.0}
>> [1] {0.0, 0.0, -1.,
>> 0.0}
>> [2] {0.0, 1., 0.0,
>> 0.0}
>> [3] {-1061.2815714627504, 239.85043859481812, -599.72003111232948,
>> 1.}
>>
>> matrix.postMult(camera->getProjectionMatrix());
>> 3.4.0:
>> [0] {1.7748398086904795, 0.0, 0.0,
>> 0.0}
>> [1] {0.0, 0.0, 1.0200,
>> 1.}
>> [2] {0.0, 3.8461539872299335, 0.0,
>> 0.0}
>> [3] {-1791.3134452375832, 830.92195573850609, 509.02834880411638,
>> 509.02834880430618}
>> 3.2.1
>> [0] {1.7748398086904795, 0.0, 0.0,
>> 0.0}
>> [1] {0.0, 0.0, 1.0200,
>> 1.}
>> [2] {0.0, 3.8461539872299335, 0.0,
>> 0.0}
>> [3] {-1883.6047812616794, 922.50172074030797, 599.72003111214144,
>> 599.72003111232948}
>>
>> WindowMatrix
>> 3.4.0:
>> [0] {960.00, 0.0, 0.0,
>> 0.0}
>> [1] {0.0, 443.00, 0.0,
>> 0.0}
>> [2] {0.0, 0.0, 0.5,
>> 0.0}
>> [3] {960.00, 581.00, 0.5,
>> 1.}
>> 3.2.1
>> [0] {960.00, 0.0, 0.0,
>> 0.0}
>> [1] {0.0, 443.00, 0.0,
>> 0.0}
>> [2] {0.0, 0.0, 0.5,
>> 0.0}
>> [3] {960.00, 443.00, 0.5,
>> 1.}
>>
>> matrix.postMult(windowMatrix);
>> 3.4.0:
>> [0] {1703.8462163428603, 0.0, 0.0,
>> 0.0}
>> [1] {960.00, 581.00, 1.0100,
>> 1.}
>> [2] {0.0, 1703.8462163428605, 0.0,
>> 0.0}
>> [3] {-1230993.6925759460, 

Re: [osg-users] 2D manipulator only

2016-04-11 Thread Christian Buchner
I've created a child class of osgGA::TerrainManipulator that restricts the
camera so that its up vector cannot tilt sideways (no camera banking). This
only allows for operations like zooming in, rotating the scene around the
intersection of the screen's centerpoint with the model and pure
translation. This is pretty similar to what 3D mapping applications allow
to do with the mouse.

Christian



2016-04-11 18:35 GMT+02:00 Robert Osfield :

> Hi Bruno,
>
> On 11 April 2016 at 16:21, Bruno Oliveira  > wrote:
>
>> How do I allow my mouse manipulator (actually an
>> osg::TrackballManipulator) to allow moving in 2D plane only?
>>
>> This is for vieweing an image and I want something similar to google maps
>> or so
>>
>
> The TrackballManipulator is a 3D manipulator and has no support for
> constraining to a 3D plane.
>
> If you want 2D movement then you will need to write your own
> "MapManipulator" or just set the the Viewer's master Camera's ViewMatrix
> directly with the frame loop.
>
> Robert.
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VR headset integration

2016-04-11 Thread Christian Buchner
The osgoculusviewer works for me using the 1.3 SDK now. Some parts are
missing, such as a graceful shutdown when a return to Oculus Home is
requested by a user pressing the home button.

I will also have a look at the in progress openvr (steamVR) integration
because this one is supposed to also work with the Vive.

Christian



2016-04-11 8:41 GMT+02:00 ruth simmons :

>
> bbjorn wrote:
> > Hi Christian,
> >
> >
> > I have started working with the integration of the Oculus 1.3 SDK, but
> haven't finished quite yet. Mostly because due to lack of time.
> >
> > Hopefully I will get some spare time and be able to complete the work
> during the week.
> >
> >
> > Best regards
> >
> > Björn
> >
> >
> >
>
>
> Any updates on your work?  I'm interested in this as well. Looking at
> various resources and will help out by sharing what I find.  Thanks.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66778#66778
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Vec3Array instantiation

2016-04-07 Thread Christian Buchner
the osg::ref_ptr<> could be wrapped into a smart pointer, right? But what's
the point ;)

2016-04-07 10:33 GMT+02:00 Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de>:

> Hi Vincent,
>
>> Hello
>>
>> I'm trying to use osg:Vec3Array with a c++11 smart pointer instead of osg
>> smart pointer. I aim to join two APIs: osg and another one using C++11
>> smart pointer. Apparently, this is a destructor problem: ~TemplateArray<>()
>> is private, so an explicit delete doesn't work. I have test many cases to
>> understand the problem.
>>
>>
>> Code:
>> osg::Vec3Array * test = new osg::Vec3Array();
>> delete test; // error here
>>
>>
>>
>>
>> Code:
>> std::shared_ptr test2(new osg::Vec3Array()); // error due
>> to pointer releasing
>>
>>
>>
>>
>> Code:
>> osg::Vec3Array test; // not work
>>
>>
>>
>>
>> Code:
>> osg::ref_ptr test3 = new osg::Vec3Array(); // this work
>> fine.
>>
>>
>>
>> So there are few solutions to use the Vec3Array: use osg smart pointer.
>> What is the reason the destructor is protected even through the method is
>> empty? Maybe to force developers to use smart pointers but I'm constrained
>> to use c++11 smart pointer due to the second api. I think the only way, is
>> to create a C++11 smart pointer templated by osg smart pointer or a class
>> which contains the osg smart pointer.
>>
> First of all, the osg will manage the array fine when you keep it in a
> drawable, so there should no need to use your own management. If you need
> to hold it outside, simply use the ref_ptr. the ref_ptr is basically an
> smart-pointer for osg::Object derived objects.
> The reason the destructor is private is to prevent stack-instances of the
> type and to disallow use patterns like yours.
> If i remember correctly there was some guide on this in the wiki/trac.
>
>
> Do you have an idea to use C+11 smart pointer instead of osg one?
>
> Simply don't. It would not solve a single problem and would create
> pitfalls.
> Use the osg::ref_ptr if you need to keep an object (it acts as a "shared
> ptr"). If you need a week smart ptr you can use observer pointer.
>
>
> Cheers
> Sebastian
>
>
>
>> Thank you!
>>
>> Cheers,
>> Vincent
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=66760#66760
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] using 3Ds Model in osgFX::BumpMapping and the Texture UV Coords for diffuse are not loaded

2016-04-05 Thread Christian Buchner
> I implemented the OSG BumpMap with no need to use shaders, as follow:
> osgFX::BumpMapping* bump_mapping = new osgFX::BumpMapping();

Hmm, by default this osgFX effect module will use shaders according to its
documentation:

"This effect defines a preferred technique which uses ARB vertex & fragment
programs, and a fallback technique which doesn't use fragment programs."

ARB fragment and vertex programs are some of the oldest types of
programmable shaders.

Christian


2016-04-04 18:12 GMT+02:00 Tiago Trocoli :

> Hi Tobias
>
> I implemented the OSG BumpMap with no need to use shaders, as follow:
>
> function source
>
>
> Code:
>
> void bumpMapOSG(osg::Geode *geode, osg::Group *group, osg::Image
> *normal_image, osg::Image *difuse_image, double scale_x,
> double scale_y) {
>
> if (!normal_image || !difuse_image) {
> std::cout << "IMAGE FAIL" << std::endl;
> exit(0);
> }
>
> osg::StateSet* bumpState = new osg::StateSet();
>
> // Set textures
> osg::ref_ptr normal_texture(new osg::Texture2D());
> osg::ref_ptr difuse_texture(new osg::Texture2D());
>
> normal_texture->setImage(normal_image);
> normal_texture->setDataVariance(osg::Object::DYNAMIC);
> normal_texture->setFilter(osg::Texture::MIN_FILTER,
> osg::Texture::LINEAR_MIPMAP_LINEAR);
> normal_texture->setFilter(osg::Texture::MAG_FILTER,
> osg::Texture::LINEAR);
> normal_texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);
> normal_texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);
> normal_texture->setResizeNonPowerOfTwoHint(false);
> normal_texture->setMaxAnisotropy(8.0f);
>
> difuse_texture->setImage(difuse_image);
> difuse_texture->setDataVariance(osg::Object::DYNAMIC);
> difuse_texture->setFilter(osg::Texture::MIN_FILTER,
> osg::Texture::LINEAR_MIPMAP_LINEAR);
> difuse_texture->setFilter(osg::Texture::MAG_FILTER,
> osg::Texture::LINEAR);
> difuse_texture->setWrap(osg::Texture::WRAP_S, osg::Texture::REPEAT);
> difuse_texture->setWrap(osg::Texture::WRAP_T, osg::Texture::REPEAT);
> difuse_texture->setResizeNonPowerOfTwoHint(false);
> difuse_texture->setMaxAnisotropy(8.0f);
>
> const int TEXTURE_UNIT_NORMAL = 1;
> const int TEXTURE_UNIT_DIFUSE = 2;
>
> bumpState->setTextureAttributeAndModes(TEXTURE_UNIT_NORMAL,
> normal_texture, osg::StateAttribute::ON);
> bumpState->setTextureAttributeAndModes(TEXTURE_UNIT_DIFUSE,
> difuse_texture, osg::StateAttribute::ON);
>
> osg::ref_ptr geometry =
> geode->asGeode()->getDrawable(0)->asGeometry();
> osg::Vec2Array* tex_coord =
> dynamic_cast(geometry->getTexCoordArray(0));
>
> for (unsigned int i = 0; i < tex_coord->getNumElements(); ++i)
> (*tex_coord)[i].set((*tex_coord)[i].x() * scale_x,
> (*tex_coord)[i].y() * scale_y);
>
> geometry->setStateSet(bumpState);
> if (tex_coord) {
> geometry->setTexCoordArray(TEXTURE_UNIT_NORMAL, tex_coord);
> geometry->setTexCoordArray(TEXTURE_UNIT_DIFUSE, tex_coord);
> } else {
> std::cout << "MISS TEXTURE COORDINATE " << std::endl;
> exit(0);
> }
>
> osgFX::BumpMapping* bump_mapping = new osgFX::BumpMapping();
> bump_mapping->setEnabled(true);
> bump_mapping->setLightNumber(0);
> bump_mapping->setNormalMapTextureUnit(TEXTURE_UNIT_NORMAL);
> bump_mapping->setDiffuseTextureUnit(TEXTURE_UNIT_DIFUSE);
> bump_mapping->addChild(geode);
> bump_mapping->prepareChildren();
> group->addChild(bump_mapping);
>
> }
> [\code]
>
>
>
> Thank you!
>
> Cheers,
> Tiago
>
>
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66724#66724
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] applying BVH motion to a model?

2016-04-05 Thread Christian Buchner
Hi

I am able to load BVH motion captures into OSG and I have generated a
nicely looking male model with a matching skeleton with MakeHuman 1.1.0 rc2
as an FBX model.

The BVH import plug-in generates a subgraph made of osgAnimation nodes
representing the bone hierarchy and their transformations.

A similar skeleton graph graph is also found in the loaded FBX model's
subgraph, except that it's also tied to various drawables of the model
through vertex weights.

I was wondering what the most efficient way might be to transfer motion
from the BVH graph in the the FBX graph. Doing this via update callbacks in
every frame might be a bit expensive, CPU-wise (it's almost 40 bones).

I was wondering if it is possible to tie the animation data channels from
the BVH subgraph directly to the FBX model somehow.

Has anyone else faced the challenge of copying motion information from one
model to another?

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Unsupported wrapper class warnings in OSG 3.2 branch

2016-04-04 Thread Christian Buchner
Hi,

when converting certain (rigged) FBX objects to OSGT format, I get several
of these warnings printed on console. The FBX model was created by the free
MakeHuman 1.1.0 rc2 version.

InputStream::readObject(): Unsupported wrapper class
osg::ComputeBoundingBoxCallback
InputStream::readObject(): Unsupported wrapper class osg::UpdateCallback

I get the same warnings when running osgviewer on the resulting .osgt file.

I was just wondering whether this is a known bug in the current OSG 3.2
branch?

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] about the state of the BVH plug-in, when used with CMU MoCap files

2016-04-01 Thread Christian Buchner
I've tried the OSG 3.2 branch and this version exhibited the same problem.

Then I had a closer look at the BVH files supplied by that web site. I am
finding that it defines
rotational parameters always in the order Z, Y,  X.  That is different from
the sequence I expect
from various online sources that use Z, X, Y.

in the plugin code, hence I adjust the sequence of keyValues read from the
file to read z, y, x
in this order.

if ( ch&0x08 ) fr.readSequence( keyValue[2] );  // Z
if ( ch&0x20 ) fr.readSequence( keyValue[1] );  // Y
if ( ch&0x10 ) fr.readSequence( keyValue[0] );  // X

But this alone wasn't sufficient to get correct results.

I also had to swap the order in which we generate the rotation matrix to
X*Y*Z.

osg::Matrix rotMat =

osg::Matrix::rotate(osg::DegreesToRadians(keyValue[0]),
osg::Vec3(1.0,0.0,0.0))
   *
osg::Matrix::rotate(osg::DegreesToRadians(keyValue[1]),
osg::Vec3(0.0,1.0,0.0))
   *
osg::Matrix::rotate(osg::DegreesToRadians(keyValue[2]),
osg::Vec3(0.0,0.0,1.0));

This appears to be the opposite order in which the above Euler angles are
specified.

Now the animations play out correctly, as far as I can tell.

I will have to do some more online research to understand whether the BVH
spec actually allows
to specify rotation in an arbitrary order and what the definitive answer
about the sequence of applying
the Euler angles is.

The first change could certainly determined automatically from the input
file, but whether or not the
sequence of matrix multiplications shall always occur in the opposite order
is up for debate.

I might propose a suitable patch to the BVH plug-in later.

Christian



2016-04-01 14:38 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>:

>
> This is how I call the osganimationviewer to display a skeleton from the
> motion data.
>
> osganimationviewer --drawbone C:\mocap\motionbuilder\01\01_02.bvh -O solids
>
> Just the result is a bit unexpected...
>
> 2016-04-01 14:33 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>
> :
>
>> Hi all,
>>
>> I've been trying to get the BVH files from this site to import into the
>> current OSG 3.4 branch
>>
>> https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion
>>
>> These are conversions of the original motion capture data that CMU
>> provides for free in a different format, optimized for the three
>> applications MotionBuilder, DAZ Studio and 3DS MAX.
>>
>> I've tried replaying the animations in osganimationviewer using the
>> --drawbone flag. Usually one needs to zoom out the camera to get the full
>> skeleton into view. The issue that I am having is that I see weird and
>> unexpected rotations of the entire skeleton, as well as specific joints -
>> regardless of the version of the BVH files I download.
>>
>> Has the OpenSceneGraph BVH plug-in ever worked on these mocap files?
>> Could it be that a code regression has recently broken the plug-in?
>>
>> Christian
>>
>>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] about the state of the BVH plug-in, when used with CMU MoCap files

2016-04-01 Thread Christian Buchner
This is how I call the osganimationviewer to display a skeleton from the
motion data.

osganimationviewer --drawbone C:\mocap\motionbuilder\01\01_02.bvh -O solids

Just the result is a bit unexpected...

2016-04-01 14:33 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>:

> Hi all,
>
> I've been trying to get the BVH files from this site to import into the
> current OSG 3.4 branch
>
> https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion
>
> These are conversions of the original motion capture data that CMU
> provides for free in a different format, optimized for the three
> applications MotionBuilder, DAZ Studio and 3DS MAX.
>
> I've tried replaying the animations in osganimationviewer using the
> --drawbone flag. Usually one needs to zoom out the camera to get the full
> skeleton into view. The issue that I am having is that I see weird and
> unexpected rotations of the entire skeleton, as well as specific joints -
> regardless of the version of the BVH files I download.
>
> Has the OpenSceneGraph BVH plug-in ever worked on these mocap files? Could
> it be that a code regression has recently broken the plug-in?
>
> Christian
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] about the state of the BVH plug-in, when used with CMU MoCap files

2016-04-01 Thread Christian Buchner
Hi all,

I've been trying to get the BVH files from this site to import into the
current OSG 3.4 branch
https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion

These are conversions of the original motion capture data that CMU provides
for free in a different format, optimized for the three applications
MotionBuilder, DAZ Studio and 3DS MAX.

I've tried replaying the animations in osganimationviewer using the
--drawbone flag. Usually one needs to zoom out the camera to get the full
skeleton into view. The issue that I am having is that I see weird and
unexpected rotations of the entire skeleton, as well as specific joints -
regardless of the version of the BVH files I download.

Has the OpenSceneGraph BVH plug-in ever worked on these mocap files? Could
it be that a code regression has recently broken the plug-in?

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Smart Pointer for Memory Management

2016-03-31 Thread Christian Buchner
Using google search I came across this thread where the poster got an osg
Viewer working
in a .NET forms application

http://forum.openscenegraph.org/viewtopic.php?t=10132=previous

Maybe you can get more information and help from the people who posted in
this thread.

About your specific problem with the osg::ref_ptr<> template class... this
object is a non-managed C++ class and you cannot use it as a member of a
managed class. So it needs to be wrapped in some .NET CLR wrapper.

Christian

2016-04-01 2:50 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>:

>
> What you need is a managed wrapper for OpenSceneGraph. I am not sure if
> any such thing exists.
>
> Hint: Microsoft has abandoned their managed wrapper for DirectX for
> performance reasons..
>
> Christian
>
>
> 2016-04-01 2:19 GMT+02:00 Diwas Bhattarai <osgfo...@tevs.eu>:
>
>> Hi,
>>
>> I want to use Openscenegraph on my Window Form Application. In the moment
>> I am writing a Wrapper in CLR application and exporting as a dll and
>> importing it in my Window Form Application.
>>
>> The Problem:
>> I cannot use
>> *Code:*
>>
>>
>>
>>
>>
>> osg::ref_ptr osgRodot;
>>
>>
>> in my header file where my ref class is defined.
>>
>>
>> *Quote:*
>>
>>
>>
>>
>>
>> IntelliSense: a member of a managed class cannot be of a non-managed
>> class type
>>
>>
>>
>>
>> But I can use the same code inside any functions of the class. But if I
>> initialize inside the class I cannot use it in another functions. I want to
>> use it in different functions so it's need to be accesible to every
>> functions.
>>
>> Anyone already faced this problem and could help me?
>>
>> Thank you!
>>
>> Cheers,
>> Diwas
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=66696#66696
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Smart Pointer for Memory Management

2016-03-31 Thread Christian Buchner
What you need is a managed wrapper for OpenSceneGraph. I am not sure if any
such thing exists.

Hint: Microsoft has abandoned their managed wrapper for DirectX for
performance reasons..

Christian


2016-04-01 2:19 GMT+02:00 Diwas Bhattarai :

> Hi,
>
> I want to use Openscenegraph on my Window Form Application. In the moment
> I am writing a Wrapper in CLR application and exporting as a dll and
> importing it in my Window Form Application.
>
> The Problem:
> I cannot use
> *Code:*
>
>
>
>
>
> osg::ref_ptr osgRodot;
>
>
> in my header file where my ref class is defined.
>
>
> *Quote:*
>
>
>
>
>
> IntelliSense: a member of a managed class cannot be of a non-managed class
> type
>
>
>
>
> But I can use the same code inside any functions of the class. But if I
> initialize inside the class I cannot use it in another functions. I want to
> use it in different functions so it's need to be accesible to every
> functions.
>
> Anyone already faced this problem and could help me?
>
> Thank you!
>
> Cheers,
> Diwas
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66696#66696
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VR headset integration

2016-03-30 Thread Christian Buchner
There appears to be ongoing integration work for OpenVR (SteamVR) here:

https://github.com/ChrisDenham/osgopenvrviewer

Christian


2016-03-30 16:14 GMT+02:00 Chris Hanson <xe...@alphapixel.com>:

> On Wed, Mar 30, 2016 at 7:19 AM, Christian Buchner <
> christian.buch...@gmail.com> wrote:
>
>> Hi,
>> I just wanted to ask around rather generally, how OSG integration with
>> various VR SDKs is coming along.
>>
> Can osgoculus be built against the recently released SDK version 1.3 at
>> this time?
>>
>
>   I haven't tried it with the 1.3 SDK. I had it working with OSG and
> osgEarth with an earlier SDK (might have been .8) at I/ITSEC back in
> December.
>
>   If you want somebody to make it work with the 1.3 SDK, I can probably do
> that work for you.
>
>
>> Is anyone working on a HTC Vive (OpenVR) or OSVR (
>> http://osvr.github.io/compatibility/ ) integration into OpenSceneGraph?
>>
>
>   I'm not, but it shouldn't be hard to do either/both. The base for
> supporting them has already been done and tested for Oculus so it'd just be
> a matter of connecting up to a different API that does roughly the same
> thing, so I wouldn't think it would be tough.
>
>
>> Christian
>>
>
> --
> Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
> http://www.alphapixel.com/
> Training • Consulting • Contracting
> 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4
> • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
> Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
> osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
> iPhone/iPad/iOS • Android
> @alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
> 623-PIXL [7495]
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] VR headset integration

2016-03-30 Thread Christian Buchner
Hi,

I just wanted to ask around rather generally, how OSG integration with
various VR SDKs is coming along.

Can osgoculus be built against the recently released SDK version 1.3 at
this time?

Is anyone working on a HTC Vive (OpenVR) or OSVR (
http://osvr.github.io/compatibility/ ) integration into OpenSceneGraph?

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osg to collada

2016-03-30 Thread Christian Buchner
A statically linked osgconv binary with the required DAE and OSG2 plug-ins
activated should do the trick. See the osgstaticviewer example for the
required preprocessor macros to activate statically linked plug-ins.

Christian



2016-03-30 9:41 GMT+02:00 Joe Kindle :

> Hey :)
> I'm looking for a simple way to convert osgb file to .dae file, in a
> computer that which doesn't have osg environment installed.
> In other words, I want to build an .exe file that gets .osgb file and
> converts it to .dae file
> Thanks!:)
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=7#7
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shadow mapping for point lights with shadow cube maps?

2016-03-23 Thread Christian Buchner
Hi all,

I might try an implementation of omni-directional point light shadow
mapping based on this interesting paper.

https://hal.archives-ouvertes.fr/hal-00733343/document

They manage to generate 6 views of the same object in a single pass and
within a destination single texture using geometry shaders and some
additional clipping magic.

This could be modified of for application in dual paraboloid mapping or
shadow cube maps, I believe.

An additional and very promising application of their technique would be
stereoscopic viewport rendering for VR headsets.

Christian


2016-03-16 15:50 GMT+01:00 Christian Buchner <christian.buch...@gmail.com>:

> Hi,
>
> I wonder if anyone here would be able to share some OSG based sample code
> demonstrating shadow cube maps for point light sources.
>
> While the osgShadow::ShadowMap class will currently detect point lights
> and use a perspective frustum for rendering the shadow map, I believe this
> does not currently cast shadows in all directions
>
> Rendering into all 6 faces of a cube map seems quite costly, so I wonder
> if there are more efficient ways to do shadow casting in all directions,
> say... rendering into two halves of a spherical map for example. Or going
> completely crazy... a tetrahedral shadow map requiring 4 projections
> instead of 6 for a cube map,
>
> Christian
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] shadow mapping for point lights with shadow cube maps?

2016-03-20 Thread Christian Buchner
Hi,

I wonder if anyone here would be able to share some OSG based sample code
demonstrating shadow cube maps for point light sources.

While the osgShadow::ShadowMap class will currently detect point lights and
use a perspective frustum for rendering the shadow map, I believe this does
not currently cast shadows in all directions

Rendering into all 6 faces of a cube map seems quite costly, so I wonder if
there are more efficient ways to do shadow casting in all directions,
say... rendering into two halves of a spherical map for example. Or going
completely crazy... a tetrahedral shadow map requiring 4 projections
instead of 6 for a cube map,

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-14 Thread Christian Buchner
Hi,

I am not sure if the original poster is aware of this, the
osgvertexattributes osg sample code is able to generate shaders from fixed
function pipeline state sets in the scene graph and applies these shaders
to the geometry.

http://trac.openscenegraph.org/projects/osg//browser/OpenSceneGraph/trunk/examples/osgvertexattributes/osgvertexattributes.cpp

Christian

2016-03-14 11:02 GMT+01:00 Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de>:

> Am 14.03.2016 um 09:16 schrieb Hyun Kwon:
>
> Hi Sebastian,
>
> Thanks for the reply.
>
> --
> *From:* osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf
> of Sebastian Messerschmidt [sebastian.messerschm...@gmx.de]
> *Sent:* Sunday, March 13, 2016 4:03 AM
> *To:* OpenSceneGraph Users
> *Subject:* Re: [osg-users] Running OSG models on OpenGLES2.0
>
> Hi Hyun,
>
>
> Hi Chris,
>
>
> I tried most of examples. Now I'm focusing on glsl_simple.osgt as it looks
> simple, but only the second row of shapes shows. If I modify the vertex
> shader a little, I get to see both first/second row.
>
> Can you tell us which platform you are using?  You usually don't have to
> add precision qualifiers to make shaders work.
>
> I have Xilinx ZynqMP SoC with MALI 400MP, and I'm running Ubuntu on it. I
> also have Yocto built rootfs. I've integrated the MALI OpenGLES2
> library/driver there, and I'm building OSG manually. It fails to compile if
> I don't add the precision for float & int in shaders. The OSG build
> configuration is more or less as below (it's for 3.4.0), with some addition
> to point to EGL/OPENGLES2 libraries and headers:
>
> ...
>
> I've received some OSG model (file.osg) from someone, and I was able to
> run it on the desktop (OpenGL). I was told the OSG model runs on
> OpenGLES2.0. For me to run it on OpenGLES2, I added the precision
> qualifiers to build, but the result still doesn't look correct. I'm not
> sure if more / what modification is needed. For example, I modified the OSG
> shader generator, but it didn't help. Does OSG layers completely abstract
> underlying APIs (OpenGL, OpenGLES,,,), meaning the OSG models are API
> independent? or does each OSG model have some API specific code? For
> example, I don't see any precision qualifiers in OSG examples, and does
> that mean those models are not for OpenGLES2.0?
>
> OSG doesn't completely abstract the APIs, but it can be built specifically
> to work with OpenGL ES, by using the compiler flags you used. You will
> however have to put some work into it, since you will have to write
> shaders. Since you are not telling us which "shader generator" you are
> using, it is hard to guess what you are trying to achieve.
> There is not something like "models for OpenGLES2.0". You will have to
> write appropriate shaders and might have to run some visitors to change
> fixed function pipeline functions in to uniforms/attributes of the model.
> For instance osg::Material is not working outside the compatibility
> -profiles, so might have to run a visitor, that parses osg::Material
> instances and replaces them with uniforms or per-vertex attributes which
> you will have to evaluate in the shader.
>
>
>
> I'm trying to figure out where the issue comes from: OSG model, OSG
> layers, OpenGLES library.
>
>
> Chris asked you for an example model that is not working. You mentioned
> the glsl-simple model, which from a glance doesn't have ES-compatible code.
> The easiest thing to do is to start with a model(preferably not containing
> shaders) and a simple ES-Shader.
> Unfortunately the examples here are relatively rare. Might be a great
> opportunity to create some minimalistic core/ES-based shader example and to
> extend the OpenGL-ES pseudo loader.
>
> If there are already OSG models confirmed to work with OpenGLES2, I'd use
> those to validate my platform. But, none of examples in OpenSceneGraph-Data
> shows correct results on my platform (nothing displayed except the
> glsl_simple.osgt) comparing to results from desktop with OpenGL. Once my
> platform is confirmed to work, I will be able to focus on debugging the
> model. With lack of OSG / shader experience, I can't easily tell where the
> issue comes from, and I'm looking for references for validation.
>
> Can't you try some other GLES applications(plain OpenGL-ES without OSG)
> and check their shader code? I believe there is a problem with your
> system/driver, as there is no need to explicitly issuing the precision in
> normal cases.
> All models should work in theory if you have some minimal shader for it.
> Out of my head a minimal shader should look like the following. It will
> display a red-colored version of your geometry.
>
> Vertex:
> #version 100
> attribute vec4 osg_Vertex;
> uniform mat4 osg_ModelViewProjectionMatrix;
>
> void main()
> {
> gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
> }
>
> Fragment:
>
> #version 100
>
> void main()
> {
> gl_FragColor = vec4(1,0,0,1);
> }
>
> Setting 

Re: [osg-users] Deferred shading + normal mapping + shadow mapping?

2016-03-11 Thread Christian Buchner
Hi,

I've just submitted a related code sample to osg-submissions. It currently
does bump mapping and soft shadows.

Things to improve are:
  - this needs to support more light sources (not necessarily for shadowing
though)
  - it needs better material handling (support for emissive colors,
reflective surfaces, gloss maps...)

Christian

2016-02-14 22:02 GMT+01:00 Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de>:

> Hi Vincent,
>
>> Is OSG capable to doing a pipeline featuring deferred shading, normal
>> mapping and shadow mapping, with point lights and directional lights?
>>
> Yes, but it will require some work.
> The only problematic part is the shadow mapping, as the current
> implementations created some headache when it came to separate
> shadow-mapping and lighting pass.
> You can take a look at osgPPU for minimal example IIRC. At least there is
> some example how to setup MRT-FBO and multiple passes.
> OpenFlightGear seems to have some deferred pipeline too, so may asking in
> their forum might give you some additional hints.
>
> Cheers
> Sebastian
>
>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=66115#66115
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Crash in osg 3.4.0 on Virtual Machine when OSG_GL3_AVAILABLE enabled

2016-03-09 Thread Christian Buchner
Hi Robert, thanks for the quick response,

>
> My point is that enabling GL3 and then using a driver that doesn't support
> gl buffers causes a null pointer access, to me this is a bug. If it is
> valid to use buffer objects when gl3 is enabled then bufferobject needs to
> do something other than what is does currently.
>

By building OSG against GL3 you are essentially adding a strict dependency
on OpenGL version3 API features in the driver. This is also allowing for an
optimization by instructing the code to "assume certain features exist,
don't explicitly check for them at run time". When your system does not
meet this dependency, the code may crash however.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Rendering OSG objects inside an existing OpenGL loop

2016-03-04 Thread Christian Buchner
The osg Camera has a clear mask, which you can set to not clear the Depth
and the Color buffer.

Christian

2016-03-03 18:31 GMT+01:00 Clement Begotto :

> Hi,
>
> I am working on a software which already has its existing OpenGL context
> and loop. I have to represent objects with different Level of Detail and I
> have decided to use OSG because it manages itself LODs that have to be
> displayed.
>
> The problem is that some objects are drawn before and after my OSG objects
> and I dont want them to be erased. Currently I use the frame() method but
> it only draw the last OSG group and the following non OSG objects because
> frame() reset and swap buffers. So I need OSG to draw in the back buffer
> without clearing it before and  without swapping after.
>
> Is there any way to only do the drawing of an OSG object inside an
> existing OpenGL loop without clearing or swapping buffers ?
>
> ...
>
> Thank you!
>
> Cheers,
> Clement
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66482#66482
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Viewing Stacked Semi-Transparent Geodes

2016-02-04 Thread Christian Buchner
There are techniques to perform order independent transparent rendering,
one of these is demonstrated in the osgoit example
of OpenSceneGraph. However osgoit uses a multipass technique and can be
rather slow.

Christian


2016-02-04 9:31 GMT+01:00 Voerman, L. :

> Hi Erik,
> the effect you see is caused by your blend function being order dependent,
> for a good result transparent triangles need to be drawn back to front.
> Did you set the rendering_hint to TRANSPARENT_BIN (binNumber 10 / binName
> DepthSortedBin)?
> like in stateSet->setRenderingHint(StateSet::TRANSPARENT_BIN);
> Regards, Laurens.
>
> On Wed, Feb 3, 2016 at 9:48 PM, Erik Hensens  wrote:
>
>> Hi everybody!
>>
>> I have two geodes, each is a flat circular disk with some circular holes
>> removed. Each geode is flat in the YZ plane, and they are stacked against
>> each other with a small amount of spacing, centered at (x1, 0, 0) and (x2,
>> 0, 0). There is a single parent matrix transform node that is the parent of
>> both of these geodes, and I use the matrix transform to set different
>> rotations. Each of these disk geodes is semi-transparent by means of
>> calling setAlpha on their materials for the FRONT_AND_BACK faces.
>>
>> The problem is that at certain parent matrix transform rotations certain
>> parts of the first disk are more visually prevalent and at other rotations
>> certain parts of the second disk are more visually prevalent, i.e. how
>> these two semi-transparent geodes are viewed against each other changes
>> based on the rotation of the parent matrix transform. I've attached two
>> images to show you the difference.
>>
>> What is causing this effect and how can I eliminate it? I want it to look
>> the same no matter what the rotation of the parent matrix transform is.
>>
>> Thanks in advance for any help!
>>
>> Cheers,
>> Erik
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=66186#66186
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Avoid "render flickering" using low height cameras angles.

2016-01-22 Thread Christian Buchner
I think you'll want to google strategies to "avoid z-fighting".


2016-01-22 18:41 GMT+01:00 Dario Minieri :

> Hi,
>
> Using low camera height angles (simulating camera zoom action), I can see
> a lot of model "artifacts" (faces flick). Apart a massive model
> optimization, I think this is due to the fact the effective distance
> camera<->object remains unchanged and maybe some render pass cull-off some
> faces. There is a way to avoid this effects using a low height angle?
>
> Thank you!
>
> Cheers,
> Dario
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66088#66088
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Guaranteeing a specific order of node callbacks?

2016-01-15 Thread Christian Buchner
Hi,

I have a couple of Geodes with an associated update callback, responsible
for updating the nodes.

Now due to a customer request there is a dependency between these Geodes,
requiring a specific order in which these callbacks have to be executed.
My geodes each render a 3-dimensional cylinder indicating a measurement
value. Now the customer wants different measurements stacked on top of each
other, and hence the bars on top need to know the value of the bar below in
order to render correctly.

This is done easiest if I can guarantee that the node callbacks will be
called in a specific order (bottom to top, in stacking order)

Is there any mechanism to do deal with order dependencies of scene graph
updates, such as the render bins that are used in rendering?

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to draw a Curved Surface?

2015-11-20 Thread Christian Buchner
If your terrain surface uses a GLSL fragment shader, you could add a 2D
point in polygon test on the x/y coordinate and add or blend a highlighting
color to the generated fragment when it passes the PIP test. It might get
kind of slow when your enclosing polygons has a lot of vertices.

For a decent PIP test algorithm, look here:
http://stackoverflow.com/questions/11716268/point-in-polygon-algorithm


2015-11-18 12:58 GMT+01:00 Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de>:

> Hello Bean?
>
> You can use the polytop intersector to get all primitives inside and draw
> them with an polygon offset applied on top of the original geometry.
>
> Cheers
> Sebastian
>
> primitive problem
>
> 
>
>
> 
>
>
> 1、how to draw a Curved Surface on the top of terrain? like the fig.
> 2、 how to compute the surface area of the Curved Surface?
> [image: 内嵌图片 1]
> I  want to use  polytope intersector, but I don't have  inspiration. So
> can you give me some advise?
> thank you a lot.
>
>
> ___
> osg-users mailing 
> listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] First steps to improve culling

2015-11-13 Thread Christian Buchner
If you have lots of similar objects (crates boxes and whatnot), maybe GPU
instancing would be a way to speed up draw calls. We've managed to get
15000 cars on screen at high frame rates using OpenGL instancing, with
several hundred polys per instance.

Christian


2015-11-13 10:09 GMT+01:00 Robert Osfield :

> Hi Alexandre,
>
> On 12 November 2015 at 20:30, Alexandre Vaillancourt <
> alexandre.vaillancourt.l...@gmail.com> wrote:
>
>> Thanks for your reply, and of course I should have specified the version.
>> It's 3.2.0, we're planning to update to the most recent one within the next
>> 3 months.
>>
>> I have attached the screenshot. I'm not authorized to post anything not
>> approved by the higher end so the visuals have been "painted", but the
>> stats are there.
>>
>
> From the screenshots the cull and draw dispatch don't look particular
> high, but the draw GPU is clear bottleneck and will be the primary cause of
> slow down.
>
> The number of objects that the OSG and hence OpenGL is dealing with isn't
> massive so optimizing the scene graph structure probably won't gain you too
> much.  Not to say you might not be able to optimize things further but for
> now I'd suggest you best spend your efforts looking at how to optimize what
> is happening on the GPU.
>
> You could look at threading - CullThreadPerCameraDrawThreadPerContext
> would be worth trying just to see how it changes things.  As you are GPU
> limited I don't expect this to make a big differents but since calling
> "viewer.setThreadingModel(osgViewer::Viewer::CullThreadPerCameraDrawThreadPerContext"
> is single line addition to your app it shouldn't take to long to test out.
>
> On the GPU optimization side there are lots of different things that can
> cause bottlenecks, each one will have a different set of solutions.  It's
> rather open ended topic, so you'll need to do a range of benchmark tests to
> find out what is the main bottleneck on the GPU.  One easy test would be to
> change the resolution of the different windows - such as half in each
> dimension to cut the fill requirements to a 1/4.  If you run the benchmarks
> in this configuration and look at how the GPU stats change you'll get an
> idea of relative load on vertex vs fragment processing.  For instance if
> the performance doesn't change much when you change resolution then you are
> likely to be vertex processing limited, while if the performance does vary
> significantly then you'll be fill limited.
>
> Robert.
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] wrapping an externally generated OpenGL texture in an osg::Texture ?

2015-11-06 Thread Christian Buchner
Hi,

I have some legacy OpenGL code that is integrated with our OSG based
application. This code creates and updates its own textures using OpenGL
API calls and we are using a custom drawable with a drawImplementation()
that binds said textures with OpenGL API calls before rendering the
geometry. We have to be quite careful about saving and restoring the OpenGL
texture states and this works reasonably well.

Now I would like to use the textures generated by the legacy code on some
newly created OSG nodes and geodes. Preferably I would like to wrap the
OpenGL texture IDs into instances of osg::Texture2D and osg::TextureObject
classes. I intend to attach the textures to an osg::StateSet (no custom
draw implementations shall be required).

Is there any prior art or examples showing how to instantiate
osg::TextureObject/Texture2D objects from externally generated OpenGL
texture IDs? Is this even possible without breaking anything?

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Any (free) alternatives to SpeedTree?

2015-11-05 Thread Christian Buchner
Hi, the recent interest in Speedtree integration into OSG has made me
curious as to what Open Source or commercial alternatives might exist.

The osgforest sample is a bit too simplistic, in that it either renders
only MatrixTransform trees or billboards. So, how to render lots of
realistic trees or vegetation in OSG without dragging down performance too
much?

What is being used in the FlightGear simulation to display forests?

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Oculus+OSG

2015-10-22 Thread Christian Buchner
NOTE: Oculus SDK and Runtime 0.8.0.0 beta have just been (quietly) released.

Find a change log here:
https://developer.oculus.com/downloads/pc/0.8.0.0-beta/Oculus_Runtime_for_Windows/

Christian


2015-09-29 21:24 GMT+02:00 Jan Ciger :

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hello,
>
> On 29/09/15 12:22, Antoine Galluet wrote:
> > Hi,
> >
> > Please tell me if you prefer me to post my issue in another thread
> > to keep this one clean.
> >
>
> Please, don't hijack threads with unrelated issues. Make a new
> thread/topic.
>
> > I'm starting with openscenegraph and the oculus. I compiled the
> > viewer and I can load the basic example (cow, plane). But I have an
> > error when I try to load one of my own .osgb. The viewer returns me
> > "InputStream::readObject<>: Unsupported wrapper class"
> >
> > Do you have any clue of what's going wrong?
>
>
> Your problem is likely because you are trying to load an .osgb file
> that was exported by an incompatible OSG version. That has nothing to
> do with Oculus Rift whatsoever.
>
> Try to use osgconv on the file and convert it to .osg for example. If
> you set OSG_NOTIFY_LEVEL env. variable to DEBUG, it might give you
> idea why it has failed.
>
>
> Regards,
>
> Jan
>
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v2
>
> iD8DBQFWCuWLn11XseNj94gRAqcnAJwJL/z9wZbD8nfGq6Ckc+AjBSzGZgCdGv0l
> ETZWZaJidAldsagsFMCikDI=
> =/Hf3
> -END PGP SIGNATURE-
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how i can remove a sphere that is in a vector in the scene

2015-10-22 Thread Christian Buchner
I believe your vector has to be storing pointers to the sphere objects, not
entire sphere objects themselves. And indeed the same pointer is passed to
addChild, as to removeChild afterwards, things *should* work as intended.
To make sure, print the pointer values you pass to addChild/removeChild to
verify.

some background:
Due to the private destructor of any child of osg::Referenced any such
object cannot be put into standard containers. OSG wants to stay in control
of object creation and destruction using its internal reference counting
system, and hence the destructor cannot be made public or the container
class would destroy the object whenever it wants (even when still
referenced by the OSG graph).

Christian


2015-10-22 13:52 GMT+02:00 Alvaro Ginestar :

> hi everyone!!
> i try remove a sphere, with "removechild" it doesn't work.
> i use root->addChild(vector[x]); for to add the sphere in a node root and
> then i try to remove with root->removeChild(vector[x]);
> In the scene is draw a sphere, but it doesn't remove the sphere.
> someone know I'm doing wrong?
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] the new glTF format by the Kronos Group

2015-10-21 Thread Christian Buchner
Apologies for not proofreading my initial post as much. "a interesting"
should have been "interested".

Well, there is some source code in the Khronos github repository, but it's
mostly a Collada 2 glTF converter as well as some JavaScript code for
loading such content into WebGL I suppose.

So it seems the implementation of a reader plug-in would have to be mostly
from scratch. A writer plug-in might be slightly easier to come up with,
based on parts of the Collada 2 glTF converter.

Christian


2015-10-20 23:59 GMT+02:00 Jan Ciger :

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 20/10/15 20:56, Chris Hanson wrote:
> > I could probably crank out a glTF loader in short work if anybody
> > was interested. I haven't had any clients come forth demanding one
> > yet, but it may happen. We'll see. Can't be any more complicated
> > than COLLADA! ;)
>
> Well, considering it is a part binary format, I wouldn't underestimate
> it :) It could be easily a similarly complex mess, only in a different
> way.
>
> J.
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v2
>
> iD8DBQFWJrk2n11XseNj94gRArJLAJ9F85H5NayajscCXBdkzGg//A1cwgCg268J
> CsXoNZLQwWo7rfJ7vxw6WcI=
> =ucym
> -END PGP SIGNATURE-
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] the new glTF format by the Kronos Group

2015-10-20 Thread Christian Buchner
Hi all,

The Khronos group has published a specification for a data exchange and
transmission format for 3D objects and scenes, it appears

https://github.com/KhronosGroup/glTF

I think the OpenScenegraph community might be a interesting in implementing
a a file format plugin, or even come up with a standaloner viewer for this
format.

So far it is hard to tell if this format will be widely adopted. But having
support in OSG from an early point in time could either make OSG more
popular, or glTF...  ;)

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Oculus+OSG

2015-09-25 Thread Christian Buchner
hmm..
make sure a) SLI is disabled (if you have two or more cards linked)
b) you're running the latest nVidia developer drivers from here
https://developer.nvidia.com/gameworks-vr-driver-support

I have no such artifacts. Running the OSG 3.2 branch here.



2015-09-25 10:52 GMT+02:00 Riccardo Corsi :

> Hi Björn,
>
> first of all thank you for keeping up to date the Oculus integration!
>
> I have just updated to SDK 0.7 + osgOculus head and the viewer works, but:
>
> 1. while the provided Oculus demos are really smooth with respect to
> motion,
> the osg viewer example results quite jerky, especially the rotation of the
> head causes a sort of "hiccup"
> during the motion
>
> 2. when using the osg viewer example, the right eye monitor has some
> flickering every second or so,
> a part of the screen becomes black/corrupted for some frames.
>
> Have you ever noticed such behaviors?
> Have you got any suggestion to fix them?
>
> Thank you,
> Ricky
>
> On Wed, Sep 9, 2015 at 1:46 PM, Björn Blissing 
> wrote:
>
>> Hi,
>>
>> I just fixed a performance related bug.
>>
>> Due to misuse of an enum I had accidentally disabled all culling. (This
>> bug would probably been avoided if strongly typed enum a'la C++11 were
>> used).
>>
>> This bug only affects users using Oculus SDK 0.6 and 0.7. I urge all
>> users of these versions of OsgOculusViewer to update to the head revision
>> on GitHub.
>>
>> Best regards,
>> Björn
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=65077#65077
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Modern GLSL and OSG

2015-09-24 Thread Christian Buchner
NOTE: the current development version of ANGLE is targeting OpenGL ES 3.0,
if you want to be more up to date. I am not sure about its level of
completion and stability though.

Maybe you can find more complete (commercial?) virtualization solutions to
run the DX backend. Also maybe Wine is suitable for this. DirectX 9.0c
should be well supported by Wine (or its commercial counterpart Crossover).

Christian


2015-09-23 14:49 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>:

>
> If you're using Windows you could try building OSG against ANGLE
> and limit yourself to the OpenGL ES 2.0 API feature set. Here you can't
> accidentially fall back into using deprecated (fixed function) features
> because these have been stripped from the API.
>
> There would also be plenty of books about OpenGL ES 2.0 available - and
> you can immediately target mobile platforms (iOS, Android)
>
> Christian
>
>
> 2015-09-23 14:44 GMT+02:00 Garth D <garthy_...@entropicsoftware.com>:
>
>>
>> Hi all,
>>
>> I was wondering if anyone can make some suggestions as to resources that
>> are useful for learning GLSL in modern OpenGL (say, 3.0+) with a specific
>> focus on use with OSG.
>>
>> My existing GLSL knowledge is weak compared to my general 3D knowledge,
>> and mostly dates back to the early days of shaders. A lot of what I have
>> personally done with OpenGL and OSG has involved the fixed-function
>> pipeline, or things that map to it fairly closely.
>>
>> Thus far I've been digging around online for GLSL resources, but tend to
>> frequently find myself doing it the wrong way as I'm using features that
>> have since become deprecated. On the OSG side I tend to dig around in the
>> OSG examples and search the source to try to find the OSG equivalents to
>> OpenGL calls I see mentioned in the GLSL resources. I then put these
>> together and if I'm lucky something useful comes out. :)
>>
>> I think I'll figure things out eventually if I continue to crash around
>> blindly as I have been, but if anyone can suggest some better starting
>> points for GLSL use in OSG specifically, it would be much appreciated. :)
>>
>> Cheers,
>> Garth
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Modern GLSL and OSG

2015-09-23 Thread Christian Buchner
If you're using Windows you could try building OSG against ANGLE
and limit yourself to the OpenGL ES 2.0 API feature set. Here you can't
accidentially fall back into using deprecated (fixed function) features
because these have been stripped from the API.

There would also be plenty of books about OpenGL ES 2.0 available - and you
can immediately target mobile platforms (iOS, Android)

Christian


2015-09-23 14:44 GMT+02:00 Garth D :

>
> Hi all,
>
> I was wondering if anyone can make some suggestions as to resources that
> are useful for learning GLSL in modern OpenGL (say, 3.0+) with a specific
> focus on use with OSG.
>
> My existing GLSL knowledge is weak compared to my general 3D knowledge,
> and mostly dates back to the early days of shaders. A lot of what I have
> personally done with OpenGL and OSG has involved the fixed-function
> pipeline, or things that map to it fairly closely.
>
> Thus far I've been digging around online for GLSL resources, but tend to
> frequently find myself doing it the wrong way as I'm using features that
> have since become deprecated. On the OSG side I tend to dig around in the
> OSG examples and search the source to try to find the OSG equivalents to
> OpenGL calls I see mentioned in the GLSL resources. I then put these
> together and if I'm lucky something useful comes out. :)
>
> I think I'll figure things out eventually if I continue to crash around
> blindly as I have been, but if anyone can suggest some better starting
> points for GLSL use in OSG specifically, it would be much appreciated. :)
>
> Cheers,
> Garth
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] performance mystery with an osg::TerrainTile on nVidia. Intel wins.

2015-09-17 Thread Christian Buchner
Hi all,

I am loading a single osg::TerrainTile into my scenegraph, as a child of an
osg::Terrain. Into this tile goes a height field and one image layer.

I have got around 80k vertices and 157k triangles in a single drawable that
is marked as a "fast" drawable in the OSG stats handler (shown by using the
s hotkey)

While this application runs butter smooth on Intel integrated graphics (60
FPS), I am experiencing somewhat of a mystery slowdown on nVidia GTX 970
and an nVidia GT 750M.

5 FPS and draw times of 170ms upwards on the 750M for example.
This is on Ubuntu 12.4 with nVidia driver 331.113

10 FPS and draw times of 78ms upwards on the GTX 970M.
This is on Ubuntu 12.4 with nVidia driver 346.46

The geometry created by src/osgTerrain/GeometryTechnique disables display
lists and uses vertex buffer objects. It's referencing a vertex buffer
using a single osg::DrawElementsUInt(GL_TRIANGLES).

The slowdown is a mystery. Any ideas what might be going on here? Why would
the nVidia driver be hitting such a slow code path? In terms of geometry
complexity, 80k vertices and 157k triangles is a joke even for today's
entry level GPUs.

Let me know if you need some code for repro'ing.

Christian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] performance mystery with an osg::TerrainTile on nVidia. Intel wins.

2015-09-17 Thread Christian Buchner
Found the culprit for my performance woes. The nvidia driver's GLX module
for Xorg was likely overwritten by an update to xorg. This caused the GLX
module initialisation to fail and the following lines to appear in the log
file.

[   873.392] (EE) NVIDIA(0): Failed to initialize the GLX module; please
check in your X
[   873.392] (EE) NVIDIA(0): log file that the GLX module has been
loaded in your X
[   873.392] (EE) NVIDIA(0): server, and that the module is the NVIDIA
GLX module.  If
[   873.392] (EE) NVIDIA(0): you continue to encounter problems, Please
try
[   873.392] (EE) NVIDIA(0): reinstalling the NVIDIA driver.

[   874.171] (II) AIGLX: Screen 0 is not DRI2 capable
[   874.171] (EE) AIGLX: reverting to software rendering
[   874.177] (II) AIGLX: Loaded and initialized swrast
[   874.177] (II) GLX: Initialized DRISWRAST GL provider for screen 0

The OpenGL system therefore reverted to software rasterization.

What I do not understand is why the command "glxinfo" kept showing NVIDIA
Corporation as vendor for OpenGL in this case.

After reinstalling the nVidia driver, my draw times for the terrain tile
are in the range of 0.2 ms. Yay. In your face, Intel.

Christian



2015-09-17 16:05 GMT+02:00 Christian Buchner <christian.buch...@gmail.com>:

> Hi all,
>
> I am loading a single osg::TerrainTile into my scenegraph, as a child of
> an osg::Terrain. Into this tile goes a height field and one image layer.
>
> I have got around 80k vertices and 157k triangles in a single drawable
> that is marked as a "fast" drawable in the OSG stats handler (shown by
> using the s hotkey)
>
> While this application runs butter smooth on Intel integrated graphics (60
> FPS), I am experiencing somewhat of a mystery slowdown on nVidia GTX 970
> and an nVidia GT 750M.
>
> 5 FPS and draw times of 170ms upwards on the 750M for example.
> This is on Ubuntu 12.4 with nVidia driver 331.113
>
> 10 FPS and draw times of 78ms upwards on the GTX 970M.
> This is on Ubuntu 12.4 with nVidia driver 346.46
>
> The geometry created by src/osgTerrain/GeometryTechnique disables display
> lists and uses vertex buffer objects. It's referencing a vertex buffer
> using a single osg::DrawElementsUInt(GL_TRIANGLES).
>
> The slowdown is a mystery. Any ideas what might be going on here? Why
> would the nVidia driver be hitting such a slow code path? In terms of
> geometry complexity, 80k vertices and 157k triangles is a joke even for
> today's entry level GPUs.
>
> Let me know if you need some code for repro'ing.
>
> Christian
>
>
>
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Normal bindind

2015-09-15 Thread Christian Buchner
Wouldn't that imply that neighbor triangles cannot share their vertices
because the normal is different for each primitive? For high resolution
meshes this could create quite some overhead (memory and processing wise).
Is there a more efficient way to get flat shading that would not require
any vertex duplication?

Christian


2015-09-14 12:59 GMT+02:00 Robert Osfield :

> Hi Julie,
>
> OpenGL doesn't support bind per primitive, there is deprecated OSG pathway
> for BIND_PER_PRIMITIVE but it has to emulate the functionality and is very
> inefficient.
>
> The closest you can get to what you are after is to BIND_PER_VERTEX and
> then use flat shading.
>
> Robert.
>
> On 14 September 2015 at 10:56, Julie Green  wrote:
>
>> Hi,
>>
>> I have a surface, made of triangles. Is there a way to bind surface
>> normals per triangle, not per vertex (don't want to calculate vertex
>> normals)?
>>
>> Thank you!
>>
>> Cheers,
>> Julie
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=65128#65128
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


  1   2   3   4   >