Re: [osg-users] Trans/Rot need for quad fill entire screen?

2012-03-20 Thread Chris Hanson
>
> I need to pull back from the Quad for it to exactly fill the screen.
>
>
   You may be going about this wrong. What are you actually trying to
accomplish?


-- 
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
Digital Imaging • GIS • GPS • Telemetry • Cryptography • Digital Audio •
LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgShadow and multitexture

2012-03-20 Thread Jean-Sébastien Guay

Hi Wojtek,


This should be no problem for models with more
texture stages as long as you substitute shadow technique shaders with
your own set which can process your multiple textures correctly.


Almost correct - the problem is that the shadow technique also disable 
all shaders for the shadow pass. So even if the models / scene provide 
shaders which do multitexturing, the shadow pass will only alpha blend / 
alpha test with the texture in unit 0 when rendering the shadow pass.


A shader could be set with OVERRIDE mode in the graph, and then (IIRC) 
it will be used during the shadow pass. I'd have to check the code again 
to confirm that the disabling is not done with PROTECTED mode...


J-S
--
__
Jean-Sebastien Guay  jean_...@videotron.ca
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Trans/Rot need for quad fill entire screen?

2012-03-20 Thread Paul Griffiths
Hi,

Lets say:

A Quad (4 * 3 units) at pos(0, 10, 0), rot(0, 45, 0).

The screen is 800 * 600 (ratio 4/3)

What is the trans & rot needed from the Quad for the Quad to fill the entire 
screen?

I need to pull back from the Quad for it to exactly fill the screen.

Any advice?




... 

Thank you!

Cheers,
Paul

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





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


[osg-users] Global state attribute (uniform)

2012-03-20 Thread Aurelien Albert
Hi,

I would like to add a global uniform to my scene graph (OSG 3.0.1).

By "global", I mean that "all shaders can access to its value, anywhere in the 
graph"

So, first I've binded this uniform on my scene graph root object, it works well.

But now, the project has evolved and I need a modification : the global uniform 
is not anymore a part of the scene graph root object stateset, but added to a 
leaf node stateset.

Is there anyway to make this uniform accessible by every shader in the scene 
graph ?

I'm thinking about the "gl_light" stateattribute which affect the whole scene 
even if it's not set on the top object. Is there anyway to get this behavious 
for a uniform ?

I've also read this topic : 
http://forum.openscenegraph.org/viewtopic.php?t=4755 :
use cull callback to edit a uniform value, but I need to add a uniform

And I found this : "osgUtil::SceneView::getGlobalStateSet()" which is maybe 
usefull, but the "osgUtil::SceneView" is deprecated, so I don't know if I 
really can use it.

Thank you!

Cheers,
Aurelien

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





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


Re: [osg-users] Segmentation fault in osgDB::readNodeFile()

2012-03-20 Thread Robert Osfield
Hi Mark,

On 20 March 2012 15:07, Mark Green  wrote:
> Thanks to everyone for the help given, the problem has been solved now. Your 
> hunch was indeed correct about requiring a reinstall. What exactly went wrong 
> during the initial install hasen't become clear, but the segmentation fault 
> and the warning dissappeared after said reinstall.
>
> As a sidenote, updating the application to use osgViewer instead of 
> osgProducer went smoothly and with no large hiccups. All the main functions 
> are working great on the new version.

Good to hear everything is now work as nature intended :-)

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


Re: [osg-users] Nodes in osg::Group affect each other's state.

2012-03-20 Thread Robert Osfield
Hi Eldar,

I you don't assign a colour to a geometry and the shader/fixed
function pipeline is using colour then it'll inherit it's state from
the last time that it was applied, in your case it would have been
other geometry in your scene.  If you want a specific colour on
geometry then you need to apply one as you have done.

Robert.

On 20 March 2012 13:48, Eldar Insafutdinov  wrote:
> Hi
>
> I was able to find a workaround to this problem by adding an overall white 
> colour to the textured quad
>
>
> Code:
>
>    osg::ref_ptr colors = new osg::Vec4Array;
>    colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f)); // needs to be white!
>
>    geom->setColorArray(colors.get());
>    geom->setColorBinding(osg::Geometry::BIND_OVERALL);
>
>
>
>
> This made the quad a bit brighter, and fixed an issue of affecting its 
> texture by another geometry's colour. But I still don't understand, if it is 
> a workaround or a proper solution to the problem I had.
>
> Thank you,
> Eldar
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=46438#46438
>
>
>
>
>
> ___
> 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] [vpb] osgdem: set texture minfilter and magfilter to nearest?

