Hi Thomas

Nice to hear, that you get it worked. If there were some special steps you had 
to make to install osgPPU, then let me know, maybe I put them to the website 
and to the README file.

OK, now to your questions:


carnibirdy wrote:
> 
> I made a pipeline composed of three shaders.
> ...
> I get a black screen, so I guess it did not work at all.
> 

In such cases it is very helpful if you either post an example source code, or 
writes your pipeline to an .ppu file. A pipeline can be written to a file with: 
osgDB::writeObjectFile(*mProcessor, "pipeline.ppu");
Of course the ppu plugin has to be first installed correctly (just copy the 
compiled plugin into osg plugin directory). 

This way, somebody else can load the pipeline and check for errors. An example 
application would be much greater, because one can directly see how you setup 
the pipeline in the code.


> 
> Am I doing something wrong this far?
> 

Where do you put the ppu's processor in your scene graph? 


> 
> Another thing which may be the problem source:
> I don't understand the viewport & camera thing.
> In the examples I see that sort of thing:
> 
> osg::Viewport* vp = camera->getViewport();
> camera->setViewport(vp);
> 
> So it's equal to camera->setViewport(camera->getViewport) and seems strange.
> 

I can not find an example, with this two lines. In most cases, there is a setup 
function, which set up the camera in a way required for the this particular 
example. However, you are right, it might happen, that the same viewport is 
applied to the camera back. So this is not really required.


> 
> ppuout->setInputTextureIndexForViewportReference(-1);
> 
> It says "Set index of an input texture which size is used as reference for 
> the viewport size" and that -1 is for camera.
> 


Every unit can have its own output size. Setting sthe index for viewport 
reference allows you to specify the size of which input texture is used as a 
size reference. For example you have two inputs into your unit: one with 
512x512 and another with 1024x1024. You also have your main camera, input from 
scene into the processor, which has 256x256 as viewport size. When a unit is 
created it should allocate a texture with specified size as output. So now with 
the given parameter, you can either choose 512x512, by specifiing index 0, or 
for example 256x256 whch is the size of the main camera of the processor, by 
specifing -1.

I hope, it helps.

art

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





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

Reply via email to