OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Stuck with applying an offset to projection matrix


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
wernerM
Appreciator


Joined: 06 Feb 2013
Posts: 101

PostPosted: Mon Jun 25, 2018 10:11 am    Post subject:
Stuck with applying an offset to projection matrix
Reply with quote

Hi all,

I'm experimenting with slave cameras for a while now and now I'm totally stuck.
I'm doing a tiled display of a scene and for the main scene graph it works fine with projection offset matrix on the slave cameras
and all cameras having a RELATIVE reference frame.
But my scene also has cameras with ABSOLUTE reference frame (i.e. a background image).
The background is - of course - fully mapped on each tile.

In order to solve this I modified my vertex shader like that:

    gl_Position = osg_ModelViewProjectionMatrix * projectionOffsetMatrix * osg_Vertex; and I populate the projection offset matrix via uniform (same as slave offset matrix). Unfortunately without the expected success.

For creation of osg_ModelViewPrtojectionMatrix I found this code:

    osg::Matrixd modelViewProjectionMatrix = modelMatrix * viewMatrix * _camera->getProjectionMatrix();
    uniform->set(modelViewProjectionMatrix);

And in the updateSlaveImplementatiuon I see:

    _camera->setProjectionMatrix(view.getCamera()->getProjectionMatrix() * _projectionOffset);

So where is my mistake? It should be obvious but it seems I'm blind here.

Many thanks

- Werner -

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12093

PostPosted: Mon Jun 25, 2018 11:39 am    Post subject:
Stuck with applying an offset to projection matrix
Reply with quote

HI Werner,

It sounds like you are trying to resolve a problem at the low level
which you have created by setting things up incorrectly and the top
level.

So.. what you need to do is change how you are configuring things at
the top level. You don't clearly explain what task you are trying to
solve and what the main elements are in your scene graph. It kinda
sounds like a power wall configuration with a single background image
that you want to have applied.

Once you explain more clearly what you are trying to achieve - display
configuration, hardware configuration, what it's in the scene graph
that you want to appear, then we an have a bash at recommend how to
configuration the viewer and what you are doing within the scene
graph.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
wernerM
Appreciator


Joined: 06 Feb 2013
Posts: 101

PostPosted: Mon Jun 25, 2018 11:53 am    Post subject:
Stuck with applying an offset to projection matrix
Reply with quote

Hi Robert,

thanks for the quick reply.
What I actually need is a very high resolution screenshot from a
standard scene with
some objects displayed like bacxkground, HUD etc.
You are right in viewing at it like a powerwall with those objects being
spread over all screens.

I can easily get the correct result by temporary multiplying the
projection matices of the main
and all ABSOLUTE cameras with an offset matrix (like slave camera).
Doing a .frame(), reading the screenshot
and then doing the next tile.
As a result the screen flickers during this procedure.
My idea was using a slave camera bound to a pixelbuffer, applying an
offset matrix to that camera and at the
same time setting this offset matrix to a uniform with OVERRIDE. All
vertex shaders of ABSOLUTE cameras can
use this uniform to translate vertex positions.
So only the render pass of the slave camera will have those offsets.
Or do you know any better method for, let's say, rendering a screen quad
over many tiles?
I think my problem is the wrong usage of the offset matrix in the vertex
shader.

- Werner -

Am 25.06.2018 um 13:38 schrieb Robert Osfield:
Quote:
HI Werner,

It sounds like you are trying to resolve a problem at the low level
which you have created by setting things up incorrectly and the top
level.

So.. what you need to do is change how you are configuring things at
the top level. You don't clearly explain what task you are trying to
solve and what the main elements are in your scene graph. It kinda
sounds like a power wall configuration with a single background image
that you want to have applied.

Once you explain more clearly what you are trying to achieve - display
configuration, hardware configuration, what it's in the scene graph
that you want to appear, then we an have a bash at recommend how to
configuration the viewer and what you are doing within the scene
graph.

Robert.






------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12093

PostPosted: Mon Jun 25, 2018 1:00 pm    Post subject:
Stuck with applying an offset to projection matrix
Reply with quote

Hi Werner,