2012-03-20 Thread Robert Osfield
HI Ethan,

Texture filter is controlled per osg::Texture, you can't override the
filtering without overriding a the texturing.

If you want to modify the filtering of the textures that an osgTerrain
based database they you'll need to load the scene graph then search
the scene graph to locate the TerrainTile, from these you can get the
color layers, and each of these layer with have the MinFilter and
MagFilter.

Robert.

On 20 March 2012 14:38, Ethan Fahy  wrote:
> And if it's not possible, is there any way to change the filters once I've 
> read a terrain.ive file into an osg project?  I've seen this code snippet:
>
>
> Code:
>
> osg::osg::Node* terrain = osgDB::readNodeFile("terrain.ive");
> osg::Texture2D* tex = new osg::Texture2D;
> tex->setFilter(osg::Texture::MIN_FILTER, osg::Texture::NEAREST);
> tex->setFilter(osg::Texture::MAG_FILTER, osg::Texture::NEAREST);
> terrain->getOrCreateStateSet()->setTextureAttribute(0, tex.get(), 
> osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
>
>
>
>
> but that creates a new texture2d object that overwrites all of my other 
> textures instead of just changing the filter type.  Any advice on this?
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=46441#46441
>
>
>
>
>
> ___
> 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] Geometry object shared by multiple Nodes.

2012-03-20 Thread Glenn Waldron
Yes, single instance.

Glenn Waldron / @glennwaldron


On Tue, Mar 20, 2012 at 11:51 AM, Eldar Insafutdinov <
e.insafutdi...@gmail.com> wrote:

> There's actually one more question I intended to ask: in case of sharing a
> Geometry object through the API does it actually create only one instance
> of it on the graphics card side? The whole reason I use this trick to save
> both systems and graphics memory.
>
> Cheers,
> Eldar
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=46448#46448
>
>
>
>
>
> ___
> 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] Geometry object shared by multiple Nodes.

2012-03-20 Thread Eldar Insafutdinov
There's actually one more question I intended to ask: in case of sharing a 
Geometry object through the API does it actually create only one instance of it 
on the graphics card side? The whole reason I use this trick to save both 
systems and graphics memory.

Cheers,
Eldar

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





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


Re: [osg-users] Geometry object shared by multiple Nodes.

2012-03-20 Thread Eldar Insafutdinov
Thanks, Glenn. I now think it really is the case, because if I position 2 
geometries close enough, the second one isn't truncated. I will investigate in 
details the CullSettings class.

Cheers,
Eldar

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





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


Re: [osg-users] texture sampler uniforms

2012-03-20 Thread Sergey Polischuk
Hi you need to manually create them and add to statesets. If you'll save model after that - they will be saved correctly and will be there on model load. 20.03.2012, 17:15, "Daniel Schmid" :Hi thereI was searching osg to find out what happens with textures when a model node is loaded from file (for example openflight *.flt model). Does osg automatically create uniforms samplers for shaders to access the textures? Do these uniforms have specific names ? or do I have to manually create and bind uniforms for the textures ? RegardsDaniel ___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


Re: [osg-users] Geometry object shared by multiple Nodes.

2012-03-20 Thread Glenn Waldron
Sounds like it might be getting clipped by the near clip plane. OSG
automatically computes a near clip plane based on the bounds of the real
geometry in the scene. It doesn't account for geometry that's altered by a
vertex shader. Check into osg::CullSettings for ways to alter the way clip
planes are computed.

Glenn Waldron / @glennwaldron


On Tue, Mar 20, 2012 at 11:25 AM, Eldar Insafutdinov <
e.insafutdi...@gmail.com> wrote:

> Hi,
>
> I am trying to reuse Geometry objects between multiple osg::Node instances
> and apply geometry shader to reposition them. On the attached testcase I
> tried to implement this. The first osg::Node instance uses unmodified
> Geometry, and the second one uses vertex shader to shift the quad sideways.
> For some reason however, when I rotate the scene the object with a vertex
> shader becomes truncated(see the attached screenshot). Obviously it doesn't
> happen if I use two independent Geometry instances. What do you think can
> cause this truncation? It seems like it's a problem that is difficult to
> debug.
>
> Thank you.
>
> Cheers,
> Eldar
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=46444#46444
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/vertex_shader_139.png
> http://forum.openscenegraph.org//files/testcase_125.cpp
>
>
> ___
> 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] Geometry object shared by multiple Nodes.

