Re: [osg-users] Issue with shadow

2016-09-21 Thread Suraj Paul
Hi marchingcubes,

Thanks a lot for your reply. Being unaware of the  shortcoming of the 
'shadowmap' of OSG for large terrain, I was struggling with shadow. the link u 
shared is really useful one and exactly addresses my problem. However, i am yet 
to include these few-found techniques of the link in my OSG code. I will get 
back to u and update. 
Any help on how to include the 'Soft shadow map' and cascaded shadow methods in 
OSG?
... 

Thank you!

Cheers,
Suraj

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





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


Re: [osg-users] Issue with shadow

2016-09-21 Thread Pete Black
Its becase OSG's default shadowMap code isn't very good for large scenes - the 
shadow camera frustum is sized to fit the entire scene, so an individual shadow 
map pixel may cover a large number of rendered fragments, making the shadows 
very pixellated, and the 'shadow acne' - caused by a similar aliasing issue is 
severe.

the 'Soft shadow map' technique does some filtering which improves things a 
fair bit, and there are other algos like LISPSM which try to use shadowmap 
pixels more efficiently.

The 'standard' approach to this in other engines is to use cascaded shadow 
maps, which render multiple passes and combines them to make close-up and 
distance shadows work nicely, but this approach is not implemented in osgShadow 
AFAIK.

heres some info on shadow mapping details:

http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/

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





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


Re: [osg-users] Attaching children to the prerender camera

2016-09-21 Thread Trajce Nikolov NICK
Hi Mary-Ann,

hard to tell without seeing the code.. Can you isolate a sample code so I
can run it at my end?

On Wed, Sep 21, 2016 at 3:51 PM, Mary-Ann Zorra  wrote:

> Hi Nick,
>
> Thank you for your answer. I have a callback now, which prints every time
> the texture image to file, when the framebuffer is rendered. I also added a
> debug line to the fragment shader, so I can see, that my shader is able to
> render. But it still can not see the objects in the scene graph, although I
> am sure, that the view and projection matrix is set properly. May you have
> any idea, where I am doing a mistake?
>
> Thanks for your help!
> Mary-Ann
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68684#68684
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



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


Re: [osg-users] Attaching children to the prerender camera

2016-09-21 Thread Mary-Ann Zorra
Hi Nick,

Thank you for your answer. I have a callback now, which prints every time the 
texture image to file, when the framebuffer is rendered. I also added a debug 
line to the fragment shader, so I can see, that my shader is able to render. 
But it still can not see the objects in the scene graph, although I am sure, 
that the view and projection matrix is set properly. May you have any idea, 
where I am doing a mistake?

Thanks for your help!
Mary-Ann

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





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


[osg-users] Lazy Disabling without VertexFuncsAvailable

2016-09-21 Thread Fabian Wiesel
Hi,

I have converted my fixed function OSG program to a shader pipeline 
(using setVertexAttribArray and shaders instead of the setVertexPointer et al)
and did run into some issues when disabling "UseVertexAttributeAliasing", and 
OSG is compiled with OPENGL_PROFILE=GLCORE
(So OSG_GL_VERTEX_FUNCS_AVAILABLE is unset). I tested the same code on a linux 
with OSG compiled for a FFP.
And there, the code works as expected.

A simple test program is here: https://github.com/fwiesel/vertexarrayfunctest

An API trace of the failing case shows the following interesting part:
...
glEnableVertexAttribArray(0)
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL) # NULL is okay, the 
Array has been bound before
glDisableVertexAttribArray(0)
glDisableVertexAttribArray(1)
glDisableVertexAttribArray(2)
glDisableVertexAttribArray(11)
glDisableVertexAttribArray(12)
glDrawArrays(GL_POINTS, 0, 500)
...

No prior call to enable the array 1,2, 11, or 12 are issued.
The glDisableVertexAttribArray calls are coming from 
osg::State::applyDisablingOfVertexAttributes()

https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osg/State.cpp#L1296-L1304
 as _useVertexAttributeAliasing is false, and each "._lazy_disable" is 
true.
The state of "._enabled" is never checked, as "disablePointer" is 
unconditionally mapped to the aliased "disableVertexAttribArray"

I think, the bug lies in the assumption of the lazy disabling, that if we do 
not use the aliasing, that there is a fixed function pipeline.
But if OSG_GL_VERTEX_FUNCS_AVAILABLE the functions are unconditionally mapped 
to aliased vertex attributes.

I think, the whole lazy disabling of aliased attributes is superfluous in that 
context, as each vertex attribute tracks its own state already,
and have proposed a patch accordingly: 
https://github.com/openscenegraph/OpenSceneGraph/pull/125
With the patch applied, the code runs as expected.

Does anyone have a different explanation or a better proposal for solving the 
issue? It doesn't seem to be the acceptable solution.

Cheers,
  Fabian



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


Re: [osg-users] different materials for a geometry and highlight

2016-09-21 Thread Gianni Ambrosio
Hi Nick,
the problem I have is that I change the content of primitive sets but the color 
does not change in the 3D view.

Regards,
Gianni

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





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


Re: [osg-users] different materials for a geometry and highlight

2016-09-21 Thread Trajce Nikolov NICK
Hi Gianni,

I am having the same results as in the video and I thought that is what is
expected - I thought your main problem was updating the selection area with
colors. Let me see if I can spot something else in your code ... I am doing
this in breaks :-)

On Wed, Sep 21, 2016 at 8:48 AM, Gianni Ambrosio 
wrote:

> Sorry the avi extension is not allowed. Here is the movie.
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68678#68678
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


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


Re: [osg-users] Scale-invarient lighting

2016-09-21 Thread Sebastian Messerschmidt

Hi Dave,

Sorry for the slow response, I've worked it out.

I had to:
- Add normals to all points
- Add directional lighting from multiple directions (6 in fact), so that the 
lighting is fairly omnidirectional

...and the points are now showing correctly. Thanks for the help!
That seems a bit overkill. If you simply want the points to be uniformly 
lit, you can disable lighting for them and assign the color you need.


Cheers
Sebastian


Dave

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





___
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] different materials for a geometry and highlight

2016-09-21 Thread Gianni Ambrosio
Hi Nick,
thanks for the support but even with that line I can't see the result I 
expected. Basically, when the application starts, if I select a green triangle 
then it should be shown in red, while now it ramains green. (please see 
attached movie). In fact the triangle after picking is moved from primitive set 
1 to primitive set 0. Triangles belonging to primitive set 0 are accociated 
with red color in the color array. It's fine to see the white selector triangle 
"over" the selected triangle but is shoud become red.


Regards,
Gianni

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





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