Hi,

I've writte a test programm for the display calibration and I think it works fine. With the grid you can define a maping from the original window to your distorted projection. The values are stored in a regular grid that is used for projecting triangles. In your example if you change the center point in the top row, then only those triangles are distored the contan the changed point. The left equare on the top right side is drawn with two triangles. Only the top triangle references the top center point. I think this can describe what you see. You can avoid this effect by increasing grid resolution
and apply a smooth distortion.

Marcus

Enrico Borrione wrote:

Hi marcus,
i tried your xml code and it loaded just fine.
Now i can scale gamma values just working on the
xml values. My problem starts when i try try to use the grid thing.
For what i could understand reading the OSG code,
the grid is passed to the servers as a texture coordinate 4 the GrabBackground textures.so i assume that having this XML the mapping is:

<grid>
<row><point>0.0 0.0</point><point>0.5 0.0</point><point> 1.0 0.0</point></row>
<row><point>0.0   0.5</point><point>0.5 0.5</point><point>1.0
0.5</point></row>
<row><point>0.0 1.0</point><point>0.5 1.0</point><point>1.0
1.0</point></row>
</grid>

1,0      1,0.5      1,1
*--------*---------*
|        |         |
|        |         |
|        |         |
*--------*---------*
|        |         |
|        |         |
|        |         |
*--------*---------*
0,0      0,0.5      0,1

or at least i hope so. Now, if i alter one of the values like:
(the 0.3 in the lower middle value)

<grid>
<row><point>0.0 0.0</point><point>0.5 0.3</point><point> 1.0 0.0</point></row>
<row><point>0.0   0.5</point><point>0.5 0.5</point><point>1.0
0.5</point></row>
<row><point>0.0 1.0</point><point>0.5 1.0</point><point>1.0
1.0</point></row>
</grid>

i'd expect:

*\               / *
|   \         /    |
|      \ * /       |
|        |         |
*--------*---------*
|        |         |
|        |         |
|        |         |
*--------*---------*

where the middle point is lowered by 0.3 texture units in the vertical
axis and is in the same texture unit in the horizontal.

instead i get the full quad a weirdly distorted.
If i change the coordinate to -0.3 (i know it's absurd) i get something
like:

*\                 /*
|    \            / |
|       \ *-----*/  |
|         |         |
*---------*---------*
|         |         |
|         |         |
|         |         |
*---------*---------*

so the texture coordinate appear duplicated and translated.
I looked in the OSGDisplayCalibration.cpp file, and tried both absolute and relative tex coords, but they work just like the same... Is it a bug or there is still something
that i can't understand?

I know that my ascii art isn't really good... so
if u can't understand, i'll manage to put some screenshots
online to give you a better view of the situation.

Thanks a lot,
enrico



Il ven, 2005-05-20 alle 12:24, Marcus Roth ha scritto:
Hi,

try to use the following calibration file. You should see some distortions and the colors red and blue should be swapped.
Change m1 with your cluster server name.

<?xml version="1.0"?>
<displaycalibration>
<server name="m1">
<colormatrix>
0 1 0 0
1 0 0 0
0 0 1 0
0 0 0 1
</colormatrix>
<gamma>
1
</gamma>
<gammaramp>
<color> 0  0  0</color>
<color> 1  1  1</color>
</gammaramp>
<grid>
<row><point>0   0</point><point>200   0</point><point>399 0</point></row>
<row><point>0 150</point><point>200 150</point><point>399 150</point></row>
<row><point>0 299</point><point>200 299</point><point>399 299</point></row>
</grid>
</server>
</displaycalibration>


Marcus

Enrico Borrione wrote:

Hi marcus,
i tryied to make some experiment with the display calibration,
as you suggested, but i can't get on top of it.
Using the source files and some examples i've found,
i tried to run a simple cluster, with one client and
two servers. To set up the calibration i use this xml file:

<?xml version="1.0"?>
<displaycalibration>
<server name="test1">
  <gamma> 0.5f </gamma>
</server>
<server name="test2">
</server>
</displaycalibration>

as you can see i try just to alter the gamma correction
of one of the servers, while the other remains unchanged.
I load this via:

std::filebuf fb;
  fb.open ("test_due.xml",std::ios::in);
  std::istream os(&fb);
mwin->loadCalibration(os); //DisplayCalibrationPtr calibPtr = DisplayCalibration::create(); // mwin->getCalibration()[0]->calibrate(mwin,(RenderAction*)mgr->getAction());
  std::cout << "GAMMA1 " << mwin->getCalibration()[0]->getGamma() <<
std::endl;
  fb.close();
and for what i can see the xml is correctly parsed. (the Gamma corresponds). The problem is that the corrisponding server window remains all black,
no matter what parameter i pass in it. Why? What's wrong?
I tried also a more direct approach with:

mwin->getCalibration()[0]->calibrate(mwin,(RenderAction*)mgr->getAction());

but it just segmentation faults (i admit i haven't experimented much this second way).

Any suggestion? thanks Enrico

Il ven, 2005-05-13 alle 14:49, Marcus Roth ha scritto:


Hi,

it ist possible to render the contents of a cluster server into a texture and the do color correction and geometrical correction to this texture. This is done by the DisplayCalibration class.

A clusterwindow has a multi field clusterCalibration. This field
can hold references to a DisplayCalibration object. A display calibration can hold a grid that
can be used to do distortion.

Marcus

Enrico Borrione wrote:

Hi Dirk,
i am still struggling after the second viewpor problem.
As you may remember my final goal is to make it run on
my cluster, to simulate the geometric distortion of a cilindrical screen and the ovaerlapping between the projections.

In order to achieve this objective, i was thinking about adding the second viewport trick to my cluster servers, so half of the application works as a slave of the client (rendering its part of the scene), and half of the app uses the obtained buffer to texture the target mesh and
obtaining my desired effect.
I did a little experiment of mixing two programs (the
render to texture and cluster server) but i can't get but a crash after another. In a few words I create
a second viewport, add a TextureGrabBackground and
add all this to the main window of the server:

winid = glutCreateWindow(name);

window     = GLUTWindow::create();
 window->setId(winid);
 window->init();
.
.
.

server     = new ClusterServer(window,name,connectionType,"");
 // start the server
 server->start();
.
.
.

ViewportPtr vp2 = Viewport::create();
beginEditCP(vp2);
 vp2->setCamera(cam);
 vp2->setRoot(tr);
 vp2->setBackground(tg);
vp2->setLeft(0);
 vp2->setRight(1);
 vp2->setBottom(0);
 vp2->setTop(1);
endEditCP(vp2);
beginEditCP(window);
 window->addPort(vp2);
endEditCP(window);


I noticed that the program crashes as soon as i add the second
viewport to the window. Probably i am misunderstanding something crucial in the rendering pipeline of OSG :)
Does anyone has some clue to offer?

Many thanks,
enrico

Il lun, 2005-05-09 alle 21:59, Dirk Reiners ha scritto:


        Hi Enrico,

On Fri, 2005-05-06 at 10:54 +0200, Enrico Borrione wrote:
Hi dirk,
after playing with the example you pointed me for a bit,
i understood the basic principles...
Now I am trying to change the textured quad in the second viewport with a simple geometry (as you suggested). So... I modelled a half tube with blender, exported it in wrml along with the texture coordinates
and tried to use it as the *screen* of the application.
Surprise surprise, it isn't working, i just see the solid background. My best guess is that the matrixcameraptr
is pointing in the wrong direction, so i pointlessy looked for a
way to move the camera.
I used to query the simple scene manager for the navigator
and then update the projection matrix all by myself, but
in this case i think the navigator is linked to the first vieport...
Yup.

So: how can i update the camera position of the second vp?
and the target of the look at?  :)
The easiest would probably be to create your own Camera and use that in
the second viewport, which should work just fine.

        Dirk
--
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users


--
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users



--
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users



--
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users





-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users




-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to