2012-03-20 Thread Eldar Insafutdinov
Hi,

I am trying to reuse Geometry objects between multiple osg::Node instances and 
apply geometry shader to reposition them. On the attached testcase I tried to 
implement this. The first osg::Node instance uses unmodified Geometry, and the 
second one uses vertex shader to shift the quad sideways. For some reason 
however, when I rotate the scene the object with a vertex shader becomes 
truncated(see the attached screenshot). Obviously it doesn't happen if I use 
two independent Geometry instances. What do you think can cause this 
truncation? It seems like it's a problem that is difficult to debug.

Thank you.

Cheers,
Eldar

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




Attachments: 
http://forum.openscenegraph.org//files/vertex_shader_139.png
http://forum.openscenegraph.org//files/testcase_125.cpp


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


Re: [osg-users] Segmentation fault in osgDB::readNodeFile()

2012-03-20 Thread Mark Green
Hi,

Thanks to everyone for the help given, the problem has been solved now. Your 
hunch was indeed correct about requiring a reinstall. What exactly went wrong 
during the initial install hasen't become clear, but the segmentation fault and 
the warning dissappeared after said reinstall.

As a sidenote, updating the application to use osgViewer instead of osgProducer 
went smoothly and with no large hiccups. All the main functions are working 
great on the new version. 

Thank you!

Cheers,
Mark

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





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


Re: [osg-users] [vpb] osgdem: set texture minfilter and magfilter to nearest?

2012-03-20 Thread Ethan Fahy
And if it's not possible, is there any way to change the filters once I've read 
a terrain.ive file into an osg project?  I've seen this code snippet:


Code:

osg::osg::Node* terrain = osgDB::readNodeFile("terrain.ive");
osg::Texture2D* tex = new osg::Texture2D;
tex->setFilter(osg::Texture::MIN_FILTER, osg::Texture::NEAREST);
tex->setFilter(osg::Texture::MAG_FILTER, osg::Texture::NEAREST);
terrain->getOrCreateStateSet()->setTextureAttribute(0, tex.get(), 
osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);




but that creates a new texture2d object that overwrites all of my other 
textures instead of just changing the filter type.  Any advice on this?

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





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


Re: [osg-users] Any libraries of public domain shapes for Open Scene Graph?

2012-03-20 Thread Christian Buchner
There are some objects in osg::ShapeDrawable, but they are not
optimized for speedy rendering.
Its constructor takes an osg::Shape, such as Box, Capsule, Cone,
Cylinder, Sphere, ...

Good enough for composing test scenes.

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


Re: [osg-users] Any libraries of public domain shapes for Open Scene Graph?

2012-03-20 Thread Barry
Hello Robert

Your right I should be more precise with my language.

I was wondering if there are collections of shapes available for use in 
OpenSceneGraph applications.

I was thinking more like the the mathematically defined shapes that Christian 
suggested.
But the objects that Andrew suggested would be great too.

Shapes that could be used to compose a scene. OSG has some basic shapes and 
osgWorks has a few more,
but I was wondering it there were any other collections out there in the big 
wide world.

The library of shapes would of course be probably open source as it OSG, so of 
course there use would
require abiding by the OpenSceneGraph Public License, or the licence that the 
object/shape library used.

Sorry for any confusion.

Thanks

Barry

Begin forwarded message:

> From: Christian Buchner 
> Subject: Re: [osg-users] Any libraries of public domain shapes for Open Scene 
> Graph?
> Date: 19 March, 2012 3:10:37 AM MDT
> To: OpenSceneGraph Users 
> Reply-To: OpenSceneGraph Users 
> 
> I am not the original poster, but I'd love to see a library of
> implicitly (mathematically) defined shapes that use GLSL
> raytracing/raymarching for rendering. So you can get perfect spheres
> without any geometry load.
> 
> Spheres, Cones, etc... that kind of stuff that is hard to tacke with meshes.
> 
> If the GLSL allowed for flexibly defined material properties, this
> would be even nicer.
> 
> Christian
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