What are you using the ABSOLUTE_RF Camera's for? My guess this is the
source of the problems, perhaps the approach you've take with this
works fine for a single viewport but breaks any form of
multi-viewport/window composition of the view.

Could you explain what the ABSOLUTE_RF Cameras are for?

Robert


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
wernerM
Appreciator


Joined: 06 Feb 2013
Posts: 101

PostPosted: Mon Jun 25, 2018 3:33 pm    Post subject:
Stuck with applying an offset to projection matrix
Reply with quote

Hi Robert,

from your question I guess, I have a fundamental misunderstanding.
But from all the examples and from the OGS book I learned as follows:

If I want to show a hud I have to do it with a hud camera which has reference frame ABSOLUTE_RF.
The same if I want to have a wallpaper in the background. I have to create a textured screen quad and show it with camera with ABSOLUTE_RF.
ABSOLUTE_RF seems to be necessary if the object should not be manipulated by the camera manipulator. Right?

I will be glad to learn if there is some other and more recommended way to do it.

Many thanks for your never ending patience.

- Werner -

Am 25.06.2018 um 14:59 schrieb Robert Osfield:

Quote:
Quote:
Hi Werner,

What are you using the ABSOLUTE_RF Camera's for? My guess this is the
source of the problems, perhaps the approach you've take with this
works fine for a single viewport but breaks any form of
multi-viewport/window composition of the view.

Could you explain what the ABSOLUTE_RF Cameras are for?

Robert
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen
Phone: +49 241 475757-0
Fax: +49 241 475757-29
Web: http://texion.eu
eMail: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12093

PostPosted: Mon Jun 25, 2018 3:49 pm    Post subject:
Stuck with applying an offset to projection matrix
Reply with quote

Hi Werner,

Using a ABSOLUTE_RF for a backgrouind image is a simply way of
implementing this type of feature but has it's limitations - it means
it won't work with anything other than a single window.

If you plan to have a view that can be composed of multiple
viewport/windows then the ABSOLUTE_RF technique is no longer
appropriate.

So the question now is how you should implement the background image.
One technique would be to place the geometry under a RELATIVE_RF
transform rather than a ABSOLUTE_RF Camera that resets the projection
and view matrices.

Robert.
On Mon, 25 Jun 2018 at 16:33, Werner Modenbach
<> wrote:
Quote:

Hi Robert,

from your question I guess, I have a fundamental misunderstanding.
But from all the examples and from the OGS book I learned as follows:

If I want to show a hud I have to do it with a hud camera which has reference frame ABSOLUTE_RF.
The same if I want to have a wallpaper in the background. I have to create a textured screen quad and show it with camera with ABSOLUTE_RF.
ABSOLUTE_RF seems to be necessary if the object should not be manipulated by the camera manipulator. Right?

I will be glad to learn if there is some other and more recommended way to do it.

Many thanks for your never ending patience.

- Werner -

Am 25.06.2018 um 14:59 schrieb Robert Osfield:

Hi Werner,

What are you using the ABSOLUTE_RF Camera's for? My guess this is the
source of the problems, perhaps the approach you've take with this
works fine for a single viewport but breaks any form of
multi-viewport/window composition of the view.

Could you explain what the ABSOLUTE_RF Cameras are for?

Robert



--
TEXION Software Solutions, Rotter Bruch 26a, D-52068 Aachen
Phone: +49 241 475757-0
Fax: +49 241 475757-29
Web: http://texion.eu
eMail:



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Model matrix kullboys General 0 Tue Aug 21, 2018 7:10 am View latest post
No new posts My questions are stuck on [Topic is a... Waaayoff General [forum] 1 Fri Jul 27, 2018 12:12 pm View latest post
No new posts ReaderWriterCFG - offset for single c... Marcin Prus Submission 0 Fri Jul 06, 2018 11:27 am View latest post
No new posts Positioning an object based on the Vi... Takarashy General 0 Wed May 23, 2018 3:14 pm View latest post
No new posts EXTERNAL: Re: Getting the combined ma... Rowley, Marlin R General 0 Tue May 08, 2018 3:25 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP