Re: [osg-users] osgShadow 3.6.3

2020-02-18 Thread OpenSceneGraph Users
Hi Catalin,

None of the osgShadow technique support shadows that surround a point light 
source as you have in your scene.  This limitation is due the way that 
projective texturing is used for the shadow map, essentially you are 
limited to FOV from the light source to less than 180.

The only way to remove this limitation is to use multiple shadow maps, such 
as using a cube map for the shadow map.  None of the osgShadow techniques 
support this though so you'd need to implement this yourself.

The osgShadow shadow techniques are also limited to a single light source, 
to enable support for a number of light sources you have to built a 
separate shadow map for each light source.

For you application I would suggest handling spot lights with a single 
shadow map, and point lights that are within the volume as a cubemap, if 
you have directional lights then potentially you could use a single shadow 
map, though it's likely you'd want to make the the shadow map view 
dependent to avoid under sampling when you zoom into local areas.

I'm afraid general purpose shadowing is hard, it's a huge topic, it won't 
be just a case of tweaking bits of an existing implementation.  

Cheers,
Robert.


-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/85c74239-037c-497b-9fe2-cb1285f1bf18%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgQt::GLWidget Scroll Bug

2020-02-18 Thread OpenSceneGraph Users
Thanks for your reply Robert.  I did end up stepping through and turns out 
it is an issue with the EarthManipulator setting a duration for the 
viewpoint change.  I'll post on the osgEarth forum.

Thanks again,
Scott

On Monday, February 17, 2020 at 1:07:59 PM UTC-5, Robert Osfield wrote:
>
> Hi Scott,
>
> I don't know where the issue lies, but most likely it's in the windowing 
> integration side rather than the core OSG as it doesn't look like you'll be 
> relying on any of the OSG's native windowing/event handling.  There might 
> be an issue with osgQt, but I'm not the author of maintainer for it so will 
> have to defer to others on this.  Or it could be an issue with osgEarth.
>
> The best I can suggest is that you build the OSG, osgEarth, osgQt and your 
> application in debug mode, then step through the code in a debugger to see 
> where the control flow passes when the wheelEvent happens.
>
> Cheers,
> Robert.
>
> On Thursday, 13 February 2020 07:58:17 UTC, Scott Shaw wrote:
>>
>> I think I'm running into a bug in OSG.  I've implemented my own versions 
>> of mouse events in a sub-classed osgQt::GLWidget so I can redraw the 3D 
>> view only when necessary:
>>
>> void Osg3dViewCM::mousePressEvent(QMouseEvent* event)
>> {
>> m_mouseDown = true;
>>
>> if (_cameraManipulator.valid())
>> {
>> osgQt::GLWidget::mousePressEvent(event);
>>
>> frame();
>> }
>> }
>>
>> void Osg3dViewCM::mouseReleaseEvent(QMouseEvent* event)
>> {
>> m_mouseDown = false;
>>
>> if (_cameraManipulator.valid())
>> {
>> osgQt::GLWidget::mouseReleaseEvent(event);
>>
>> frame();
>> }
>>
>> emit cameraChanged(_cameraManipulator->getInverseMatrix());
>> }
>>
>> void Osg3dViewCM::mouseMoveEvent(QMouseEvent* event)
>> {
>> if (_cameraManipulator.valid() && m_mouseDown)
>> {
>> osgQt::GLWidget::mouseMoveEvent(event);
>>
>> frame();
>> }
>> }
>>
>> void Osg3dViewCM::wheelEvent(QWheelEvent *event)
>> {
>> if (_cameraManipulator.valid())
>> {
>> osgQt::GLWidget::wheelEvent(event);
>>
>> frame();
>> }
>> }
>>
>> I'm using a default osgEarth::Util::EarthManipulator and clicking and 
>> dragging on the view updates it without an issue rotating or panning 
>> properly.  For some reason, when I scroll the wheel, the frame function 
>> doesn't update the view.  If I click on the view after scrolling, it gets 
>> updated with the zoom operation applied.  Am I missing something?
>>
>> Thank you,
>> Scott
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/40569c26-d8a0-4472-9547-bce50a5492f7%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgShadow 3.6.3

2020-02-18 Thread OpenSceneGraph Users
Hi,

We are trying to test the shadows using OSG, We have multiple lights, but
for now we are playing with only one light, a point source light type. We
are some weird effects, the shadows are cut, a mirror scene as shadow
behind the light. See the video.

https://www.youtube.com/watch?v=hyFBX0jGjaw

osg::ref_ptr shadowedScene = new
osgShadow::ShadowedScene;

shadowedScene->getShadowSettings()->setLightNum(1);
shadowedScene->setReceivesShadowTraversalMask(GetShadowNodeMask());
shadowedScene->setCastsShadowTraversalMask(GetShadowNodeMask());

osg::ref_ptr st = new osgShadow::SoftShadowMap;
st->clearShaderList();
st->setAmbientBias(osg::Vec2(0.5,1.0 - 0.5));

shadowedScene->setShadowTechnique(st.get());

view->addChild(shadowedScene);
shadowedScene->addChild(scene);

// Set the Scene Data
mViewer->setSceneData(view);

Any points that you may have, might help us.

Does osgShadow supports multiple lights?

Greetings,
Catalin

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/mailman.70892.1582030546.7169.osg-users-openscenegraph.org%40lists.openscenegraph.org.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/mailman.70892.1582030546.7169.osg-users-openscenegraph.org%40lists.openscenegraph.org.


Re: [osg-users] Export GLTF from OSG?

2020-02-18 Thread OpenSceneGraph Users
We have a gltf importer/exporter that we use in osgearth based on 
tinygltf.   It works really well although we're really only targeting gltf 
files produced to support rendering 3d tiles datasets.  So for example we 
havent done anything with animation since that's not a big part of 
3dtiles.   Give it a look and see if you might be able to use it.

It's in the in development 3.0 version of osgearth here:  
https://github.com/gwaldron/osgearth/tree/3.0/src/osgEarthDrivers/gltf

Jason



On Monday, February 17, 2020 at 1:29:28 PM UTC-5, Armin Samii wrote:
>
> Hi Robert,
>
> The animations are reading live data and rendering them - so it's not a 
> simple format, but can be represented by gltf well: the mesh models are 
> static, but can appear and disappear and can have arbitrary transformations 
> applied to them.
>
> My vision is an exporter that exports each unique Geode exactly once, and 
> everything else in the scenegraph exported each frame. That would work well 
> for a wide range of OSG-based applications, it seems, and GLTF seems 
> well-suited for this.
>
> On Monday, February 17, 2020 at 1:01:48 PM UTC-5, Robert Osfield wrote:
>>
>> Hi Armin?
>>
>> On Friday, 7 February 2020 19:06:19 UTC, Armin Samii wrote:
>>>
>>> Has anybody worked on exporting GLTF Animations from OSG?
>>>
>>> I'd like to save my dynamic OSG scene to disk, and don't want to save 
>>> the static geometry each frame. GLTF lets me export the geometry once, and 
>>> animate it each frame thereafter.
>>>
>>> Curious if anybody has tried something similar, or if there is existing 
>>> code to do this.
>>>
>>
>> I don't know of any open sourced GLTF importers or exporters for the OSG.
>>
>> What form do your animations take?
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/6348c881-2838-4a01-b744-73366941bd7d%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org