On 2012-03-19, at 3:15 AM, Andrew Lowe wrote:

> 
> Quoting Robert Osfield :
> 
>> Hi Barry,
>> 
>> On 18 March 2012 22:01, Barry  wrote:
>>> I would like to know if there are libraries of public domain shapes for 
>>> Open Scene Graph, other than the basic ones provided?
>> 
>> I'm rather perplexed by what your actually mean, I'm sure others will
>> be similarly confused by what exactly you are asking.  Could you
>> please explain what you are specifically looking for.  Also I'd like
>> to note that the OpenSceneGraph (OSG) is not public domain, it's open
>> source, and 3rd party open source tooklits associated with the OSG
>> will also not be public domain.
>> 
>> Robert.
> 
> I'm reading this to be models of things such as the Utah Teapot, cars, 
> planes, animals, etc etc etc that is stuff in a format suitable for easy 
> reading into OSG apps, such as the reflective cow. Just out of interest, does 
> the cow have a name - Beryl? Daisy? Bert??
> 
> Prepared to be proven wrong,
>  Andrew
> 
> ___
> 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] Nodes in osg::Group affect each other's state.

2012-03-20 Thread Eldar Insafutdinov
Hi

I was able to find a workaround to this problem by adding an overall white 
colour to the textured quad


Code:

osg::ref_ptr colors = new osg::Vec4Array;
colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f)); // needs to be white!

geom->setColorArray(colors.get());
geom->setColorBinding(osg::Geometry::BIND_OVERALL);




This made the quad a bit brighter, and fixed an issue of affecting its texture 
by another geometry's colour. But I still don't understand, if it is a 
workaround or a proper solution to the problem I had.

Thank you,
Eldar

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





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


[osg-users] texture sampler uniforms

2012-03-20 Thread Daniel Schmid
Hi there
I was searching osg to find out what happens with textures when a model node is 
loaded from file (for example openflight *.flt model). Does osg automatically 
create uniforms samplers for shaders to access the textures? Do these uniforms 
have specific names ? or do I have to manually create and bind uniforms for the 
textures ?

Regards
Daniel

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


[osg-users] Camera attached to object

2012-03-20 Thread Sergey Kurdakov
Hi Sergey,

in computeNodeCenterAndRotation
take a look at

coordinateFrame , I expect it should be unit matrix to be at center of
object.

Regards
Sergey


>
> ___
> 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] PixelBuffer Cocoa - Meaning of output message?

2012-03-20 Thread Robert Osfield
Hi Hartwig,

The warning looks inappropriate, I've removed it and check the change
into svn/trunk.

Thanks,
Robert.

On 19 March 2012 21:41, Hartwig Wiesmann  wrote:
> Hi,
>
> in osgView::PixelBufferCocoa::realizeImplementation there is a line
>
>
> Code:
>
> std::cout << "PixelBufferCocoa :: realizeImplementation not implemented yet " 
> << std::endl;
>
>
>
> Isn't this message obsolete? At least it seems to me that the method is 
> implemented.
>
> Thank you!
>
> Cheers,
> Hartwig
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=46420#46420
>
>
>
>
>
> ___
> 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] osgShadow and multitexture

2012-03-20 Thread Wojciech Lewandowski
Hi,

These lines limit the textures used for rendering shadow map. Basically
there is no need to render the models with textures when we only render
depth in shadow map. The only exception are textures which can contain
alpha and then models will not render the parts with full transparency. So
the lines there turn of all textures (maybe it should be exceeded to max
number of stages available) except stage 0 where base texture with alpha is
assumed to be. This should be no problem for models with more texture
stages as long as you substitute shadow technique shaders with your own set
which can process your multiple textures correctly.

Cheers,
Wojtek Lewandowski

2012/3/20 Daniel Schmid 

> There is a remaining question. In StandardShadowMap.cpp Lines 632 - 639
> (osg 3.0.1) I find lines setting the texture mode for stage 1-4. Why is
> there a limitation to these 4 stages, and what are they doing? If my model
> uses 4 textures and the shadow should go on layer 5, could this be a
> problem?
>
>
> -Ursprüngliche Nachricht-
> Von: osg-users-boun...@lists.openscenegraph.org [mailto:
> osg-users-boun...@lists.openscenegraph.org] Im Auftrag von Robert Osfield
> Gesendet: Dienstag, 20. März 2012 09:48
> An: OpenSceneGraph Users
> Betreff: Re: [osg-users] osgShadow and multitexture
>
> Hi Daniel,
>
> On 20 March 2012 08:26, Daniel Schmid 
> wrote:
> > I have a hard time understanding that the osgShadow implementations
> > should support multitexturing when they never mix the colors oft he
> > different texture units. Ok, I'm not yet that settled in glsl maybe
> > there is some magic working behind, which I do not understand.
> >
> > I'm having a closer look right now into StandardShadowMap. There is
> > only the base texture rendered (which I can define by setter method),
> > plus the shadow texture. The other textures are ignored. When I want
> > to use multiple texture layers, I ALWAYS have to write my own shaders.
> Is this correct ?
>
> Since the fixed function pipeline can't do shadows natively you have to
> write your own shaders.
>
> I have plans to get shader composition for the OSG which would be able to
> replace the fixed function pipeline with shaders, but it'll be a while
> before I get the time to return to tackling this particular task.  Once we
> have shader composition should be easier to support dropping provided more
> flexible shadow support, but shader composition is far from trivial, very
> much at the cutting edge of scene graphs.
>
> Until then you'll need to write your own shaders, but this is pretty
> standard practice these days, often developers will do everything with
> shaders.
>
> 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] Camera attached to object

2012-03-20 Thread Sergey Bocharov
Hi, Sergey

Я уже голову сломал с этими матрицами.

;-)

Cheers,
Sergey

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





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


Re: [osg-users] osgShadow and multitexture

2012-03-20 Thread Daniel Schmid
There is a remaining question. In StandardShadowMap.cpp Lines 632 - 639 (osg 
3.0.1) I find lines setting the texture mode for stage 1-4. Why is there a 
limitation to these 4 stages, and what are they doing? If my model uses 4 
textures and the shadow should go on layer 5, could this be a problem?


-Ursprüngliche Nachricht-
Von: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] Im Auftrag von Robert 
Osfield
Gesendet: Dienstag, 20. März 2012 09:48
An: OpenSceneGraph Users
Betreff: Re: [osg-users] osgShadow and multitexture

Hi Daniel,

On 20 March 2012 08:26, Daniel Schmid  wrote:
> I have a hard time understanding that the osgShadow implementations 
> should support multitexturing when they never mix the colors oft he 
> different texture units. Ok, I'm not yet that settled in glsl maybe 
> there is some magic working behind, which I do not understand.
>
> I'm having a closer look right now into StandardShadowMap. There is 
> only the base texture rendered (which I can define by setter method), 
> plus the shadow texture. The other textures are ignored. When I want 
> to use multiple texture layers, I ALWAYS have to write my own shaders. Is 
> this correct ?

Since the fixed function pipeline can't do shadows natively you have to write 
your own shaders.

I have plans to get shader composition for the OSG which would be able to 
replace the fixed function pipeline with shaders, but it'll be a while before I 
get the time to return to tackling this particular task.  Once we have shader 
composition should be easier to support dropping provided more flexible shadow 
support, but shader composition is far from trivial, very much at the cutting 
edge of scene graphs.

Until then you'll need to write your own shaders, but this is pretty standard 
practice these days, often developers will do everything with shaders.

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] Camera attached to object

2012-03-20 Thread Sergey Kurdakov
Hi Sergey,

>Anyone knows how to do this?

just a suggestion
you may take a look at osg code ( nodetrackermanipulator),
and adjust it to your needs as you would get desired camera out of existing
codebase for camera matrix manipulation.

Regards
Sergey

On Tue, Mar 20, 2012 at 11:50 AM, Sergey Bocharov  wrote:

> Anyone knows how to do this?
>
> Thank you!
>
> Cheers,
> Sergey
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=46424#46424
>
>
>
>
>
> ___
> 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] osgShadow and multitexture

2012-03-20 Thread Robert Osfield
Hi Daniel,

On 20 March 2012 08:26, Daniel Schmid  wrote:
> I have a hard time understanding that the osgShadow implementations should
> support multitexturing when they never mix the colors oft he different
> texture units… Ok, I’m not yet that settled in glsl maybe there is some
> magic working behind, which I do not understand.
>
> I’m having a closer look right now into StandardShadowMap. There is only the
> base texture rendered (which I can define by setter method), plus the shadow
> texture. The other textures are ignored. When I want to use multiple texture
> layers, I ALWAYS have to write my own shaders. Is this correct ?

Since the fixed function pipeline can't do shadows natively you have
to write your own shaders.

I have plans to get shader composition for the OSG which would be able
to replace the fixed function pipeline with shaders, but it'll be a
while before I get the time to return to tackling this particular
task.  Once we have shader composition should be easier to support
dropping provided more flexible shadow support, but shader composition
is far from trivial, very much at the cutting edge of scene graphs.

Until then you'll need to write your own shaders, but this is pretty
standard practice these days, often developers will do everything with
shaders.

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


Re: [osg-users] osgShadow and multitexture

2012-03-20 Thread Sebastian Messerschmidt

Am 20.03.2012 09:26, schrieb Daniel Schmid:


I have a hard time understanding that the osgShadow implementations 
should support multitexturing when they never mix the colors oft he 
different texture units... Ok, I'm not yet that settled in glsl maybe 
there is some magic working behind, which I do not understand.


I'm having a closer look right now into StandardShadowMap. There is 
only the base texture rendered (which I can define by setter method), 
plus the shadow texture. The other textures are ignored. When I want 
to use multiple texture layers, I ALWAYS have to write my own shaders. 
Is this correct ?


This is correct, also the current implementation doesn't support fog, as 
you requested in your first posting.


*Von:*osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] *Im Auftrag von 
*Sebastian Messerschmidt

*Gesendet:* Dienstag, 20. März 2012 08:18
*An:* OpenSceneGraph Users
*Betreff:* Re: [osg-users] osgShadow and multitexture

Hi Daneil,

All the shadow mapping techniques AFAIR "support" multitexturing.
You will have to provide you custom vertex and fragment shader 
however. Also you should set the texture unit/texture coordinates for 
the shadow to texture-count + 1.
Just look into the sources, there are the vertex/fragment shaders 
you'll need to modify.
I can agree that there currently is no homogeneous way to setup 
shaders for all the techniques, but it can be done.


For the vertex shader, you will have to assign something the eye-space 
coordinates to the texture unit.

For shadow mapping it more or less boils down to:

gl_MultiTexCoord[n].s = dot(gl_EyePlaneS[n] * gl_Vertex);
gl_MultiTexCoord[n].t = dot(gl_EyePlaneT[n] * gl_Vertex);
gl_MultiTexCoord[n].p = dot(gl_EyePlaneP[n] * gl_Vertex);
gl_MultiTexCoord[n].q = dot(gl_EyePlaneQ[n] * gl_Vertex);

The fragment shader you can get from the sources.

cheers
Sebastian

Hi Robert

Thanks for your answer. I was hoping all osgShadow techniques support 
multi-texturing... but in my application, i tried every single one, 
and I only have strange effects. What happens basically is the 
following: I can manage to have a shadow with standardshadowmap, and 
all the view based techniques, by selecting the base texture unit as 0 
and the shadow texture unit between 1 and 4. What happens then is that 
the according texture level of my model is replaced with my shadow 
texture and the texture coordinates of this level get mixed up, like i 
have other textures moving when rotating my viewport. So I thought, 
probably these levels are already occupied by my scene model, so I 
have to use a value above 4, but then I have no more shadow displayed 
at all.


I'm sure I'm missing somehow an important point about the way base 
texture and shadow texture units must have been supposed to use. But 
after some days of try and error, I cannot figure how I can have osg 
create a shadow without removing my textures or messing with a 
textures layer coordinate...


I'm really stuck... help appreciated. There are not really any 
tutorials out there explaining the use of osgShadow...


Regards

Daniel




___
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] osgShadow and multitexture

2012-03-20 Thread Daniel Schmid
I have a hard time understanding that the osgShadow implementations should 
support multitexturing when they never mix the colors oft he different texture 
units... Ok, I'm not yet that settled in glsl maybe there is some magic working 
behind, which I do not understand.
I'm having a closer look right now into StandardShadowMap. There is only the 
base texture rendered (which I can define by setter method), plus the shadow 
texture. The other textures are ignored. When I want to use multiple texture 
layers, I ALWAYS have to write my own shaders. Is this correct ?

Von: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] Im Auftrag von Sebastian 
Messerschmidt
Gesendet: Dienstag, 20. März 2012 08:18
An: OpenSceneGraph Users
Betreff: Re: [osg-users] osgShadow and multitexture

Hi Daneil,

All the shadow mapping techniques AFAIR "support" multitexturing.
You will have to provide you custom vertex and fragment shader however. Also 
you should set the texture unit/texture coordinates for the shadow to 
texture-count + 1.
Just look into the sources, there are the vertex/fragment shaders you'll need 
to modify.
I can agree that there currently is no homogeneous way to setup shaders for all 
the techniques, but it can be done.

For the vertex shader, you will have to assign something the eye-space 
coordinates to the texture unit.
For shadow mapping it more or less boils down to:

gl_MultiTexCoord[n].s = dot(gl_EyePlaneS[n] * gl_Vertex);
gl_MultiTexCoord[n].t = dot(gl_EyePlaneT[n] * gl_Vertex);
gl_MultiTexCoord[n].p = dot(gl_EyePlaneP[n] * gl_Vertex);
gl_MultiTexCoord[n].q = dot(gl_EyePlaneQ[n] * gl_Vertex);

The fragment shader you can get from the sources.

cheers
Sebastian

Hi Robert

Thanks for your answer. I was hoping all osgShadow techniques support 
multi-texturing... but in my application, i tried every single one, and I only 
have strange effects. What happens basically is the following: I can manage to 
have a shadow with standardshadowmap, and all the view based techniques, by 
selecting the base texture unit as 0 and the shadow texture unit between 1 and 
4. What happens then is that the according texture level of my model is 
replaced with my shadow texture and the texture coordinates of this level get 
mixed up, like i have other textures moving when rotating my viewport. So I 
thought, probably these levels are already occupied by my scene model, so I 
have to use a value above 4, but then I have no more shadow displayed at all.

I'm sure I'm missing somehow an important point about the way base texture and 
shadow texture units must have been supposed to use. But after some days of try 
and error, I cannot figure how I can have osg create a shadow without removing 
my textures or messing with a textures layer coordinate...

I'm really stuck... help appreciated. There are not really any tutorials out 
there explaining the use of osgShadow...

Regards
Daniel





___

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] Camera attached to object

2012-03-20 Thread Sergey Bocharov
Anyone knows how to do this?

Thank you!

Cheers,
Sergey

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





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


Re: [osg-users] osgShadow and multitexture

2012-03-20 Thread Sebastian Messerschmidt

Hi Daneil,

All the shadow mapping techniques AFAIR "support" multitexturing.
You will have to provide you custom vertex and fragment shader however. 
Also you should set the texture unit/texture coordinates for the shadow 
to texture-count + 1.
Just look into the sources, there are the vertex/fragment shaders you'll 
need to modify.
I can agree that there currently is no homogeneous way to setup shaders 
for all the techniques, but it can be done.


For the vertex shader, you will have to assign something the eye-space 
coordinates to the texture unit.

For shadow mapping it more or less boils down to:

gl_MultiTexCoord[n].s = dot(gl_EyePlaneS[n] * gl_Vertex);
gl_MultiTexCoord[n].t = dot(gl_EyePlaneT[n] * gl_Vertex);
gl_MultiTexCoord[n].p = dot(gl_EyePlaneP[n] * gl_Vertex);
gl_MultiTexCoord[n].q = dot(gl_EyePlaneQ[n] * gl_Vertex);

The fragment shader you can get from the sources.

cheers
Sebastian

Hi Robert

Thanks for your answer. I was hoping all osgShadow techniques support 
multi-texturing... but in my application, i tried every single one, 
and I only have strange effects. What happens basically is the 
following: I can manage to have a shadow with standardshadowmap, and 
all the view based techniques, by selecting the base texture unit as 0 
and the shadow texture unit between 1 and 4. What happens then is that 
the according texture level of my model is replaced with my shadow 
texture and the texture coordinates of this level get mixed up, like i 
have other textures moving when rotating my viewport. So I thought, 
probably these levels are already occupied by my scene model, so I 
have to use a value above 4, but then I have no more shadow displayed 
at all.


I'm sure I'm missing somehow an important point about the way base 
texture and shadow texture units must have been supposed to use. But 
after some days of try and error, I cannot figure how I can have osg 
create a shadow without removing my textures or messing with a 
textures layer coordinate...


I'm really stuck... help appreciated. There are not really any 
tutorials out there explaining the use of osgShadow...


Regards
Daniel



___
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