[osg-users] [osgPPU] why would The Hdr Effects disappeared from hdrExample after scene adding to the ive format model?

2019-10-29 Thread Mirro Xu
Hi,

What are the requirements for this model format for this effect or
can't be displayed because the parameter settings are incorrect?


Thank you!

Cheers,
Mirro

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





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


[osg-users] osgPPU or osgFX:EffectCompositor for my purposes

2013-10-10 Thread Ethan Fahy
Hello all,

Yes I've posted tangential posts in the past but I'm returning to this work 
after a hiatus and would like to make sure I'm using the correct 
library/technologies as I dive back in.

I'm looking to use an osg-compatible post-processing library that is capable of 
the following:

input: 32-bit float framebufferobject
processing step 1: get global min, max, mean, histogram required for step 2
processing step 2: histogram equalization converts to 8-bit unsigned int
processing step 3: add motion blur
processing step 4: add fixed and/or random noise
output: screen-sized quad of the results

I had a basic setup working last year using osgCuda, but I would like to try to 
move away from cuda/opencl and towards a shader approach for increased 
portability.  As I see it this means using either osgPPU or 
osgFX::EffectCompositor, which is part of Wang Rui's osgRecipes.  I know that 
these two libraries do similar things, but since neither is part of the 
officially maintained 1st-party OSG distribution I'm trying to figure out which 
is likely to see the most support going forward, and which might be best suited 
for the processing steps I've listed.  In particular I worry about the min, 
max, mean, and histogram calculations and whether these can be done more easily 
using computer shaders than in the past when more complicated parallel 
reduction algorithms were required.

Any comments on this?  Thanks,

-Ethan

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





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


Re: [osg-users] [osgPPU] How to use osgPPU in an environment withz several slave cameras?

2013-03-31 Thread Werner Modenbach
Here is how I prepare the camera(s) for PPU:

/** Setup the camera to do the render to texture */
void Cl_3Dview_osg::setupCameraForPipeline() {
// setup viewer's default camera
osg::Camera* camera = view->getCamera();
osg::Viewport* vp = camera->getViewport();

// create texture to render to
osg::Texture* texture = createRenderTexture(
 (int)vp->width(), 
(int)vp->height(), false);
osg::Texture* depthTexture = createRenderTexture(
 (int)vp->width(), 
(int)vp->height(), true);

// tell the camera to use OpenGL frame buffer object where supported.
camera->setRenderTargetImplementation(
 osg::Camera::FRAME_BUFFER_OBJECT);
// attach the texture and use it as the color buffer.
camera->attach(osg::Camera::COLOR_BUFFER, texture);
camera->attach(osg::Camera::DEPTH_BUFFER, depthTexture);
//if (wallpaperCamera.valid()) {
//wallpaperCamera->setRenderTargetImplementation(
//   osg::Camera::FRAME_BUFFER);
//wallpaperCamera->attach(
//   osg::Camera::COLOR_BUFFER, 
texture);
//}
}

Commenting in our out of the last part does not do any difference. But why?

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





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


Re: [osg-users] [osgPPU] osgPPU and wireframe

2013-03-29 Thread Art Tevs

danoo wrote:
> Problem solved, my last posted solution is working. It was a compile 
> problem...


Hey Daniel.

Please consider to create a pull request on osgPPuU github repository. This way 
the whole community will benefit from your patch ;)

art

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





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


Re: [osg-users] [osgPPU] How to use osgPPU in an environment withz several slave cameras?

2013-03-27 Thread Werner Modenbach
Hi Daniel,

the text HUD shows up correctly.
Only the wallpaper is missing. I create it by a separate camera in 
PRE-RENDERmode. Here ist the code snippplet:

===

/** This method creates a HUD-Window for a wallpaper */
void Cl_3Dview_osg::createWallpaper(const QString &_path) {
osgViewer::Viewer::Windows windows;
view->getWindows(windows);
if (windows.empty()) return;

// ===
// Create camera
// ===
// create a camera to set up the projection and model view matrices, 
   // and the subgraph to drawn in the HUD
osg::Camera* camera = new osg::Camera;

// set the projection matrix
camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1,0,1));
camera->setProjectionResizePolicy(osg::Camera::FIXED);

// set the view matrix
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera->setViewMatrix(osg::Matrix::identity());

// only clear the depth buffer
camera->setClearMask(GL_COLOR_BUFFER_BIT | 
   GL_DEPTH_BUFFER_BIT);

// draw subgraph before main camera view.
camera->setRenderOrder(osg::Camera::PRE_RENDER);

// we don't want the camera to grab event focus from 
// the viewers main camera(s).
camera->setAllowEventFocus(false);

// set up cameras to rendering on the first window available.
camera->setGraphicsContext(windows[0]);
camera->setViewport(0,0,windows[0]->getTraits()->width, 
windows[0]->getTraits()->height);

view->addSlave(camera, false);

wallpaperCamera = camera;
if (!_path.isEmpty())
setWallpaper(_path);
// The main camera should not wipe out the wallpaper
view->getCamera()->setClearMask(GL_DEPTH_BUFFER_BIT);
}
===

Is there any better method to do this job, maybe by a separate node in a low 
numbered render bin? But what about the transformations then and the resize 
handling of the viewport?


Thank you!

Cheers,
Werner

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





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


Re: [osg-users] [osgPPU] How to use osgPPU in an environment withz several slave cameras?

2013-03-26 Thread Daniel Schmid
Hi wernerM

Could you please provide some example code of how you are doing things? I have 
a prerender camera rendering part of the scene which is applied in a ppu unit 
over the main scene.

Are both background and hud text missing?

For hud text please have a look all the statistic and help handler, they show 
very vell how do to huds...


Thank you!

Cheers,
Daniel

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





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


Re: [osg-users] [osgPPU] osgPPU and wireframe

2013-03-25 Thread Daniel Schmid
Problem solved, my last posted solution is working. It was a compile problem...

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





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


Re: [osg-users] [osgPPU] osgPPU and wireframe

2013-03-25 Thread Daniel Schmid
In the method Procesor::init(), it added the following code:


Code:
osg::PolygonMode* l_Polymode = new osg::PolygonMode( 
osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL );
mStateSet->setAttributeAndModes(l_Polymode, osg::StateAttribute::ON | 
osg::StateAttribute::OVERRIDE);




This doesn't change anything when 'w' is pressed...

I don't know if this is a osgPPU issue?

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





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


Re: [osg-users] [osgPPU] osgPPU and wireframe

2013-03-22 Thread Farshid Lashkari
Hi Daniel,

You will need to apply an osg::PolygonMode attribute to the screenquad
stateset with the mode set to osg::PolygonMode::FILL. I haven't used
osgPPU, but I've used this when displaying fullscreen quads with rendered
textures and it worked fine.

Cheers,
Farshid


On Fri, Mar 22, 2013 at 7:51 AM, Daniel Schmid <
daniel.sch...@swiss-simtec.ch> wrote:

> Hi all
>
> Maybe you noticed that when using osgPPU and pressing 'w' to change the
> polygon mode to wireframe, the screen goes black, because only the
> screenquad is rendered in wireframe, but the actual scene is not rendered
> anymore.
>
> Does anybody know how to change this?
>
>
> Thank you!
>
> Cheers,
> Daniel
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=53207#53207
>
>
>
>
>
> ___
> 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] [osgPPU] osgPPU and wireframe

2013-03-22 Thread Daniel Schmid
Hi all

Maybe you noticed that when using osgPPU and pressing 'w' to change the polygon 
mode to wireframe, the screen goes black, because only the screenquad is 
rendered in wireframe, but the actual scene is not rendered anymore. 

Does anybody know how to change this?


Thank you!

Cheers,
Daniel

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





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


Re: [osg-users] [osgPPU] How to use osgPPU in an environment withz several slave cameras?

2013-03-19 Thread Werner Modenbach
Oh, I'm waiting so unpatiently for someone to reply here.
I need this working very urgently.

Thank you!

Cheers,
Werner

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





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


Re: [osg-users] [osgPPU] Rendering scene geometry in PPU

2013-03-04 Thread Sergey Polischuk
Hi

I believe it's easier to do with postrender camera - disable clear color, 
attach input texture as color attachment, set view and projection matrices, add 
your cones with shaders and you are done. You can also draw result into another 
texture with prerender camera and mix together inside osgppu, if postrender 
camera is not good for some reason.

Cheers.

04.03.2013, 19:19, "Daniel Schmid" :
> Hi all
>
> I have some light cones that simulate the glowing of a light. All the light 
> cones are in one group in the scene graph, and they have their apropriate 
> shader in the group stateset to get the desired effect.
>
> Now my goal is to render the cones in a osgppu postpro step. I want to have 
> them rendered over the normal scene. So my intention is to write a UnitInOut 
> class that can take a osg::Group node and render it over the existing input 
> texture.
>
> This is actually very close to the UnitText class, instead of a osg::Text I 
> have a small sub scene graph. One issue is the correct view and projection 
> matrixes, which must no longer be related to the screen quad, but instead 
> must be the same like the main scene.
>
> I hope you get the idea... I started to write the class, but I'm stuck with 
> applying the correct stateset and matrixes at the correct time.
>
> Can anybody help me?
>
> Thank you!
>
> Cheers,
> Daniel
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=52949#52949
>
> ___
> 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] [osgPPU] Rendering scene geometry in PPU

2013-03-04 Thread Daniel Schmid
Hi all

I have some light cones that simulate the glowing of a light. All the light 
cones are in one group in the scene graph, and they have their apropriate 
shader in the group stateset to get the desired effect. 

Now my goal is to render the cones in a osgppu postpro step. I want to have 
them rendered over the normal scene. So my intention is to write a UnitInOut 
class that can take a osg::Group node and render it over the existing input 
texture. 

This is actually very close to the UnitText class, instead of a osg::Text I 
have a small sub scene graph. One issue is the correct view and projection 
matrixes, which must no longer be related to the screen quad, but instead must 
be the same like the main scene.

I hope you get the idea... I started to write the class, but I'm stuck with 
applying the correct stateset and matrixes at the correct time.

Can anybody help me?

Thank you!

Cheers,
Daniel

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





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


Re: [osg-users] [osgPPU] osgPPU with GL3

2013-02-25 Thread Joshua No

hybr wrote:
> Hi
> 
> It is usable with fixed function pipeline available, this does not prevent 
> you from using gl 3.2+ in any way
> i mean why would you disable fixed finction on pc app if it is still useful 
> for a whole lot of stuff? (apart from mobile apps with gles)
> 
> 


Haha that sounds suspiciously like a "but why would you ever want to do that?" 
answer (i.e. "It only hurts when I laugh Dr", "Then don't laugh").  As it turns 
out we are locked into the core profile for a lot of reasons, technical reasons 
like complicated interactions with OpenCL, and management reasons "no 
deprecated code", faster conversion to mobile, etc.

Nevertheless even if I didn't have those requirements I would still take lack 
of core profile support as a sign that work may not continue on this project, 
and incorporating it into new code may be ill advised.

Although I do not yet have stereo support I've gone ahead and implemented glow 
with osg cameras and FBOs.  osgPPU was probably overkill for me anyway.

Thanks,
j

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





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


Re: [osg-users] [osgPPU] osgPPU with GL3

2013-02-25 Thread Sergey Polischuk
Hi

It is usable with fixed function pipeline available, this does not prevent you 
from using gl 3.2+ in any way
i mean why would you disable fixed finction on pc app if it is still useful for 
a whole lot of stuff? (apart from mobile apps with gles)
Wang Rui was working on alternative to osgPPU - effects compositor or 
something, i dont remember if it works without fixed function, but you can try 
it (https://github.com/xarray/osgRecipes)

Cheers.

25.02.2013, 06:21, "Joshua No" :
> Are you compiling it against an OpenGL 3.2 or higher OSG build?  I say 
> abandoned because there was no response to my original post for more then 8 
> months, and there appears to be no activity in the repository for quite some 
> time.
>
> Maybe I'm doing something wrong, but as far as I can tell osgPPU only works 
> for OpenGL < 3.2.
>
> I only need one feature anyway which is glow, so I'm working on implementing 
> that with RTT / MRT in OSG directly now. But it would be handy if osgPPU was 
> usable.
>
> Thanks
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=52853#52853
>
> ___
> 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] [osgPPU] osgPPU with GL3

2013-02-24 Thread Joshua No
Are you compiling it against an OpenGL 3.2 or higher OSG build?  I say 
abandoned because there was no response to my original post for more then 8 
months, and there appears to be no activity in the repository for quite some 
time.

Maybe I'm doing something wrong, but as far as I can tell osgPPU only works for 
OpenGL < 3.2.

I only need one feature anyway which is glow, so I'm working on implementing 
that with RTT / MRT in OSG directly now. But it would be handy if osgPPU was 
usable.

Thanks

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





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


Re: [osg-users] [osgPPU] osgPPU with GL3

2013-02-24 Thread Peterakos
Hello.

Not sure what you mean "abandoned, but it works for me.
I have run some of the osgPPU examples.

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


Re: [osg-users] [osgPPU] osgPPU with GL3

2013-02-24 Thread Joshua No
There's been no response to this for quite some time, so I'm guessing osgPPU is 
abandoned?  I've tried compiling it a number of different ways on a number of 
different platforms, but it doesn't look like it works any-longer with current 
OpenGL.  

Meanwhile any tips on OSG-only glow implementation? The main forum continually 
refers to osgPPU, but since that's not an option any longer how would one do 
this?  Multitexture plus Multipass?

Thanks

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





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


[osg-users] [osgPPU] How to use osgPPU in an environment withz several slave cameras?

2013-02-11 Thread Werner Modenbach
Hi,

in my application I use a camera to create a static background image in a 
PRERENDER stage.
Also afte the scene rendering I use another camera to display something on top 
of the scene in a POSTRENDER stage (HUD with text).
both cameras are slaves of the main camera.

I need seting up a PPU chain which has the complete output of all cameras as 
input.
So far I can only see the rendered scene without background and text on top.

Can anybody give me a hint how to arrange this? I couldn't find anything in the 
lists or via Gooogle.
Thanks for any help.

Thank you!

Cheers,
Werner

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





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


[osg-users] [osgPPU] Visual Studio compilation error

2013-01-07 Thread Ethan Fahy
Hello all,

I am attempting to build the trunk version of osgPPU against the trunk version 
of osg and cuda 5.0 using Visual Studio 2010 SP1 on Windows 7 x64.  I am trying 
to build in 32-bit mode and so I'm pointing to the 32-bit versions of the CUDA 
libraries that come with CUDA 5.0.  I also built osg in 32-bit mode.  I am also 
using CMake 2.8.9 .  

Before getting to the compilation errors, is there a known incompatibility 
between anything I just described?

CMake was having a hard time finding CUDA-related values automatically so I 
mostly set them manually as follows:

CUDA_DIR : C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0

CUDA_INCLUDE : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/include

CUDA_NVCC : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/bin/nvcc.exe

CUDA_NVCC_FLAGS : -ccbin "$(VCInstallDir)bin";-DWIN32

CUDA_SDK_DIR : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0

FOUND_CUDA : C:/Program Files/NVIDIA GPU Computing 
Toolkit/CUDA/v5.0/lib/Win32/cuda.lib

FOUND_CUDART : C:/Program Files/NVIDIA GPU Computing 
Toolkit/CUDA/v5.0/lib/Win32/cudart.lib

FOUND_CUDA_NVCC_INCLUDE : C:/Program Files/NVIDIA GPU Computing 
Toolkit/CUDA/v5.0/include

Does any of this seem incorrect?

Lastly, when I go to build this project in Visual Studio it builds everything 
successfully except for the cudakernel project which has more than 100 errors.  
I'll post some of them here (there are many more of the C2719 errors but I 
think you'll get the point):

Error   2   error C2371: 'size_t' : redefinition; different basic types 
c:\program files (x86)\microsoft visual studio 
10.0\vc\include\codeanalysis\sourceannotations.h 27
Error   3   error C4235: nonstandard extension used : '__unaligned' keyword 
not supported on this architecture  c:\Program Files (x86)\Microsoft Visual 
Studio 10.0\VC\INCLUDE\stdlib.h 342
Error   4   error C2719: 'val': formal parameter with 
__declspec(align('8')) won't be aligned   c:\program files\nvidia gpu 
computing toolkit\cuda\v5.0\include\surface_functions.h 2642
Error   5   error C2719: 'val': formal parameter with 
__declspec(align('8')) won't be aligned   c:\program files\nvidia gpu 
computing toolkit\cuda\v5.0\include\surface_functions.h 2647
Error   6   error C2719: 'val': formal parameter with 
__declspec(align('8')) won't be aligned   c:\program files\nvidia gpu 
computing toolkit\cuda\v5.0\include\surface_functions.h 2672
Error   7   error C2719: 'val': formal parameter with 
__declspec(align('8')) won't be aligned   c:\program files\nvidia gpu 
computing toolkit\cuda\v5.0\include\surface_functions.h 2677
Error   8   error C2719: 'val': formal parameter with 
__declspec(align('16')) won't be aligned  c:\program files\nvidia gpu 
computing toolkit\cuda\v5.0\include\surface_functions.h 2682
Error   9   error C2719: 'val': formal parameter with 
__declspec(align('16')) won't be aligned  c:\program files\nvidia gpu 
computing toolkit\cuda\v5.0\include\surface_functions.h 2687
Error   10  error C2719: 'val': formal parameter with 
__declspec(align('16')) won't be aligned  c:\program files\nvidia gpu 
computing toolkit\cuda\v5.0\include\surface_functions.h 2712
Error   11  error C2719: 'val': formal parameter with 
__declspec(align('16')) won't be aligned  c:\program files\nvidia gpu 
computing toolkit\cuda\v5.0\include\surface_functions.h 2717

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





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


[osg-users] [osgPPU] Objects not released

2012-12-18 Thread Daniel Schmid
Hi all

I'm trying to track down some memory leaks in my application which uses osgPPU. 

I noticed a difference between the following two methods of cascading units:

- When I cascade units through childUnit->setInputToUniform(parentUnit, ...), 
then the units seem to have a object reference that is not correctly unref'd, 
therefore unit is not released.
- When I cascade units through the parentUnit->addChild(childUnit) method, and 
add the texture uniforms in the ShaderAttribute, then everything works 
correctly.

I decided to use the second solution, although I find the first one nicer...
Anybody else observered memory leaks?

Thank you!

Cheers,
Daniel

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





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


Re: [osg-users] [osgPPU] multiple processors

2012-12-05 Thread Art Tevs
Hi,

Art is here, he was always here :)

My current research and work is non-osg related, hence I unfortunately somehow 
stalled in producing updated. 

Daniel, could you post the code as a patch to the osgPPU version you use? I 
would then implement this into the code.


Cheers,
Art

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





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


Re: [osg-users] [osgPPU] multiple processors

2012-12-05 Thread Daniel Schmid
I'm kind of talking to myself here... and since 2010 there is no sign of Art 
Tevs... anybody saw him lately?

Well, if anybody cares, I found out a solution to have multiple processors with 
compositeviewer, each view can have its different osgPPU pipeline, etc.

1. All you need to add is a group node to your scene, that holds all the 
processors. 
2. then you need to add this little snippet of code to Processor.cpp in the 
traverse method:


Code:

void Processor::traverse(osg::NodeVisitor& nv)
{
if (!mCamera)
return;

// if not initialized before, then do it
if (mbDirty) init();

// if subgraph is dirty, then we have to resetup it
// we do this on the first visitor which runs over the pipeline because 
this also removes cycles
if (mbDirtyUnitGraph)
{
mbDirtyUnitGraph = false;

// first resolve all cycles in the set
ResolveUnitsCyclesVisitor rv;
rv.run(this);

// mark every unit as dirty, so that they get updated on the next call
MarkUnitsDirtyVisitor nv;
nv.run(this);

// debug information
osg::notify(osg::INFO) << 
"" << 
std::endl;
osg::notify(osg::INFO) << "BEGIN " << getName() << std::endl;

SetupUnitRenderingVisitor sv(this);
sv.run(this);

osg::notify(osg::INFO) << "END " << getName() << std::endl;
osg::notify(osg::INFO) << 
"" << 
std::endl;

// optimize subgraph
OptimizeUnitsVisitor ov;
ov.run(this);
}

[b]// make sure we render only our own camera
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
{
  osgUtil::CullVisitor* cv = dynamic_cast(&nv);
  if (cv)
  {
if (cv->getCurrentCamera() != getCamera())
{
  return;
}
  }
}
[/b]
// first we need to clear traversion bit of every unit
if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
{
CleanUpdateTraversedVisitor::sVisitor->run(this);
}

// if processor is propagated by a cull visitor, hence first clean the 
traverse bit
if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
{
osg::notify(osg::DEBUG_INFO) << 
"" << 
std::endl;
osg::notify(osg::DEBUG_INFO) << "BEGIN FRAME " << getName() << 
std::endl;

CleanCullTraversedVisitor::sVisitor->run(this);
}

if (mbDirtyUnitGraph == false || nv.getVisitorType() == 
osg::NodeVisitor::NODE_VISITOR)
{
osg::Group::traverse(nv);
}

// check if we have units that want to be executed last, then do so
if (mbDirtyUnitGraph == false && nv.getVisitorType() == 
osg::NodeVisitor::CULL_VISITOR)
{
for (std::list::iterator it = mLastUnits.begin(); it != 
mLastUnits.end(); it++)
{
placeUnitAsLast(*it, false);
(*it)->accept(nv);
placeUnitAsLast(*it, true);
}
mLastUnits.clear();
}
}




3. You need to make sure your camera viewport of each view is set to an origin 
of 0/0. Control the position of the rendering viewport by setting the UnitOut 
viewport to the desired origin. 

This is due to a limitation of osgPPU, which copies to and from the render 
target always relative to a 0/0 origin.


Now Enjoy osgPPU and compositeViewer!

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





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


[osg-users] [osgPPU] multiple processors

2012-11-20 Thread Daniel Schmid
Hi art and all

This is not my first post about osgPPU and composite viewer, but I get no read 
feedback so I try it once more.

I have a composite viewer, and I can add views at runtime. I use osgPPU and it 
works with one viewer (the first created). For every additional viewer I also 
create a separate unit pipeline and separate processor, and I add the latter to 
the scene graph root node.

Everything seems to work, except that osgPPU runs only on the first view, every 
additional viewer is black. 

Art, can you provide some feedback where the drawbacks are that hinder my 
second view of having his own postprocessing? I have a separate processor, 
separate units and the processor attached to the correct camera. What else do I 
have to check?


Thank you!

Cheers,
Daniel

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





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


Re: [osg-users] [osgPPU] osgPPU with CompositeViewer

2012-11-05 Thread Daniel Schmid
Hello all

I bring this subject again to the surface. And I wonder if Art (or anybody else 
out there) has an opinion about this he would like to share...

In a composite viewer setting, views can be dynamically added and removed. In 
osgPPU, the Processor is part of the scene graph, but it has to be connected to 
a views camera...

So there are two problems which are not solved:
- How to disconnect a view (camera) from the processor and succesfully 
reconnect a new view to it?
- How to deal with multiple views visible at the same time? Multiple processors 
added to the scene graph?

I guess for the last point, there is a conceptional problem. The whole 
postprocessing should ONLY be bound to the view and leave no traces in the 
scene graph itself...

What do you think?

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





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


Re: [osg-users] osgPPU::Processor and other root's children traversing order

2012-10-03 Thread Sergey Polischuk
Hiiirc ppu stuff does it things at a renderbin 100. Cheers. 03.10.2012, 23:42, "Peterakos" :Hello.I am working on osgPPU but there are some things i haven't completely understood yet.I add 2 children in root's group.A cow model and the osgPPU::Processor.In processor i have added 1 child which outputs the depth buffer and under that child i have added 1 child which outputs to frame buffer.I have noticed that the order of root->addChild(loadedModel);root->addChild(ppu);doesnt matter and i am wondering why.UnitCameraAttachmentBypass needs the depth buffer which is taken from camera. But if ppu is rendered first (as first child) there will be no depth buffer to output to frame buffer (through UnitCameraAttachmentBypass's child, which is UnitOut).Why is this happening ? do i miss something?The scene graph is the followingroot   ppu       UnitCameraAttachmentBypass (outputs Depth)          UnitOut   loadedModelThank you for your time.,___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


[osg-users] osgPPU::Processor and other root's children traversing order

2012-10-03 Thread Peterakos
Hello.

I am working on osgPPU but there are some things i haven't completely
understood yet.
I add 2 children in root's group.

A cow model and the osgPPU::Processor.
In processor i have added 1 child which outputs the depth buffer and under
that child i have added 1 child which outputs to frame buffer.

I have noticed that the order of
root->addChild(loadedModel);
root->addChild(ppu);
doesnt matter and i am wondering why.


UnitCameraAttachmentBypass needs the depth buffer which is taken from
camera. But if ppu is rendered first (as first child) there will be no
depth buffer to output
to frame buffer (through UnitCameraAttachmentBypass's child, which is
UnitOut).

Why is this happening ? do i miss something?

The scene graph is the following

root
   ppu
   UnitCameraAttachmentBypass (outputs Depth)
  UnitOut
   loadedModel


Thank you for your time.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPPU] set new camera pointer

2012-08-15 Thread Daniel Schmid
Hi Art

I create a processor and units and hock to processor to the root scene node.
Then as soon as the viewer is up, I set the processors camera pointer.

Now in my application I have the feature of destroying the view and setting it 
up again (we use composite viewer). 

As soon as I set the processors camera to the new camera that belongs to the 
new view, I have a random checkerboard texture which is rendered. 

What is the correct procedure when the scene graph is not changed, neighter the 
ppus, but the viewer can be added and removed. How can I tell osgPPU to 
completely invalidate its resources?


Thank you!

Cheers,
Daniel

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





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


Re: [osg-users] [osgPPU] DoF blur issues for antialiased text

2012-06-25 Thread Mike Wozniewski
Hi all,

I'm still struggling with this and just wanted to add some extra details.

The problem is that the blur around text near the camera is not being combined 
with blur further back. It's almost like the blur is being drawn from front to 
back while text (rendered as glyphs with alpha channel) are being drawn from 
back to front. Is that possible?

I imagine that this would need to be fixed on the shader side. ie, in 
depth_of_field_fp.glsl (?):


Code:
void main(void)
{
vec2 inTex = gl_TexCoord[0].st;

// compute distance to the viewer
float a = zFar / ( zFar - zNear );
float b = zFar * zNear / ( zNear - zFar );

float depth = texture2D( texDepthMap, inTex ).x;
float dist = b / ( depth - a );

// get color map and blurred color map values
vec4 colorValue = texture2D (texColorMap, inTex).rgba;
vec4 blurredValue1 = texture2D ( texBlurredColorMap, inTex).rgba;
vec4 blurredValue2 = texture2D ( texStrongBlurredColorMap, inTex).rgba;

// now compute the bluriness value
float blur = clamp(abs(dist - focalLength) / focalRange, 0.0, 1.0);
float factor1 = 1.0;
float factor2 = 0.0;

// compute blend factors
if (blur > 0.5)
factor2 = (blur - 0.5) * 2.0;
else
factor1 = blur * 2.0;

// the resulting color value is the combination of blurred and non-blurred 
map
vec4 result = mix(colorValue, blurredValue1, factor1);
gl_FragColor = mix(result, blurredValue2, factor2);
}



ie, will gl_FragColor correctly combine previously drawn alpha values?

Any help would be greatly appreciated.

-Mike

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





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


[osg-users] [osgPPU] osgPPU with GL3

2012-06-25 Thread Joshua No
I've tried compiling osgPPU with ~> OpenGL 3.1  osg build but I'm having 
trouble.  Seems osgPPU is not ready for the current OpenGL release?  Any plans? 
 Or am I doing it wrong?

I really need to do blurs and other effects in our OSG based application. 

Thanks

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





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


Re: [osg-users] [osgPPU] Problems installing osgPPU using cmake 2.8.4

2012-06-12 Thread Art Tevs
Hi Christian,

try to setup the paths manually. Just click on the paths which are marked as 
NOTFOUND and set there the path to your osg installation manually. This should 
solve the issue with FindOSG.cmake

Let us know if this helps or not.

art



Rumpfi wrote:
> I tried to install the latest osgPPU version I found today, using cmake 2.8.4 
> and Visual Studio 10, but when i started to configure the folder I got the 
> following cmake-error:
> 
> 
> > Check for working C compiler using: Visual Studio 10
> > Check for working C compiler using: Visual Studio 10 -- works
> > Detecting C compiler ABI info
> > Detecting C compiler ABI info - done
> > Check for working CXX compiler using: Visual Studio 10
> > Check for working CXX compiler using: Visual Studio 10 -- works
> > Detecting CXX compiler ABI info
> > Detecting CXX compiler ABI info - done
> > Found OpenGL: opengl32 
> > CUDA installation wasn't found
> > Could not find nvcc, CUDA examples wouldn't be built
> > Could not find cudart library (cudart)
> > Could not find cuda libraries.
> > CMake Warning (dev) at CMakeLists.txt:45 (INCLUDE):
> >   Policy CMP0011 is not set: Included scripts do automatic cmake_policy PUSH
> >   and POP.  Run "cmake --help-policy CMP0011" for policy details.  Use the
> >   cmake_policy command to set the policy and suppress this warning.
> > 
> >   The included script
> > 
> > C:/osgPPU-0.4.0/CMakeModules/cuda/FindCuda.cmake
> > 
> >   affects policy settings.  CMake is implying the NO_POLICY_SCOPE option for
> >   compatibility, so the effects are applied to the including context.
> > This warning is for project developers.  Use -Wno-dev to suppress it.
> > 
> > CMake Error: The following variables are used in this project, but they are 
> > set to NOTFOUND.
> > Please set them or make sure they are set and tested correctly in the CMake 
> > files:
> > OPENTHREADS_LIBRARY_RELEASE
> > linked by target "osgppu_hdr" in directory 
> > C:/osgPPU-0.4.0/src/example/hdr
> > linked by target "osgppu_viewer" in directory 
> > C:/osgPPU-0.4.0/src/example/viewer
> > linked by target "osgppu_dof" in directory 
> > C:/osgPPU-0.4.0/src/example/dof
> > linked by target "osgppu_cubemap" in directory 
> > C:/osgPPU-0.4.0/src/example/cubemap
> > linked by target "osgppu_texture3D" in directory 
> > C:/osgPPU-0.4.0/src/example/texture3D
> > linked by target "osgppu_video" in directory 
> > C:/osgPPU-0.4.0/src/example/video
> > linked by target "osgppu_ssao" in directory 
> > C:/osgPPU-0.4.0/src/example/ssao
> > linked by target "osgppu_glow" in directory 
> > C:/osgPPU-0.4.0/src/example/glow
> > linked by target "osgPPU" in directory C:/osgPPU-0.4.0/src/osgPPU
> > OSGDB_LIBRARY_RELEASE
> > linked by target "osgppu_hdr" in directory 
> > C:/osgPPU-0.4.0/src/example/hdr
> > linked by target "osgppu_viewer" in directory 
> > C:/osgPPU-0.4.0/src/example/viewer
> > linked by target "osgppu_dof" in directory 
> > C:/osgPPU-0.4.0/src/example/dof
> > linked by target "osgppu_cubemap" in directory 
> > C:/osgPPU-0.4.0/src/example/cubemap
> > linked by target "osgppu_texture3D" in directory 
> > C:/osgPPU-0.4.0/src/example/texture3D
> > linked by target "osgppu_video" in directory 
> > C:/osgPPU-0.4.0/src/example/video
> > linked by target "osgppu_ssao" in directory 
> > C:/osgPPU-0.4.0/src/example/ssao
> > linked by target "osgppu_glow" in directory 
> > C:/osgPPU-0.4.0/src/example/glow
> > linked by target "osgPPU" in directory C:/osgPPU-0.4.0/src/osgPPU
> > OSGGA_LIBRARY_RELEASE
> > linked by target "osgppu_hdr" in directory 
> > C:/osgPPU-0.4.0/src/example/hdr
> > linked by target "osgppu_viewer" in directory 
> > C:/osgPPU-0.4.0/src/example/viewer
> > linked by target "osgppu_dof" in directory 
> > C:/osgPPU-0.4.0/src/example/dof
> > linked by target "osgppu_cubemap" in directory 
> > C:/osgPPU-0.4.0/src/example/cubemap
> > linked by target "osgppu_texture3D" in directory 
> > C:/osgPPU-0.4.0/src/example/texture3D
> > linked by target "osgppu_video" in directory 
> > C:/osgPPU-0.4.0/src/example/video
> > linked by target "osgppu_ssao" in directory 
> > C:/osgPPU-0.4.0/src/example/ssao
> > linked by target "osgppu_glow" in directory 
> > C:/osgPPU-0.4.0/src/example/glow
> > OSGTEXT_LIBRARY_RELEASE
> > linked by target "osgppu_hdr" in directory 
> > C:/osgPPU-0.4.0/src/example/hdr
> > linked by target "osgppu_viewer" in directory 
> > C:/osgPPU-0.4.0/src/example/viewer
> > linked by target "osgppu_dof" in directory 
> > C:/osgPPU-0.4.0/src/example/dof
> > linked by target "osgppu_cubemap" in directory 
> > C:/osgPPU-0.4.0/src/example/cubemap
> > linked by target "osgppu_texture3D" in directory 
> > C:/osgPPU-0.4.0/src/example/texture3D
> > linked by target "osgppu_video" in directory 
> > C:/osgPPU-0.4.0/src/example/video
> > linked by target "osgppu_ssao" in directory 
> > C:/osgPPU-0.4.0/src/example/ssao
> >   

[osg-users] [osgPPU] Problems installing osgPPU using cmake 2.8.4

2012-06-05 Thread Christian Rumpf
I tried to install the latest osgPPU version I found today, using cmake 2.8.4 
and Visual Studio 10, but when i started to configure the folder I got the 
following cmake-error:


> Check for working C compiler using: Visual Studio 10
> Check for working C compiler using: Visual Studio 10 -- works
> Detecting C compiler ABI info
> Detecting C compiler ABI info - done
> Check for working CXX compiler using: Visual Studio 10
> Check for working CXX compiler using: Visual Studio 10 -- works
> Detecting CXX compiler ABI info
> Detecting CXX compiler ABI info - done
> Found OpenGL: opengl32 
> CUDA installation wasn't found
> Could not find nvcc, CUDA examples wouldn't be built
> Could not find cudart library (cudart)
> Could not find cuda libraries.
> CMake Warning (dev) at CMakeLists.txt:45 (INCLUDE):
>   Policy CMP0011 is not set: Included scripts do automatic cmake_policy PUSH
>   and POP.  Run "cmake --help-policy CMP0011" for policy details.  Use the
>   cmake_policy command to set the policy and suppress this warning.
> 
>   The included script
> 
> C:/osgPPU-0.4.0/CMakeModules/cuda/FindCuda.cmake
> 
>   affects policy settings.  CMake is implying the NO_POLICY_SCOPE option for
>   compatibility, so the effects are applied to the including context.
> This warning is for project developers.  Use -Wno-dev to suppress it.
> 
> CMake Error: The following variables are used in this project, but they are 
> set to NOTFOUND.
> Please set them or make sure they are set and tested correctly in the CMake 
> files:
> OPENTHREADS_LIBRARY_RELEASE
> linked by target "osgppu_hdr" in directory C:/osgPPU-0.4.0/src/example/hdr
> linked by target "osgppu_viewer" in directory 
> C:/osgPPU-0.4.0/src/example/viewer
> linked by target "osgppu_dof" in directory C:/osgPPU-0.4.0/src/example/dof
> linked by target "osgppu_cubemap" in directory 
> C:/osgPPU-0.4.0/src/example/cubemap
> linked by target "osgppu_texture3D" in directory 
> C:/osgPPU-0.4.0/src/example/texture3D
> linked by target "osgppu_video" in directory 
> C:/osgPPU-0.4.0/src/example/video
> linked by target "osgppu_ssao" in directory 
> C:/osgPPU-0.4.0/src/example/ssao
> linked by target "osgppu_glow" in directory 
> C:/osgPPU-0.4.0/src/example/glow
> linked by target "osgPPU" in directory C:/osgPPU-0.4.0/src/osgPPU
> OSGDB_LIBRARY_RELEASE
> linked by target "osgppu_hdr" in directory C:/osgPPU-0.4.0/src/example/hdr
> linked by target "osgppu_viewer" in directory 
> C:/osgPPU-0.4.0/src/example/viewer
> linked by target "osgppu_dof" in directory C:/osgPPU-0.4.0/src/example/dof
> linked by target "osgppu_cubemap" in directory 
> C:/osgPPU-0.4.0/src/example/cubemap
> linked by target "osgppu_texture3D" in directory 
> C:/osgPPU-0.4.0/src/example/texture3D
> linked by target "osgppu_video" in directory 
> C:/osgPPU-0.4.0/src/example/video
> linked by target "osgppu_ssao" in directory 
> C:/osgPPU-0.4.0/src/example/ssao
> linked by target "osgppu_glow" in directory 
> C:/osgPPU-0.4.0/src/example/glow
> linked by target "osgPPU" in directory C:/osgPPU-0.4.0/src/osgPPU
> OSGGA_LIBRARY_RELEASE
> linked by target "osgppu_hdr" in directory C:/osgPPU-0.4.0/src/example/hdr
> linked by target "osgppu_viewer" in directory 
> C:/osgPPU-0.4.0/src/example/viewer
> linked by target "osgppu_dof" in directory C:/osgPPU-0.4.0/src/example/dof
> linked by target "osgppu_cubemap" in directory 
> C:/osgPPU-0.4.0/src/example/cubemap
> linked by target "osgppu_texture3D" in directory 
> C:/osgPPU-0.4.0/src/example/texture3D
> linked by target "osgppu_video" in directory 
> C:/osgPPU-0.4.0/src/example/video
> linked by target "osgppu_ssao" in directory 
> C:/osgPPU-0.4.0/src/example/ssao
> linked by target "osgppu_glow" in directory 
> C:/osgPPU-0.4.0/src/example/glow
> OSGTEXT_LIBRARY_RELEASE
> linked by target "osgppu_hdr" in directory C:/osgPPU-0.4.0/src/example/hdr
> linked by target "osgppu_viewer" in directory 
> C:/osgPPU-0.4.0/src/example/viewer
> linked by target "osgppu_dof" in directory C:/osgPPU-0.4.0/src/example/dof
> linked by target "osgppu_cubemap" in directory 
> C:/osgPPU-0.4.0/src/example/cubemap
> linked by target "osgppu_texture3D" in directory 
> C:/osgPPU-0.4.0/src/example/texture3D
> linked by target "osgppu_video" in directory 
> C:/osgPPU-0.4.0/src/example/video
> linked by target "osgppu_ssao" in directory 
> C:/osgPPU-0.4.0/src/example/ssao
> linked by target "osgppu_glow" in directory 
> C:/osgPPU-0.4.0/src/example/glow
> linked by target "osgPPU" in directory C:/osgPPU-0.4.0/src/osgPPU
> OSGUTIL_LIBRARY_RELEASE
> linked by target "osgppu_hdr" in directory C:/osgPPU-0.4.0/src/example/hdr
> linked by target "osgppu_viewer" in directory 
> C:/osgPPU-0.4.0/src/example/viewer
> linked by target "osgppu_dof" in directory C:/osgPPU-0.4.0/src/example/dof
> linked by target "osgppu_cubemap" in directory 
> C:/osgPPU

[osg-users] [osgPPU] HDR - no result displayed

2012-04-26 Thread Daniel Borchart
Hey,

I'm trying to integrate the HDR example into my application, but the screen 
remains black.

The sole difference is that I'm not using the osg mainloop. Instead I render 
the scene to a Qt GLWidget and have to call osgViewer::frame() in the paintGL() 
method.
That seems to be the reason why I don't get any results on the screen. When I 
modify the example code and replace m_viewer->run() with a separate main loop 
where viewer->frame() is called repeatedly the same problem occurs.

I also don't really understand how osgPPU writes the result to the screen 
buffer. Maybe there is something wrong with my camera configuration?
I have my own camera implementation that calculates the view matrix from camera 
position and attitude every frame.

Sorry for my bad English. I would be very grateful If someone can give me a 
hint.

Daniel

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





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


Re: [osg-users] [osgPPU] Perfomance issues with PBO for input textures

2012-02-28 Thread Art Tevs
Hi Shahar,

I would say that this is expected behaviour. This is due to the case, that the 
texture has to be copied from the GPU memory to the CPU memory. With PBOs this 
should be done through DMA or somehow directly without involving CPU for this, 
however the PCIe bus is the bottleneck here. I

In general, consider if you need to have the resulting texture on the CPU at 
all ;) Maybe you can comeup with shaders which do exactly this, what you would 
do on the CPU. 


Actually with PBOs you can have asynchronous texture transfer. Not sure about 
download from GPU, but surely for uploading to the GPU. However, I can imagine 
that whenever you download the texture in every frame, which is automatically 
doen by osgPPU, the execution might stall, while the download isn't complete 
yet. Hence, what you might try is to write a callback which will just switch on 
the PBO use every nth frame, if you don't need the output of osgPPU in every 
frame. It might be that this could solve the problem, since the texture can be 
downloaded asynchronously during the rendering of the n frames.

I am not sure if this will work out, but you might try this.

Cheers,
art



kshahar wrote:
> Hi,
> I'm new to osgPPU and OSG in general, so please bear with me :)
> 
> I'm trying to use the built-in mechanism in osgPPU::Unit for copying the 
> rendered textures to the CPU. 
> I'm using a simple tester based on one of the osgPPU examples, and my 
> initialization code is structured like this:
> 
> Code:
> 
> // Somewhere in the middle of the Processor graph:
> osgPPU::Unit* pUnit = new osgPPU::UnitInOut();
> pUnit->setUsePBOForInputTexture(0, true);
> parentUnit->addChild(pUnit);
> 
> 
> 
> 
> With this code the frame rate drops significantlly, from 60 to 10-30 
> (dependning on the viewport size). If I comment out the glGetTexImage call 
> inside Unit.cpp, everything works as before (but nothing gets copied, of 
> course).
> 
> Considering I don't mind getting the texture with a delay of a few frames, is 
> there any way to improve the performance of the current implementation?
> I must say I've read about PBO (http://www.songho.ca/opengl/gl_pbo.html), but 
> I'm not sure whether this is the correct approach here, or how to integrate 
> it with the existing code base.
> 
> Thanks,
> Shahar


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





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


[osg-users] [osgPPU] Perfomance issues with PBO for input textures

2012-02-28 Thread Shahar Kosti
Hi,
I'm new to osgPPU and OSG in general, so please bear with me :)

I'm trying to use the built-in mechanism in osgPPU::Unit for copying the 
rendered textures to the CPU. I'm using a simple tester based on one of the 
osgPPU, and my initialization code is structured like this:

Code:

// Somewhere in the middle of the Processor graph:
osgPPU::Unit* pUnit = new osgPPU::UnitInOut();
pUnit->setUsePBOForInputTexture(0, true);
parentUnit->addChild(pUnit);




With this code the frame rate drops significantlly, from 60 to 10-30 
(dependning on the viewport size). If I comment out the glGetTexImage call 
inside Unit.cpp, everything works as before (but nothing gets copied, of 
course).

Considering I don't mind getting the texture with a delay of a few frames, is 
there any way to improve the performance of the current implementation?
I must say I've read about PBO (http://www.songho.ca/opengl/gl_pbo.html), but 
I'm not sure whether this is the correct approach here, or how to integrate it 
with the existing code base.

Thanks,
Shahar

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





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


Re: [osg-users] [osgPPU] Fixed crash in UnitTexture, when external texture has no image.

2012-01-04 Thread Gena Quenca
Thank you!

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





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


Re: [osg-users] [osgPPU] Blur artifacts in HDR effect

2011-11-24 Thread René Molenaar
the radius determines the pixel for which the sigma is used.
once you are on the edges of the kernel (gauss curve approaches 0),
you can stop blurring.

this will be around 2.5 - 3 times sigma.

the correct sigma depends on the effect intended,
try different sigmas ranging from 2-15 and radius = 2.5 * sigma
(maybe you can attach a slider to interactively determine the best value.)

René



2011/11/24 Jean-Sébastien Guay 

> Hello René,
>
>
>  also notice that the radius should be about 2.5 - 3 times sigma to make
>> sure
>> the entire kernel is used instead of cutoff by the radius.
>>
>
> The default values in the osgPPU hdr example are sigma = 4.0 and radius =
> 7.0, however I have not seen a difference between radius = 7.0, 15.0 and
> 200.0... So there I wonder if the values are getting to the shaders
> correctly.
>
> What values would you suggest I use for good results?
>
> Thanks,
>
>
> J-S
> --
> __**
> Jean-Sebastien Guay
> jean-sebastien.guay@cm-labs.**com
>   http://www.cm-labs.com/
>
> 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] Blur artifacts in HDR effect

2011-11-24 Thread Jean-Sébastien Guay

Hello René,


also notice that the radius should be about 2.5 - 3 times sigma to make sure
the entire kernel is used instead of cutoff by the radius.


The default values in the osgPPU hdr example are sigma = 4.0 and radius 
= 7.0, however I have not seen a difference between radius = 7.0, 15.0 
and 200.0... So there I wonder if the values are getting to the shaders 
correctly.


What values would you suggest I use for good results?

Thanks,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] Blur artifacts in HDR effect

2011-11-24 Thread René Molenaar
I don't think there are other textures involved to add MSAA to..

 two other blur units before the UnitInResampleOut could help yes,

also notice that the radius should be about 2.5 - 3 times sigma to make sure
the entire kernel is used instead of cutoff by the radius.

grtz,

René

2011/11/24 Jean-Sébastien Guay 

> Hello René,
>
>
>  maybe multisampling can reduce the problem.
>>
>
> The screenshot was with 4x MSAA active (in the camera->attach(...) call of
> the HDR code, where we bind a texture to the main scene camera which is
> then passed to the first unit in the osgPPU pipeline).
>
> Perhaps you're suggesting I enable MSAA for one of the other stages in the
> pipeline? How would I do that?
>
>
>  also you can add an additional gausian blur to the image before
>> resampling to reduce the artifacts.
>>
>
> Again using the same separable blur (x and y passes)? So I would add two
> other units before the UnitInResampleOut?
>
> Thanks for your suggestions,
>
>
> J-S
> --
> __**
> Jean-Sebastien Guay
> jean-sebastien.guay@cm-labs.**com
>   http://www.cm-labs.com/
>
> 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] Blur artifacts in HDR effect

2011-11-23 Thread Jean-Sébastien Guay

Hello René,


maybe multisampling can reduce the problem.


The screenshot was with 4x MSAA active (in the camera->attach(...) call 
of the HDR code, where we bind a texture to the main scene camera which 
is then passed to the first unit in the osgPPU pipeline).


Perhaps you're suggesting I enable MSAA for one of the other stages in 
the pipeline? How would I do that?



also you can add an additional gausian blur to the image before
resampling to reduce the artifacts.


Again using the same separable blur (x and y passes)? So I would add two 
other units before the UnitInResampleOut?


Thanks for your suggestions,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] Blur artifacts in HDR effect

2011-11-23 Thread René Molenaar
Hi,

maybe multisampling can reduce the problem.
using osgPPU hdr I noticed small details with high frequency (distant
lights) appearing and disappearing.

mutlisampling reduced these artifacts.
(It did however cause a one frame delay, which isn't very noticable until
you use a request redraw viewer,
or screencaptures)

also you can add an additional gausian blur to the image before resampling
to reduce the artifacts.

grtz,

René Molenaar



2011/11/23 Jean-Sébastien Guay 

> Hello all,
>
> I am using the osgPPU HDR effect, and I noticed some undesirable artifacts
> probably caused by the blur effect, or the resample of the original pass
> (before the blur). Using the default resample settings (resample by 0.25 in
> each direction) I get the result in the attached screenshot. Look at the
> edges of the black cables, there are regular artifacts along their length,
> they are supposed to be a smooth edge.
>
> If I change the resample to 0.5 or 1.0 in each direction, I don't get
> these artifacts, but of course then the glare effect is less interesting :-)
>
> I also saw these parameters which are related to the blur (their name
> implies it at least) but changing them doesn't seem to make a significant
> difference.
>
>  float mHDRBlurSigma = 4.0;
>  float mHDRBlurRadius = 7.0;
>
> Can anyone give me a hint as to what could help this situation? Perhaps
> OpenGL is already filtering the resampled unit and then the blur uses that
> badly-filtered image as input? Or perhaps the blur shaders have some error
> in them?
>
> Thanks in advance,
>
> J-S
> --
> __**
> Jean-Sebastien Guay
> jean-sebastien.guay@cm-labs.**com
>   http://www.cm-labs.com/
>
> 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] FIX: osgPPU rendering not working in the first frame

2011-11-18 Thread Art Tevs
Hi Alex,

ok, this is of course pretty bad. 

Actually,  I think the correct way would be to apply the texture to the 
osg::State within the FBO::apply(). This would ensure that the state is tracked 
correctly. Of course, unfortunately this requires a patch to the main osg core. 

In general, I think this might be a general osg problem, since in order to 
generate texture within FBO::apply() one need to make sure that current texture 
binding is not overwritten. I think, I will try to rewrite your patch here 
slightly to ensure correct work of osgPPU, but we should keep in mind, that we 
might need a patch for OSG as well.

Cheers,
art



airion wrote:
> Hello Art,
> 
> glPushAttrib / glPopAttrib works as well, but it's not available in GLES and 
> I also use osgPPU with GLES. However in GLES there are no 3D textures, only 
> 2D and cube maps.
> 
> Regards,
> --Alex


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





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


Re: [osg-users] [osgPPU] FIX: osgPPU rendering not working in the first frame

2011-11-18 Thread Alexander Irion
Hello Art,

glPushAttrib / glPopAttrib works as well, but it's not available in GLES and I 
also use osgPPU with GLES. However in GLES there are no 3D textures, only 2D 
and cube maps.

Regards,
--Alex

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





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


Re: [osg-users] [osgPPU] FIX: osgPPU rendering not working in the first frame

2011-11-17 Thread Art Tevs
Hi Alex,

hmm, ok, it seems to be a solution, however I am not sure if this is a general 
one. I mean, what if for example the input texture is not 2D and the output 
texture is also not 2D. Then fbo will still overwrite current binding.

I would propose to try following solution:

glPushAttrib(GL_TEXTURE_BIT);
mFBO->apply(*info.getState());
glPopAttrib();

Alex, could you please try if this works for you? Based on the specifications 
of glPushAttrib this should store current texture bindings

cheers,
art



airion wrote:
> Hi,
> 
> the last days I was fighting the problem, that osgPPU rendering was not 
> working in the first frame. Normally, this is rarely noticeable, but I use it 
> for generating a texture, that does not change anymore - so I use osgPPU with 
> a single shot rendering and if the rendering is faulty, the error remains 
> visible for all the time.
> 
> I tracked the problem down to reside in UnitInOut::noticeBeginRendering(). 
> There "mFBO->apply(*info.getState());" causes the units output texture to be 
> generated in the first frame. This causes a glBindTexture() which brakes the 
> binding of the already bound input texture, so that rendering can not work in 
> this frame.
> 
> Please find attached fix, that restores the texture binding after applying 
> the FBO.
> 
> Regards,
> --Alex


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





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


Re: [osg-users] [osgPPU] Fixed crash in UnitTexture, when external texture has no image.

2011-11-17 Thread Art Tevs
Hi Alex,

thanks, I've patched the file.

art


airion wrote:
> Please find attached fix. It fixes a null pointer dereferencing in 
> UnitTexture::setTexture(), when tex has no image, yet.
> 
> Regards,
> --Alex


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





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


Re: [osg-users] [osgPPU] Drawing a mesh over an osgPPU output

2011-11-08 Thread Art Tevs
Hi Jean,

one way to do so, is to pass the output of osgPPU graph to a texture and then 
use that texture in order to draw the background for your scene. So, at the end 
of your Unit Graph you don't use UnitOut but UnitInOut and use it's output 
texture for your purpose.

If you want to have some kind of HUD, then you might need to experiment with 
Processor's bin number. Since this was set in the way, that output of the units 
is always rendered on top of anything. You might also add to the stateset of 
your geometry some higher number then this of the processor (100).

cheers,
art




Skylark wrote:
> Hi all,
> 
> I hope there are some people using osgPPU who can answer my question. 
> I'm having trouble doing something that I think should be simple, so if 
> someone has any ideas I'd appreciate it.
> 
> What I need is to draw a mesh (which is a blending mesh, and whose 
> vertices are in eye space) over the result of an osgPPU pipeline before 
> outputting it to the framebuffer. My osgPPU unit is almost 100% like the 
> HDR example's pipeline, without the text and background PPUs which I 
> don't need.
> 
> What I tried is to add a transform (ABSOLUTE_RF) containing the mesh 
> under the final unit in the pipeline. The result is that the mesh is not 
> rendered.
> 
> I also tried adding the mesh (drawable only) under the final unit's 
> geode. For this I had to create an overridden class so that the unit's 
> init() method would not remove the drawable from the geode, and still it 
> wasn't rendered in the result.
> 
> Is there already a tool in osgPPU that would allow me to do this easily? 
> Or should I use a UnitCamera with my mesh under it?
> 
> Thanks in advance,
> 
> J-S
> -- 
> __
> Jean-Sébastien Guay
> http://www.cm-labs.com/
> http://whitestar02.dyndns-web.com/
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





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


[osg-users] [osgPPU] Drawing a mesh over an osgPPU output

2011-11-08 Thread Jean-Sébastien Guay

Hi all,

I hope there are some people using osgPPU who can answer my question. 
I'm having trouble doing something that I think should be simple, so if 
someone has any ideas I'd appreciate it.


What I need is to draw a mesh (which is a blending mesh, and whose 
vertices are in eye space) over the result of an osgPPU pipeline before 
outputting it to the framebuffer. My osgPPU unit is almost 100% like the 
HDR example's pipeline, without the text and background PPUs which I 
don't need.


What I tried is to add a transform (ABSOLUTE_RF) containing the mesh 
under the final unit in the pipeline. The result is that the mesh is not 
rendered.


I also tried adding the mesh (drawable only) under the final unit's 
geode. For this I had to create an overridden class so that the unit's 
init() method would not remove the drawable from the geode, and still it 
wasn't rendered in the result.


Is there already a tool in osgPPU that would allow me to do this easily? 
Or should I use a UnitCamera with my mesh under it?


Thanks in advance,

J-S
--
__
Jean-Sébastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] delay in glow FX

2011-11-02 Thread Aurelien Albert
Hi,

I'm facing the same problem.

Have you found a cause / solution to this issue ?


Thanks,
Aurelien

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





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


[osg-users] [osgPPU] delay in glow FX

2011-10-06 Thread Luca Vezzadini
Hi,
I was trying to implement a glow effect and I was experiencing a bad delay 
between the glow image and the main one. Then I looked back at the osgppu_glow 
example and it looks like the same issue is also present there. To make it more 
visible I have modified the example code a bit (you have my version attached 
here). If you try moving the camera quite quickly you'll see the two images 
showing some delay (the main render should never "pop up" from the green glow, 
but it does). Weirdly enough, it seems that the glowed image updates FASTER 
than the main one...

Any idea about what could cause this issue?
Thanks,
Luca

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



/* OpenSceneGraph example, osgprerendercubemap.
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the "Software"), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*/

#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 

#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 

#include 


float gBlurSigma = 3.0;
float gBlurRadius = 7.0;
float g_NearPlane = 0.01;
float g_FarPlane = 50.0;

//--
// Create scene with some geometry and apply proper shader for needed objects
// return group node containing the scene, also return by reference geode, which should glow
//--
osg::ref_ptr createScene(osg::Node*& glowedScene)
{
  using namespace osg;

ref_ptr scene = new Group;
ref_ptr geode_1 = new Geode;
//scene->addChild(geode_1.get());

ref_ptr geode_2 = new Geode;
ref_ptr transform_2 = new MatrixTransform;
transform_2->addChild(geode_2.get());
transform_2->setUpdateCallback(new osg::AnimationPathCallback(Vec3(0, 0, 0), Y_AXIS, inDegrees(45.0f)));
//scene->addChild(transform_2.get());

ref_ptr geode_3 = new Geode;
ref_ptr transform_3 = new MatrixTransform;
transform_3->addChild(geode_3.get());
//transform_3->setUpdateCallback(new osg::AnimationPathCallback(Vec3(0, 0, 0), Y_AXIS, inDegrees(-22.5f)));
scene->addChild(transform_3.get());

const float radius = 0.8f;
const float height = 1.0f;
ref_ptr hints = new TessellationHints;
hints->setDetailRatio(2.0f);
ref_ptr shape;

shape = new ShapeDrawable(new Box(Vec3(0.0f, -2.0f, 0.0f), 10, 0.1f, 10), hints.get());
shape->setColor(Vec4(0.5f, 0.5f, 0.7f, 1.0f));
geode_1->addDrawable(shape.get());


shape = new ShapeDrawable(new Sphere(Vec3(-3.0f, 0.0f, 0.0f), radius), hints.get());
shape->setColor(Vec4(0.6f, 0.8f, 0.8f, 1.0f));
geode_2->addDrawable(shape.get());

shape = new ShapeDrawable(new Box(Vec3(3.0f, 0.0f, 0.0f), 2 * radius), hints.get());
shape->setColor(Vec4(0.4f, 0.9f, 0.3f, 1.0f));
geode_2->addDrawable(shape.get());

shape = new ShapeDrawable(new Cone(Vec3(0.0f, 0.0f, -3.0f), radius, height), hints.get());
shape->setColor(Vec4(0.2f, 0.5f, 0.7f, 1.0f));
geode_2->addDrawable(shape.get());

shape = new ShapeDrawable(new Cylinder(Vec3(0.0f, 0.0f, 3.0f), radius, height), hints.get());
shape->setColor(Vec4(1.0f, 0.3f, 0.3f, 1.0f));
geode_2->addDrawable(shape.get());

shape = new ShapeDrawable(new Box(Vec3(0.0f, 3.0f, 0.0f), 2, 1.1f, 2), hints.get());
shape->setColor(Vec4(0.8f, 0.8f, 0.4f, 1.0f));
geode_3->addDrawable(shape.get());

// material
ref_ptr matirial = new Material;
matirial->setColorMode(Material::DIFFUSE);
matirial->setAmbient(Material::FRONT_AND_BACK, Vec4(0, 0, 0, 1));
matirial->setSpecular(Material::FRONT_AND_BACK, Vec4(0, 0, 0, 1));
matirial->setShininess(Material::FRONT_AND_BACK, 64.0f);
scene->getOrCreateStateSet()->setAttributeAndModes(matirial.get(), StateAttribute::ON);

// create subnode, which will represented the glowed scene
osg::Group* toGlow

Re: [osg-users] [osgPPU] Fix picture freeze for certain camera perspectives.

2011-10-04 Thread Art Tevs
Hi Alexander,

thank you for the patch. I will check it out in the next days and wil patch 
osgPPU sources accordingly.

Cheers,
Art

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





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


Re: [osg-users] [osgPPU] Very basic example ?

2011-10-03 Thread Aurelien Albert
Ok, I found the solution...

An error in my shader code

 :-*

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





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


Re: [osg-users] [osgPPU] Fix picture freeze for certain camera perspectives.

2011-10-03 Thread Luca Vezzadini
You're right, I've just tried a clean checkout from the trunk with OSG 3.0.1 
and everything compiles files, including Alexander's fix.
Thanks,
Luca

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





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


Re: [osg-users] [osgPPU] Very basic example ?

2011-10-03 Thread Aurelien Albert
Currently, I have this code.

I try to do a simple operation : invert Red and Green color components, but I 
get only a black screen.

Could anyone help me ?

Thanks.


Code:
// Configure Camera
p_osgCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
p_osgCamera->setViewport(new osg::Viewport(0,0,800,600));

// Create render texture
osg::Texture2D* textureColor = new osg::Texture2D();
textureColor->setDataVariance(osg::Object::DYNAMIC); 
textureColor->setNumMipmapLevels(0);
textureColor->setUseHardwareMipMapGeneration(false);
textureColor->setResizeNonPowerOfTwoHint(false);
textureColor->setTextureSize(800, 600);
textureColor->setInternalFormat(GL_RGBA);
textureColor->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR);
textureColor->setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR);
textureColor->setInternalFormat(GL_RGBA16F_ARB);
textureColor->setSourceFormat(GL_RGBA);
textureColor->setSourceType(GL_FLOAT);

// Attach the texture and use it as the color buffer.
p_osgCamera->attach(osg::Camera::COLOR_BUFFER, textureColor);

// Create PPU pipeline
osgPPU::Processor* processor = new osgPPU::Processor(); 
processor->setCamera(p_osgCamera);

// Create colorby pass
osgPPU::UnitCameraAttachmentBypass* colorBypass = new 
osgPPU::UnitCameraAttachmentBypass;
colorBypass->setBufferComponent(osg::Camera::COLOR_BUFFER);

// Create test unit
osgPPU::UnitInOut* testUnit = new osgPPU::UnitInOut;
osg::Shader* fpShader = new osg::Shader(osg::Shader::FRAGMENT);

fpShader->setShaderSource("uniform sampler2D colorTexture;\n"
"void main() {\n"
" vec4 color = texture2D(colorTexture, gl_TexCoord[0].xy);\n"
" vec4 colorTmp = (color.x, color.y, color.z, color.w);\n"
"   gl_FragData[0] = colorTmp;\n"
"}\n");

// create shader attribute and setup one input texture
osgPPU::ShaderAttribute* shader = new osgPPU::ShaderAttribute;
shader->addShader(fpShader);
shader->add("colorTexture", osg::Uniform::SAMPLER_2D);
shader->set("colorTexture", 0);

// attach the shader
testUnit->getOrCreateStateSet()->setAttributeAndModes(shader);

// Create PPU output
osgPPU::UnitOut* ppuout = new osgPPU::UnitOut; 
ppuout->setInputTextureIndexForViewportReference(-1); 

// Setup pipeline ("p_osgRoot" is the OSG node used as sceneData for the 
"p_osgCamera" camera)
p_osgRoot->addChild(processor); 
processor->addChild(colorBypass); 
colorBypass->addChild(testUnit); 
testUnit->addChild(ppuout);




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





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


[osg-users] [osgPPU] Very basic example ?

2011-10-01 Thread Aurelien Albert
Hi,

After 2 days playing with osgPPU exmaples, I stil did not succeed to do a very 
basic PPU unit...

Is there any very basic example for osgPPU ?

Something like :

* create PPU
* add PPU unit which use a shader for a very basic operation (like switch red 
and green color components)
* attach PPU to camera

So with that, anybody could start coding PPU units easily.

Regards,
Aurelien

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





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


Re: [osg-users] [osgPPU] Fix picture freeze for certain camera perspectives.

2011-09-30 Thread Jean-Sébastien Guay

Hi Luca,


Cool to see this fixed. Did you post this on the osgPPU trunk? I don't seem to 
see any recent change there...


I think Alexander just posted a modified file, the changes haven't been 
integrated into osgPPU yet.



By the way, what version of OSG are you using to compile it? I just tried 
osgPPU 0.4.2 with OSG 3.0 and there seem to be a few changes to make to make it 
compile.


Personally I've compiled osgPPU trunk against OSG trunk just yesterday, 
and didn't hit any problems.


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] Fix picture freeze for certain camera perspectives.

2011-09-30 Thread Luca Vezzadini
Hi,
Cool to see this fixed. Did you post this on the osgPPU trunk? I don't seem to 
see any recent change there...

By the way, what version of OSG are you using to compile it? I just tried 
osgPPU 0.4.2 with OSG 3.0 and there seem to be a few changes to make to make it 
compile.

  Luca

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





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


Re: [osg-users] [osgPPU] Fix picture freeze for certain camera perspectives.

2011-09-30 Thread Jean-Sébastien Guay

Hi Alexander,


Please find attached fix for osgPPU::Unit that prevents it's geode from be 
taken into account for near far computation.


Nice to see you fixed this at the source, I had just overridden the 
Processor class and disabled near/far computation for the whole Unit 
subgraph, but fixing it at the source is much better.


Good work!

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.dyndns-web.com/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] Near/Far clip planes: problem?

2011-09-30 Thread Alexander Irion
Hi,

I had the same issue - please find my fix here:

http://forum.openscenegraph.org/viewtopic.php?p=43140#43140

It prevents the osgPPU::Unit's from beeing taken into account for near/far 
computation.

--Alex

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





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


[osg-users] [osgPPU] Fix picture freeze for certain camera perspectives.

2011-09-30 Thread Alexander Irion
Hi,

I had the problem in my application, that the picture was frozen for certain 
camera perspectives. This is caused due to the near far auto computation, that 
also takes the geometry of the osgPPU::Unit's into concern.

For the faulty case, updateCalculatedNearFar(..) in CullVisitor::apply(Geode& 
node)  has returned false, because the osgPPU::Unit geode was considered 
completely behind the near plane.

Please find attached fix for osgPPU::Unit that prevents it's geode from be 
taken into account for near far computation.

Regards,
--Alex


... 


Thank you!

Cheers,
Alexander

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




Attachments: 
http://forum.openscenegraph.org//files/unit_568.cpp


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


Re: [osg-users] osgPPU swig wrapped and viewport issues

2011-09-23 Thread René Molenaar
Hi,

I'am experiencing some issues with osgPPU, (some might have been addressed
before on the list):

* I use an ON_DEMAND scheme and osgPPU always has a one frame lag. (i am
using a simple setup similar to examples like osgppu_viewer)
* My Camera had some hud camera childs doing a POST_RENDER, these huds are
no longer visible.

and the previously mentioned issues
* auto compute near far breaks my manipulators
* viewports need a 0,0 origin

I am using osgPPU to add camera effects like bloom and vignetting,
the results are nice and the performance is good,
now i need to resolve these issues to finalize the implementation.

Any ideas if i can resolve this in my application, or are these issues to be
solved in osgPPU or osg?

Grtz,

René

Op 22 augustus 2011 15:42 schreef René Molenaar
het volgende:

> Hi,
>
> I recently started some experimenting with osgPPU.
> The first results are very nice and promising!! (osgppu rocks ;-))
>
> I added osgswig wrappers to the osgswig project to do some testing, and i
> experienced a few glitches.
>
> 1. there were some manipulation glitches, these were caused by our camera
> setting COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES on. Turning this off
> resolved the issue.
>
> 2. i had some resize problems, after searching on the forum. I found a
> solution, by adding some additional explicit resize calls ( for example in
> an event handler ):
>
>  osgPPU::Camera::resizeViewport(0,0, ea.getWindowWidth(), 
> ea.getWindowHeight(), viewer->getCamera()); 
> viewer->getProcessor()->onViewportChange();
>
> this does work when the x and y of the viewport are 0, 0 but i see wrong
> results if x and y are increased ( purple bars appear ).
>
> 3. an additional frame() call was needed after the scene is loaded and
> before the postprocessor is attached, otherwise i would see only a black
> screen.
>
> Grtz,
>
> René
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] osgPPU with GLES 2.0 ?

2011-09-20 Thread Art Tevs

airion wrote:
> Hello,
> 
> did anyone try to use osgPPU with GLES 2.0 ?
> 
> Would it be difficult to do the adaption for ES? Which parts of the library 
> might be affected?
> 
> Regards,
> --Alex


Hi Alex.

Unfortunately I am not familar with GLES, hence cannot really help you out 
here. However, the main feature which must be supported in order for proper 
work of osgPPU are shaders and framebuffer objects. If you have support of this 
features using core osg library, then osgPPU shouldn't be hard to port either.

cheers,
art

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





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


[osg-users] [osgPPU] osgPPU with GLES 2.0 ?

2011-09-08 Thread Alexander Irion
Hello,

did anyone try to use osgPPU with GLES 2.0 ?

Would it be difficult to do the adaption for ES? Which parts of the library 
might be affected?

Regards,
--Alex

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





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


[osg-users] osgPPU swig wrapped and viewport issues

2011-08-22 Thread René Molenaar
Hi,

I recently started some experimenting with osgPPU.
The first results are very nice and promising!! (osgppu rocks ;-))

I added osgswig wrappers to the osgswig project to do some testing, and i
experienced a few glitches.

1. there were some manipulation glitches, these were caused by our camera
setting COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES on. Turning this off
resolved the issue.

2. i had some resize problems, after searching on the forum. I found a
solution, by adding some additional explicit resize calls ( for example in
an event handler ):

 osgPPU::Camera::resizeViewport(0,0, ea.getWindowWidth(),
ea.getWindowHeight(), viewer->getCamera());
viewer->getProcessor()->onViewportChange();

this does work when the x and y of the viewport are 0, 0 but i see wrong
results if x and y are increased ( purple bars appear ).

3. an additional frame() call was needed after the scene is loaded and
before the postprocessor is attached, otherwise i would see only a black
screen.

Grtz,

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


Re: [osg-users] [osgPPU] Multiple effects

2011-08-19 Thread Art Tevs
Hi Christoph,

I think you misunderstood what UnitOut is good for. UnitOut outputs the result 
to the framebuffer. If you want to combine several osgPPU effects, you would 
need UnitInOut, since this one does output to a texture, which can be reused.

greetings,
art


meh11 wrote:
> Hi,
> 
> I would like to stack multiple image effects on top of each other. But the 
> thing which is confusing me is the UnitOut Node. Wouldn't it be easier to 
> just output the last PPU's image when there's nothing attached to it?
> Or should I add multiple processors to the camera? Will they pick up the 
> results from the other processors UnitOut Nodes?
> Or do I have to write a manager class which keeps track of cameras, 
> processors and UnitOuts?
> 
> Thank you!
> 
> Cheers,
> Christoph


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





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


[osg-users] [osgPPU] Multiple effects

2011-08-14 Thread Christoph Vlad
Hi,

I would like to stack multiple image effects on top of each other. But the 
thing which is confusing me is the UnitOut Node. Wouldn't it be easier to just 
output the last PPU's image when there's nothing attached to it?
Or should I add multiple processors to the camera? Will they pick up the 
results from the other processors UnitOut Nodes?
Or do I have to write a manager class which keeps track of cameras, processors 
and UnitOuts?

Thank you!

Cheers,
Christoph

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





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


Re: [osg-users] [osgPPU] osgPPU and the stencil buffer

2011-07-16 Thread Miguel Angel Exposito
Hi,

As promised, here is the source code for the Jimenez's MLAA demo for OSG using 
OSGPPU. I haven't managed to figure out the stencil buffer thing yet, so if any 
of you guys is up to the challenge, any help would be greatly appreciated!

http://pixelclock.wordpress.com/2011/07/16/jimenezs-mlaa-port-to-openscenegraph/

... 


Thank you!

Cheers,
Miguel

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





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


[osg-users] [osgPPU] UnitOut trunk and image readback

2011-07-05 Thread Luciano Pica

Hi,

I am using osgPPU (0.4.0) in a distributed environment and thus rely on
the image readback functionality through camera attachments to be able
to send rendered/postprocessed images over the network. Since OSG 3.0
seems to require the osgPPU trunk version and i could also use the new
resize functionality of osgPPU i tried to migrate to the newer version.
Unfortunately since the update i only get clear color read back instead
of the UnitOut output. The updated API doc says that UnitOut disables
the FBO which i am using, but switching the camera implementation from
FBO to simple FB leads to the same results. Are there any other changes
in that regard i need to be aware of? And what is the correct way to use
UnitOut now if i want to use camera attachments?

Debug output looks ok, the only thing differing between 0.4.0 and trunk
is the additional line "output: 0". According to the source this line
was caught by an if-phrase before and thus omitted. PipelineResult is a
UnitOut, color is a UnitTexture for input and BlurX an instance of
UnitInOut:

BEGIN FRAME EffectNode osgPPU::Processor
color run in thread 0
 vp 0x21300f0 (ref 0): 0 0 512 512
 program: 0x212d4a0
 input:  0:0x1f1c690-attr (512x512)
 output:  0x1f1c690 (512x512 )
BlurX run in thread 0
 vp 0x3f4fbe0 (ref 0): 0 0 512 512
 program: 0x7fa474019f10
radius : 15
sigma : 15
 input:  0:0x1f1c690-attr (512x512)
 output:  0x3f50370 (512x512 )
PipelineResult run in thread 0
 vp 0x3f51160 (ref 0): 0 0 512 512
 program: 0x2130c80
 input:  0:0x3f50370-attr (512x512)
 output:  0
END EffectNode osgPPU::Processor



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


Re: [osg-users] [osgPPU] osgPPU and the stencil buffer

2011-06-10 Thread David Callu
Hi Miguel

Your code seem good.
I am not familiar with MLAA and its optimization.

Have you try gDEBugger, it allow you to see the StencilBuffer at anytime.

You're right, use of osg::ClearNode between osgPPU::Unit is probably not a
good idea

If you could provide an simple example, I could play and search on my side.

Cheers
David Callu


2011/6/6 Miguel Angel Exposito 

> Thanks David!
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=40121#40121
>
>
>
>
>
> ___
> 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] [osgPPU] Render lower Resolution with unitOut than wandow / fullscreen

2011-06-08 Thread Peter Wrobel
Hi All,

@Ricky,
it works for me as expected now.
First I attach a new viewport with e.g. half res of my output window, and 
attach a texture with the same half res to the Color Buffer of the Camera. This 
can be done with different Cams and resolutions, if you have some funky 
pipeline.
camera -> setViewport( new osg::Viewport( 0 , 0 , halfResWidth , 
halfResHeight ) ) ;
camera -> attach( osg::Camera::COLOR_BUFFER0 , textureColor ) ; // has also 
halfResWidth/Height

At the end of the pipeline I tell the unitOut not to use any camera viewport as 
( size ) reference, and add another Viewport with the full resolution of my 
output window.
unitOut -> setInputTextureIndexForViewportReference( -1 ) ; // Don't use 
any Camera Viewport as reference
unitOut -> setViewport( new osg::Viewport( 0 , 0 , fullResWidth , 
fullResHeight ) ) ;

That's it.


@Art
With out of Sync I meant that the visual scale of the Glowed scene had not the 
same size as the visual scale of the non glowed scene. My mistake was, that I 
tried to scale up the viewports that were attached to the cameras ( main and 
glow ), but should have done that with the viewport attached to unitOut. 
Everything is working fine now :-)
But still a good Debugging Hint, didn't know that till now. 

Cheers, PP

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





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


Re: [osg-users] [osgPPU] Render lower Resolution with unitOut than wandow / fullscreen

2011-06-07 Thread Art Tevs
Hi,

I suppose they are not out of sync, but one is just one frame later than the 
other. In order to checkout the pipeline, you can run osgPPU in debug mode, I 
don't remember exactly (take a look into readme) you need to setup an 
environment variable. Then when unit pipeline is processed it will output to 
the console the units in the order they are rendered. This might help to debug 
the issue.

Cheers,
Art

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





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


Re: [osg-users] [osgPPU] Render lower Resolution with unitOut than wandow / fullscreen

2011-06-07 Thread Riccardo Corsi
I Peter,

I've experienced the same issue some time ago, but could not find the real
cause.
I've tried several combinations of pre-post render order of cameras, and
renderbin order for processor, but none of them solved the issue.

If you make any progress please post some news... =)
Thanks you!
Ricky




On Tue, Jun 7, 2011 at 09:40, Peter Wrobel  wrote:

> Hi Art,
>
> Thx for your answer, that worked, kind of, but have now some new issues.
> I am using the Glow example, Blur and Original are out of Sync. Will try to
> figure out, and ask/answer later.
>
>
> Thank you!
>
> Cheers,
> ParticlePeter
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=40150#40150
>
>
>
>
>
> ___
> 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] [osgPPU] Render lower Resolution with unitOut than wandow / fullscreen

2011-06-07 Thread Peter Wrobel
Hi Art,

Thx for your answer, that worked, kind of, but have now some new issues.
I am using the Glow example, Blur and Original are out of Sync. Will try to 
figure out, and ask/answer later.


Thank you!

Cheers,
ParticlePeter

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





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


Re: [osg-users] [osgPPU] Render lower Resolution with unitOut than wandow / fullscreen

2011-06-06 Thread Art Tevs
Hi Peter,

you can manually set a viewport for the unit to render it to specific size and 
position on the output buffer.

cheers,
art



ParticlePeter wrote:
> Hi,
> 
> I would like to render my scene in a lower resolution than the viewport 
> resolution, but want it stretched afterwards. When I scale the texture(s) 
> that are attached to to the camera, e.g. half res, the render output is only 
> half the size ( in x and y ) and placed in the lower left corner, and not 
> stretched over the viewport.
> Think that with this method:
> unitOut -> setInputTextureIndexForViewportReference( inputindex )
> 
> one can tell ppu which unit/texture is the reference scale for the output, 
> but in my pipleine there is no viewport sized texture.
> 
> Is there another way to tell unitOut to scale its resulting texture to 
> viewport size ?
> 
> 
> Thank you!
> 
> Cheers,
> ParticlePeter


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





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


[osg-users] [osgPPU] Render lower Resolution with unitOut than wandow / fullscreen

2011-06-06 Thread Peter Wrobrl
Hi,

I would like to render my scene in a lower resolution than the viewport 
resolution, but want it stretched afterwards. When I scale the texture(s) that 
are attached to to the camera, e.g. half res, the render output is only half 
the size ( in x and y ) and placed in the lower left corner, and not stretched 
over the viewport.
Think that with this method:
unitOut -> setInputTextureIndexForViewportReference( inputindex )

one can tell ppu which unit/texture is the reference scale for the output, but 
in my pipleine there is no viewport sized texture.

Is there another way to tell unitOut to scale its resulting texture to viewport 
size ?


Thank you!

Cheers,
ParticlePeter

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





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


Re: [osg-users] [osgPPU] osgPPU and the stencil buffer

2011-06-06 Thread Miguel Angel Exposito
Thanks David!

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





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


Re: [osg-users] [osgPPU] osgPPU and the stencil buffer

2011-06-05 Thread David Callu
Hi Miguel,

I'm too busy this week end to take a look on this problem.
Next week after Wednesday, my planning will be free and
you are the first on my todo list.

Cheers
David Callu

2011/6/3 Miguel Angel Exposito 

> Come on, guys!!, a little help here :D
>
> Sorry for bumping this but I couldn't figure out this yet :(
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=40065#40065
>
>
>
>
>
> ___
> 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] [osgPPU] osgPPU and the stencil buffer

2011-06-03 Thread Miguel Angel Exposito
Come on, guys!!, a little help here :D

Sorry for bumping this but I couldn't figure out this yet :(

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





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


Re: [osg-users] [osgPPU] osgPPU and the stencil buffer

2011-05-31 Thread Miguel Angel Exposito
Hi David,


> - Have you create an opengl context with a stencil buffer ? 
> - Have you try to use osg:ClearNode to clear the stencil buffer ? 
> - Have you check opengl call order in a debugger like gDEBugger ? 


- Yes I the context that osgViewer creates when realizing has a working stencil 
(I tested it).
- No, I didn't know that one was allowed to put nodes such as osg::ClearNode 
inbetween osgPPU::Unit's
- No, but I was planning to use GLintercept as a last resort


> yes please, could be more simple to find the bug. 


Sure!, here it is:

This function generates the whole pipeline and attaches its processor to an 
osg::Group which is returned


Code:


// This is a dirty workaround  for not using an osg::ClearNode

struct CamClearMaskCallback : public osgPPU::Unit::NotifyCallback
{
osg::Camera * m_cam;
GLbitfield m_mask;
CamClearMaskCallback(osg::Camera *cam, GLbitfield mask) : 
osgPPU::Unit::NotifyCallback(), m_cam(cam), m_mask(mask) {}
virtual void operator()(osg::RenderInfo& ri, const osgPPU::Unit* u) 
const
{
m_cam->setClearMask(m_mask);
if(m_mask & GL_STENCIL_BUFFER_BIT)
{
glClear(GL_STENCIL_BUFFER_BIT);
//printf("CLEAR\n");
} else {
//printf("\n");
}
}
};


osg::Group* MLAARendering::createMLAAPipeline(osg::Camera* camera)
{

osg::Group* finalGroup = new osg::Group;

osg::ref_ptr clearStencilCallback = new 
CamClearMaskCallback(camera, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | 
GL_STENCIL_BUFFER_BIT);
osg::ref_ptr dontClearStencilCallback = new 
CamClearMaskCallback(camera, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

osg::ref_ptr fragmentOptions = new 
osgDB::ReaderWriter::Options("fragment");
osg::ref_ptr vertexOptions = new 
osgDB::ReaderWriter::Options("vertex");

// Setup the clear mask and the stencil clear value
camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | 
GL_STENCIL_BUFFER_BIT);
camera->setClearStencil(0);
osg::Vec2f pixelSize(1.0/camera->getGraphicsContext()->getTraits()->width,
 1.0/camera->getGraphicsContext()->getTraits()->height);


// This stencil is intended to create the mask by writting a 1 to the 
stencil wherever a fragment is not discarded in the shader of the unit it's
// attached to. However, the stencil test has to pass always and osgPPU 
disables the Z test, so I don't know if this is really working as I want!
osg::Stencil * createMaskStencil = new osg::Stencil;
{
createMaskStencil->setFunctionRef(1);
createMaskStencil->setFunction(osg::Stencil::ALWAYS);
createMaskStencil->setWriteMask(1);
createMaskStencil->setOperation(osg::Stencil::REPLACE, 
osg::Stencil::REPLACE, osg::Stencil::REPLACE);
}

// This one is intended to discard every fragment not masked by a 1 in 
the stencil
osg::Stencil * useMaskStencil = new osg::Stencil;
{
useMaskStencil->setFunctionRef(1);
useMaskStencil->setFunction(osg::Stencil::EQUAL);// TODO: TEMP!!, 
Should be osg::Stencil::EQUAL!
useMaskStencil->setWriteMask(1);
useMaskStencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, 
osg::Stencil::KEEP);
} 

// This is for testing purposes (it always passes and doesn't change 
the buffer)
osg::Stencil * testStencil = new osg::Stencil;
{
testStencil->setFunction(osg::Stencil::ALWAYS,1,~0u);
testStencil->setOperation(osg::Stencil::KEEP, osg::Stencil::KEEP, 
osg::Stencil::KEEP);
} 

// Create a processor for this pipeline
m_processor = new osgPPU::Processor();
m_processor->setName("Processor");
m_processor->setCamera(camera);

osgPPU::UnitCameraAttachmentBypass* bypass = new 
osgPPU::UnitCameraAttachmentBypass();
{
bypass->setBufferComponent(osg::Camera::COLOR_BUFFER0);

bypass->setName("MLAA.mainCamOutputTex");

// I want the stencil to be cleared here, I don't really care 
if it's done before or after 'drawing'
bypass->setBeginDrawCallback(clearStencilCallback.get());
}

osgPPU::UnitCameraAttachmentBypass* bypassDepth = new 
osgPPU::UnitCameraAttachmentBypass();
{
bypassDepth->setBufferComponent(osg::Camera::DEPTH_BUFFER);

bypassDepth->setName("MLAA.mainCamOutputDepthTex");
}

// First step: Edges detection and stencil mask creation
edgeDetection = new osgPPU::UnitInOut();
edgeDetection->setName("MLAA.edgeDetectionUnit");
{


edgeDepthShader = new osgPPU::ShaderAttribute();

edgeDepthShader->addShader(osgDB::readShaderFile("Shaders\\edge_depth_frag.frag",
 fragmentOptions.get()));
 

Re: [osg-users] [osgPPU] osgPPU and the stencil buffer

2011-05-29 Thread David Callu
Hi Miguel,



2011/5/28 Miguel Angel Exposito 

> Hi,
>
> I'm pretty new to osgPPU and I'm working on a port of Jimenez's MLAA full
> scene antialiasing algorithm.
>
> It's a 3-pass post processing effect and I got it working on osgPPU.
>
> - The first step detects the edges of the RTT'd scene and makes an 'edge
> texture'.
> - The second step uses the previous texture and a precomputed one to
> calculate the area which pixels belonging to an edge would cover from an
> ideal trapeze.
> - The final step blends each pixel in its 4-neighborhood according to the
> weights calculated in the previous step.
>
> I got it fully working in osgPPU, however, an important optimization can be
> done by using the stencil buffer. The idea behind this is:
>
> - Initially the stencil is cleared out to 0
>
> - The first step of the post effect (edges detection) creates a stencil
> mask writing 1's to the stencil wherever there's an edge pixel. The pixels
> not belonging to an edge are discarded in the shader, so no writting to the
> stencil will occur in that case.
>
> - In the subsequent steps the stencil test discards every pixel not covered
> by the mask, hence only the edge pixels are processed (weights calculation
> and final blend).
>
> And this is how I tried to achieve it:
>
> - I created two osg::Stencils, one for creating the mask and other for
> using the mask and discarding everything else.
> - I attached the stencils to their corresponding osgPPU::Unit's.
>
> (now, I need to clear the stencil at the beginning of the postFX chain, but
> not between each pass)
> - I'm not sure about where glClear (with the clear mask of the camera the
> osgPPU::Processor is using) is called, but my guess is when rendering the
> scene to texture, not between units so I think that setting the clearMask in
> the camera is pointless.
> - I tried to call glClear(GL_STENCIL_BUFFER_BIT) in a notify callback set
> in the first unit of my chain.
>
>
> This has been driving me nuts for a couple of days now. It seems that the
> stencil buffer is not being written, or cleared prematurely between passes.
> And the stencil test only seems to be done if I enable it in the last unit's
> stateset.
>
> What am I missing?
>
>

- Have you create an opengl context with a stencil buffer ?
- Have you try to use osg:ClearNode to clear the stencil buffer ?
- Have you check opengl call order in a debugger like gDEBugger ?

no more ideas ... for now.





> I can post the code if you want!
>
> yes please, could be more simple to find the bug.

Cheers
David Callu

...
>
>
> Thank a lot in advance!
>
> Cheers,
> Miguel
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=39894#39894
>
>
>
>
>
> ___
> 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] [osgPPU] osgPPU and the stencil buffer

2011-05-28 Thread Miguel Angel Exposito
Hi,

I'm pretty new to osgPPU and I'm working on a port of Jimenez's MLAA full scene 
antialiasing algorithm.

It's a 3-pass post processing effect and I got it working on osgPPU.

- The first step detects the edges of the RTT'd scene and makes an 'edge 
texture'.
- The second step uses the previous texture and a precomputed one to calculate 
the area which pixels belonging to an edge would cover from an ideal trapeze.
- The final step blends each pixel in its 4-neighborhood according to the 
weights calculated in the previous step.

I got it fully working in osgPPU, however, an important optimization can be 
done by using the stencil buffer. The idea behind this is:

- Initially the stencil is cleared out to 0

- The first step of the post effect (edges detection) creates a stencil mask 
writing 1's to the stencil wherever there's an edge pixel. The pixels not 
belonging to an edge are discarded in the shader, so no writting to the stencil 
will occur in that case.

- In the subsequent steps the stencil test discards every pixel not covered by 
the mask, hence only the edge pixels are processed (weights calculation and 
final blend).

And this is how I tried to achieve it:

- I created two osg::Stencils, one for creating the mask and other for using 
the mask and discarding everything else.
- I attached the stencils to their corresponding osgPPU::Unit's.

(now, I need to clear the stencil at the beginning of the postFX chain, but not 
between each pass)
- I'm not sure about where glClear (with the clear mask of the camera the 
osgPPU::Processor is using) is called, but my guess is when rendering the scene 
to texture, not between units so I think that setting the clearMask in the 
camera is pointless.
- I tried to call glClear(GL_STENCIL_BUFFER_BIT) in a notify callback set in 
the first unit of my chain.


This has been driving me nuts for a couple of days now. It seems that the 
stencil buffer is not being written, or cleared prematurely between passes. And 
the stencil test only seems to be done if I enable it in the last unit's 
stateset.

What am I missing?

I can post the code if you want!

... 


Thank a lot in advance!

Cheers,
Miguel

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





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


Re: [osg-users] [osgPPU] osgPPU with CompositeViewer

2011-04-27 Thread Sami Moisio
Hi,

Nobody tried this?

I made the simplest possible test i could think of and just set one UnitOut to 
the processor so there would be no actual action from the processor other then 
relaying the image forward. I set the processor with the view camera of the 
first view and it works fine. When i set it up with the second view camera it 
results only in a black screen. The viewport size and position seem correct but 
something goes wrong and i'm running out of ideas what it could be. Any good 
ideas?


Thank you!

Cheers,
Sami

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





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


[osg-users] [osgPPU] osgPPU with CompositeViewer

2011-04-19 Thread Sami Moisio
Hi,

Has anyone been trying to use the osgPPU with CompositeViewer? I tried to run 
the same code i succesfully use with a regular viewer but it fails when i try 
to apply it to the second view. First view works fine but the second fails. 
Basically i'm just applying the processor to the view camera instead of the 
viewer camera. I would just like to know if someone has used it succesfully to 
make sure the problem is in my code :-)
I am using the 0.4.0 version of osgPPU. 

Thank you!

Cheers,
Sami

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





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


Re: [osg-users] osgPPU related questions

2011-03-21 Thread Riccardo Corsi
Hi all,

I've also experienced a delay issue when using osgPPU combined with Delta3D.

All the examples (like the glow) which requires 2 different paths and a
final unit combining them,
show an offset of at least one frame between the 2 rendering paths.

Delta3D should not interfere here, as it leaves all the rendering part to
osgViewer.
Any hint on the possible cause?

Thanks,
Ricky



On Mon, Mar 14, 2011 at 20:42, Sergey Polischuk  wrote:

> Ignore pbo part, didnt know it used for external processing, and i dont use
> it.
>
> 14.03.2011, 17:56, "Sergey Polischuk" :
> > Hi all,
> >
> > When i used osgppu i've experienced several frames delay (1 to 3 frames,
> not sure if this delay is persistent or it shows up from time to time,
> threading mode is singlethreaded) between content of input textures and
> units output, f.e. first several rendering frames can output some colored
> noise in the end of osgppu pipeline (and input textures are good atm) and
> then when picture comes out you get delay in rendering results in several
> frames (i mean comparing what you are supposed to get, and what actually
> comes out). What can cause this kind of problems? Can it be due to
> asynchronous transfers to pbo?
> >
> > 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
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgPPU related questions

2011-03-14 Thread Sergey Polischuk
Ignore pbo part, didnt know it used for external processing, and i dont use it.

14.03.2011, 17:56, "Sergey Polischuk" :
> Hi all,
>
> When i used osgppu i've experienced several frames delay (1 to 3 frames, not 
> sure if this delay is persistent or it shows up from time to time, threading 
> mode is singlethreaded) between content of input textures and units output, 
> f.e. first several rendering frames can output some colored noise in the end 
> of osgppu pipeline (and input textures are good atm) and then when picture 
> comes out you get delay in rendering results in several frames (i mean 
> comparing what you are supposed to get, and what actually comes out). What 
> can cause this kind of problems? Can it be due to asynchronous transfers to 
> pbo?
>
> 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


[osg-users] osgPPU related questions

2011-03-14 Thread Sergey Polischuk
Hi all,

When i used osgppu i've experienced several frames delay (1 to 3 frames, not 
sure if this delay is persistent or it shows up from time to time, threading 
mode is singlethreaded) between content of input textures and units output, 
f.e. first several rendering frames can output some colored noise in the end of 
osgppu pipeline (and input textures are good atm) and then when picture comes 
out you get delay in rendering results in several frames (i mean comparing what 
you are supposed to get, and what actually comes out). What can cause this kind 
of problems? Can it be due to asynchronous transfers to pbo?

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


Re: [osg-users] osgPPU HDR culled from certain angles?

2011-02-16 Thread Jean-Sébastien Guay

Hi Sergey,


I've had same issues using osgPPU, for me problem was happening only
when i had turned on near\far computation on viewer's camera, i've
used this mode only to test some stuff so i didnt investigated this
issue further. May be this will give you some hints on problem roots.


Hmmm, I saw that the osgPPU HDR example's setupCamera() method disables
near/far computation, but in our framework we turn it back on in almost
all cases. So this may be the problem. I'll look into this.

If this is the problem, I would like to avoid osgPPU forcing the main
camera's compute near/far mode off, since it is useful in many cases. It
should be possible to only turn it off when going through the cull phase
for the osgPPU quads, but then turning it back on the way it was
afterwards. Ideally, osgPPU would be as unintrusive as possible on the
app's normal operation...


I just tried, and this was indeed the problem.

So we need to make sure the OSGPPU quads are not culled by the near/far 
computation. I will look into this. Hopefully I can come up with a 
solution that is general enough to be integrated into osgPPU and will 
make it work correctly with all apps regardless of the compute near/far 
setting they use.


Thanks again,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgPPU HDR culled from certain angles?

2011-02-15 Thread Jean-Sébastien Guay

Hi Sergey,


I've had same issues using osgPPU, for me problem was happening only when i had 
turned on near\far computation on viewer's camera, i've used this mode only to 
test some stuff so i didnt investigated this issue further. May be this will 
give you some hints on problem roots.


Hmmm, I saw that the osgPPU HDR example's setupCamera() method disables 
near/far computation, but in our framework we turn it back on in almost 
all cases. So this may be the problem. I'll look into this.


If this is the problem, I would like to avoid osgPPU forcing the main 
camera's compute near/far mode off, since it is useful in many cases. It 
should be possible to only turn it off when going through the cull phase 
for the osgPPU quads, but then turning it back on the way it was 
afterwards. Ideally, osgPPU would be as unintrusive as possible on the 
app's normal operation...


Thanks for the hint,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgPPU HDR culled from certain angles?

2011-02-15 Thread Sergey Polischuk
Hi all.

I've had same issues using osgPPU, for me problem was happening only when i had 
turned on near\far computation on viewer's camera, i've used this mode only to 
test some stuff so i didnt investigated this issue further. May be this will 
give you some hints on problem roots.

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


Re: [osg-users] osgPPU HDR culled from certain angles?

2011-02-15 Thread Jean-Sébastien Guay

Hi Art,


You are right, from the osgPPU point of view the scene graph responsible for 
it, shouldn't be culled at all, so this couldn't be a problem.

It sounds strange. I would assume that maybe the camera does not provide frame 
updates anymore, when you move your view to this certain direction.


I'll be trying to reproduce the problem in an osgPPU example today. I'll 
let you know what results (if any) I get.


Another thing is that when I activate osgPPU, suddenly the mouse 
interaction with the window (i.e. click and drag to rotate the camera 
with a camera manipulator for example) becomes way too sensitive (a 
small drag rotates by a very large amount). I assume this might be 
because of different viewport sizes between the normal camera (which I 
used before) and the last osgPPU Unit. I'll be investigating this today too.


So in general, both problems seem to be related to integrating osgPPU at 
the end of an existing app's rendering. So not a problem of osgPPU 
itself, but just differences between behavior before and after the 
integration. I'll let you know what I find, it may be useful to document 
these things for future users.


Thanks,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgPPU HDR culled from certain angles?

2011-02-15 Thread Art Tevs
Hi J-S,

You are right, from the osgPPU point of view the scene graph responsible for 
it, shouldn't be culled at all, so this couldn't be a problem.

It sounds strange. I would assume that maybe the camera does not provide frame 
updates anymore, when you move your view to this certain direction.


Cheers,
Art

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





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


Re: [osg-users] osgPPU HDR culled from certain angles?

2011-02-09 Thread Jolley, Thomas P
Hi J-S,

It sounds like a problem with how the Z-buffer is cleared.  Are you clearing 
the Z-buffer by setting the depth test to always, setting the depth range to 
1.0, and drawing polygons?  If so, some OpenGl implementations will clip the 
polygons that are outside the frustum.  Some implementations will not clip the 
polygons.  Just make sure the polygons are always inside the frustum.


Tom Jolley
 

> -Original Message-
> From: osg-users-boun...@lists.openscenegraph.org 
> [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf 
> Of Jean-Sébastien Guay
> Sent: Tuesday, February 08, 2011 11:38 AM
> To: OpenSceneGraph Users
> Subject: [osg-users] osgPPU HDR culled from certain angles?
> 
> Hello all, hello Art :-)
> 

> 
> I have one weird problem though. When looking around in my 
> scene, at some camera angles the image stops updating and 
> seems to just alternate between the two last rendered frames 
> continuously. I still have control though, and if I rotate 
> the camera again at one point it starts updating like normal again.
> 
> When the camera is positioned at different places, it takes 
> different camera orientations for this to happen. But looking 
> up towards the sky
> (+Z) always makes it happen. So it kind of looks like 
> something is being culled in the scene graph which is causing 
> this. I can't figure out what though, since I've looked 
> through osgPPU's code and it looks to me that all the nodes 
> (Units, Processor, etc.) have culling disabled (using
> setCullingActive(false) ).
> 
> I can't reproduce this in the osgPPU HDR example itself, of 
> course. :-( So I'm not looking for a precise fix, but more 
> some hints as to what to look for. I dumped the scene and the 
> Processor to files, and can't see anything wrong - I've 
> attached the ppu file for reference, but it's really just the 
> one from the HDR example, minus the text PPUs.
> 
> Thanks in advance,
> 
> J-S
> --
> __
> Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
> http://www.cm-labs.com/
>  http://whitestar02.webhop.org/
> 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgPPU HDR culled from certain angles?

2011-02-08 Thread Jean-Sébastien Guay

Hello all, hello Art :-)

I have been experimenting with osgPPU's HDR example, and it looks and 
works great for my purposes, and was even easy to integrate into my own 
app as a test. It's interesting how easy the code is to understand, 
given what it would have been without osgPPU (i.e. using OSG and all the 
render targets that the effect would have required).


I have one weird problem though. When looking around in my scene, at 
some camera angles the image stops updating and seems to just alternate 
between the two last rendered frames continuously. I still have control 
though, and if I rotate the camera again at one point it starts updating 
like normal again.


When the camera is positioned at different places, it takes different 
camera orientations for this to happen. But looking up towards the sky 
(+Z) always makes it happen. So it kind of looks like something is being 
culled in the scene graph which is causing this. I can't figure out what 
though, since I've looked through osgPPU's code and it looks to me that 
all the nodes (Units, Processor, etc.) have culling disabled (using 
setCullingActive(false) ).


I can't reproduce this in the osgPPU HDR example itself, of course. :-( 
So I'm not looking for a precise fix, but more some hints as to what to 
look for. I dumped the scene and the Processor to files, and can't see 
anything wrong - I've attached the ppu file for reference, but it's 
really just the one from the HDR example, minus the text PPUs.


Thanks in advance,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
osgPPU::Processor {
  osgPPU::UnitBypass {
UniqueID UnitBypass_0
name "HDRBypass"
isActive 1
inputTextureIndexForViewportReference 0

PPUOutput {
  PPU UnitInResampleOut_1
  PPU UnitInOut_2
}

osgPPU::ColorAttribute {
  UniqueID ColorAttribute_3
  UpdateCallback {
  }
  startTime 0
  endTime 0
  startColor 1 1 1 1
  endColor 1 1 1 1
}
  }
  osgPPU::UnitInResampleOut {
UniqueID UnitInResampleOut_1
name "Resample"
isActive 1
inputTextureIndexForViewportReference 0

PPUOutput {
  PPU UnitInOut_4
  PPU UnitInOut_5
}

osgPPU::ColorAttribute {
  UniqueID ColorAttribute_6
  UpdateCallback {
  }
  startTime 0
  endTime 0
  startColor 1 1 1 1
  endColor 1 1 1 1
}
inputBypass -1
outputInternalFormat GL_RGBA16F_ARB
outputTextureType TEXTURE_2D
outputFace 0
outputDepth 1
factorX 0.25
factorY 0.25
  }
  osgPPU::UnitInOut {
UniqueID UnitInOut_4
name "ComputePixelLuminance"
isActive 1
inputTextureIndexForViewportReference 0

PPUOutput {
  PPU UnitInMipmapOut_7
}

osgPPU::ShaderAttribute {
  name "LuminanceShader"
  GeometryVerticesOut 1
  GeometryInputType TRIANGLES
  GeometryOutputType TRIANGLE_STRIP
  num_shaders 1
  Shader {
type FRAGMENT
code {
  "/*"
  " * Compute luminance values of the input texture."
  " * So result will contain only luminance values per pixel."
  " */"
  ""
  "// ---"
  "// Texture units used for texturing"
  "// ---"
  "uniform sampler2D texUnit0;"
  ""
  ""
  "/**"
  " **/"
  "void main(void)"
  "{"
  " // get color from the texture"
  "// JSG: Mult by 2.0 since our scene is normally rendered in LDR 
so it "
  "// didn't come out bright enough"
  " vec4 texColor0 = texture2D(texUnit0, gl_TexCoord[0].st) * 2.0;"
  ""
  " // compute luminance and output"
  " gl_FragColor.xyz = vec3( texColor0.r * 0.2125 + texColor0.g * 
0.7154 + texColor0.b * 0.0721 );"
  " gl_FragColor.a = texColor0.a;"
  "}"
}
  }
  maximalSupportedTextureUnits 8
  RefUniformPair {
Uniform {
  name "texUnit0"
  type sampler2D 1 IntArray 1
  {
0 
  }
}
StateAttribute ON
  }
}

osgPPU::ColorAttribute {
  UniqueID ColorAttribute_8
  UpdateCallback {
  }
  startTime 0
  endTime 0
  startColor 1 1 1 1
  endColor 1 1 1 1
}
inputBypass -1
outputInternalFormat GL_RGBA16F_ARB
outputTextureType TEXTURE_2D
outputFace 0
outputDepth 1
  }
  osgPPU::UnitInMipmapOut {
UniqueID UnitInMipmapOut_7
name "ComputeSceneLuminance"
isActive 1
inputTextureIndexForViewportReference 0

PPUOutput {
  PPU UnitInOut_5
  PPU UnitInOut_2
  PPU UnitInOut_9
}

osgPPU::ShaderAttribute {
  name "LuminanceShaderMip

Re: [osg-users] osgPPU CUDA Example - slower than expected?

2011-01-09 Thread Harash Sharma
Dear Mr. Art,

I too am noticing a problem similar to what Mr. Thorsten pointed out. Just 
curious about if the openGL and CUDA going together, I downloaded the osg2.9.10 
and osgCompute nodekit. I have CUDA 3.2 installed with on my machine Core2Duo 
with GEForce. The osgGeometryDemo sample code for warping with cow.osg is 
giving 
a reasonably high frame rate. I thought I should share this in case it is of 
any 
help.

Regards

Harash




From: J.P. Delport 
To: OpenSceneGraph Users 
Sent: Mon, January 3, 2011 3:30:34 PM
Subject: Re: [osg-users] osgPPU CUDA Example - slower than expected?

Hi,

I don't have any other suggestions than to use a GL debugger to make 
sure nothing is going to CPU or to try the new CUDA functions in osgPPU 
or your own code. I remember something in the GL to CUDA stuff bugging 
me, but cannot remember the details. AFAIR something was converting from 
texture to PBO and then to CUDA mem.

jp

On 16/12/10 13:25, Thorsten Roth wrote:
> Hi,
>
> as I explained in some other mail to this list, I am currently working
> on a graph based image processing framework using CUDA. Basically, this
> is independent from OSG, but I am using OSG for my example application :-)
>
> For my first implemented postprocessing algorithm I need color and depth
> data. As I want the depth to be linearized between 0 and 1, I used a
> shader for that and also I render it in a separate pass to the color.
> This stuff is then fetched from the GPU to the CPU by directly attaching
> osg::Images to the cameras. This works perfectly, but is quite a bit
> slow, as you might already have suspected, because the data is also
> processed in CUDA kernels later, which is quite a back and forth ;-)
>
> In fact, my application with three filter kernels based on CUDA (one
> gauss blur with radius 21, one image subtract and one image "pseudo-add"
> (about as elaborate as a simple add ;-)) yields about 15 fps with a
> resolution of 1024 x 1024 (images for normal and absolute position
> information are also rendered transferred from GPU to CPU here).
>
> So with these 15 frames, I thought it should perform FAR better when
> avoiding that GPU <-> CPU copying stuff. That's when I came across the
> osgPPU-cuda example. As far as I am aware, this uses direct mapping of
> PixelBuferObjects to cuda memory space. This should be fast! At least
> that's what I thought, but running it at a resolution of 1024 x 1024
> with a StatsHandler attached shows that it runs at just ~21 fps, not
> getting too much better when the cuda kernel execution is completely
> disabled.
>
> Now my question is: Is that a general (known) problem which cannot be
> avoided? Does it have anything to do with the memory mapping functions?
> How can it be optimized? I know that, while osgPPU uses older CUDA
> memory mapping functions, there are new ones as of CUDA 3. Is there a
> difference in performance?
>
> Any information on this is appreciated, because it will really help me
> to decide wether I should integrate buffer mapping or just keep the
> copying stuff going :-)
>
> Best Regards
> -Thorsten
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 

The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.

___
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] osgPPU CUDA Example - slower than expected?

2011-01-07 Thread Thorsten Roth
Thanks for the answers. Actually I also know that there are new 
interoperability features in CUDA 3, but I didn't have the time to check 
them out yet, though if I find the time for it, I will let you know 
about the results :)


Regards
-Thorsten

Am 07.01.2011 22:23, schrieb Jason Daly:

On 01/07/2011 03:34 PM, Art Tevs wrote:

Hi Thorsten,

the problem which you experience is because of lacking direct memory
mapping between OpenGL and CUDA memory. Even if CUDA (at least it was
in version 2 so) supports GPU<->GPU memory mapping, whenever you
access to OpenGL textures there is a full memory copy performed.

I am not aware if this was solved in CUDA3, maybe you should check it
out. CUDA2 definitively doesn't perform direct mapping between GL
textures and CUDA textures/arrays.

regards,
art


I know that OpenCL 1.1 added a bunch of OpenGL interoperability features
(clCreateFromGLBuffer(), clCreateFromGLTexture2D(), etc.), and I thought
I heard that the newer versions of CUDA supported similar features.
OpenGL 4.1 added some CL interop features, too.

--"J"

___
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] osgPPU CUDA Example - slower than expected?

2011-01-07 Thread Jason Daly

On 01/07/2011 03:34 PM, Art Tevs wrote:

Hi Thorsten,

the problem which you experience is because of lacking direct memory mapping between 
OpenGL and CUDA memory. Even if CUDA (at least it was in version 2 so) supports 
GPU<->GPU memory mapping, whenever you access to OpenGL textures there is a 
full memory copy performed.

I am not aware if this was solved in CUDA3, maybe you should check it out. 
CUDA2 definitively doesn't perform direct mapping between GL textures and CUDA 
textures/arrays.

regards,
art


I know that OpenCL 1.1 added a bunch of OpenGL interoperability features 
(clCreateFromGLBuffer(), clCreateFromGLTexture2D(), etc.), and I thought 
I heard that the newer versions of CUDA supported similar features.  
OpenGL 4.1 added some CL interop features, too.


--"J"

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


Re: [osg-users] osgPPU CUDA Example - slower than expected?

2011-01-07 Thread Art Tevs
Hi Thorsten,

the problem which you experience is because of lacking direct memory mapping 
between OpenGL and CUDA memory. Even if CUDA (at least it was in version 2 so) 
supports GPU<->GPU memory mapping, whenever you access to OpenGL textures there 
is a full memory copy performed.

I am not aware if this was solved in CUDA3, maybe you should check it out. 
CUDA2 definitively doesn't perform direct mapping between GL textures and CUDA 
textures/arrays.

regards,
art



Thorsten Roth wrote:
> Hi,
> 
> as I explained in some other mail to this list, I am currently working 
> on a graph based image processing framework using CUDA. Basically, this 
> is independent from OSG, but I am using OSG for my example application :-)
> 
> For my first implemented postprocessing algorithm I need color and depth 
> data. As I want the depth to be linearized between 0 and 1, I used a 
> shader for that and also I render it in a separate pass to the color. 
> This stuff is then fetched from the GPU to the CPU by directly attaching 
> osg::Images to the cameras. This works perfectly, but is quite a bit 
> slow, as you might already have suspected, because the data is also 
> processed in CUDA kernels later, which is quite a back and forth ;-)
> 
> In fact, my application with three filter kernels based on CUDA (one 
> gauss blur with radius 21, one image subtract and one image "pseudo-add" 
> (about as elaborate as a simple add ;-)) yields about 15 fps with a 
> resolution of 1024 x 1024 (images for normal and absolute position 
> information are also rendered transferred from GPU to CPU here).
> 
> So with these 15 frames, I thought it should perform FAR better when 
> avoiding that GPU <-> CPU copying stuff. That's when I came across the 
> osgPPU-cuda example. As far as I am aware, this uses direct mapping of 
> PixelBuferObjects to cuda memory space. This should be fast! At least 
> that's what I thought, but running it at a resolution of 1024 x 1024 
> with a StatsHandler attached shows that it runs at just ~21 fps, not 
> getting too much better when the cuda kernel execution is completely 
> disabled.
> 
> Now my question is: Is that a general (known) problem which cannot be 
> avoided? Does it have anything to do with the memory mapping functions? 
> How can it be optimized? I know that, while osgPPU uses older CUDA 
> memory mapping functions, there are new ones as of CUDA 3. Is there a 
> difference in performance?
> 
> Any information on this is appreciated, because it will really help me 
> to decide wether I should integrate buffer mapping or just keep the 
> copying stuff going :-)
> 
> Best Regards
> -Thorsten
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





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


Re: [osg-users] osgPPU CUDA Example - slower than expected?

2011-01-03 Thread J.P. Delport

Hi,

I don't have any other suggestions than to use a GL debugger to make 
sure nothing is going to CPU or to try the new CUDA functions in osgPPU 
or your own code. I remember something in the GL to CUDA stuff bugging 
me, but cannot remember the details. AFAIR something was converting from 
texture to PBO and then to CUDA mem.


jp

On 16/12/10 13:25, Thorsten Roth wrote:

Hi,

as I explained in some other mail to this list, I am currently working
on a graph based image processing framework using CUDA. Basically, this
is independent from OSG, but I am using OSG for my example application :-)

For my first implemented postprocessing algorithm I need color and depth
data. As I want the depth to be linearized between 0 and 1, I used a
shader for that and also I render it in a separate pass to the color.
This stuff is then fetched from the GPU to the CPU by directly attaching
osg::Images to the cameras. This works perfectly, but is quite a bit
slow, as you might already have suspected, because the data is also
processed in CUDA kernels later, which is quite a back and forth ;-)

In fact, my application with three filter kernels based on CUDA (one
gauss blur with radius 21, one image subtract and one image "pseudo-add"
(about as elaborate as a simple add ;-)) yields about 15 fps with a
resolution of 1024 x 1024 (images for normal and absolute position
information are also rendered transferred from GPU to CPU here).

So with these 15 frames, I thought it should perform FAR better when
avoiding that GPU <-> CPU copying stuff. That's when I came across the
osgPPU-cuda example. As far as I am aware, this uses direct mapping of
PixelBuferObjects to cuda memory space. This should be fast! At least
that's what I thought, but running it at a resolution of 1024 x 1024
with a StatsHandler attached shows that it runs at just ~21 fps, not
getting too much better when the cuda kernel execution is completely
disabled.

Now my question is: Is that a general (known) problem which cannot be
avoided? Does it have anything to do with the memory mapping functions?
How can it be optimized? I know that, while osgPPU uses older CUDA
memory mapping functions, there are new ones as of CUDA 3. Is there a
difference in performance?

Any information on this is appreciated, because it will really help me
to decide wether I should integrate buffer mapping or just keep the
copying stuff going :-)

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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] osgPPU CUDA Example - slower than expected?

2010-12-16 Thread Thorsten Roth
Ok..I correct this: There is a difference of ~1 frame ;) ...now I will 
stop replying to my own messages :D


Am 16.12.2010 12:31, schrieb Thorsten Roth:

By the way: There are two CUDA-capable devices in the computer, but I
have tried using the rendering device as well as the "CUDA-only" device
-> no difference!

-Thorsten

Am 16.12.2010 12:25, schrieb Thorsten Roth:

Hi,

as I explained in some other mail to this list, I am currently working
on a graph based image processing framework using CUDA. Basically, this
is independent from OSG, but I am using OSG for my example application
:-)

For my first implemented postprocessing algorithm I need color and depth
data. As I want the depth to be linearized between 0 and 1, I used a
shader for that and also I render it in a separate pass to the color.
This stuff is then fetched from the GPU to the CPU by directly attaching
osg::Images to the cameras. This works perfectly, but is quite a bit
slow, as you might already have suspected, because the data is also
processed in CUDA kernels later, which is quite a back and forth ;-)

In fact, my application with three filter kernels based on CUDA (one
gauss blur with radius 21, one image subtract and one image "pseudo-add"
(about as elaborate as a simple add ;-)) yields about 15 fps with a
resolution of 1024 x 1024 (images for normal and absolute position
information are also rendered transferred from GPU to CPU here).

So with these 15 frames, I thought it should perform FAR better when
avoiding that GPU <-> CPU copying stuff. That's when I came across the
osgPPU-cuda example. As far as I am aware, this uses direct mapping of
PixelBuferObjects to cuda memory space. This should be fast! At least
that's what I thought, but running it at a resolution of 1024 x 1024
with a StatsHandler attached shows that it runs at just ~21 fps, not
getting too much better when the cuda kernel execution is completely
disabled.

Now my question is: Is that a general (known) problem which cannot be
avoided? Does it have anything to do with the memory mapping functions?
How can it be optimized? I know that, while osgPPU uses older CUDA
memory mapping functions, there are new ones as of CUDA 3. Is there a
difference in performance?

Any information on this is appreciated, because it will really help me
to decide wether I should integrate buffer mapping or just keep the
copying stuff going :-)

Best Regards
-Thorsten
___
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] osgPPU CUDA Example - slower than expected?

2010-12-16 Thread Thorsten Roth
By the way: There are two CUDA-capable devices in the computer, but I 
have tried using the rendering device as well as the "CUDA-only" device 
-> no difference!


-Thorsten

Am 16.12.2010 12:25, schrieb Thorsten Roth:

Hi,

as I explained in some other mail to this list, I am currently working
on a graph based image processing framework using CUDA. Basically, this
is independent from OSG, but I am using OSG for my example application :-)

For my first implemented postprocessing algorithm I need color and depth
data. As I want the depth to be linearized between 0 and 1, I used a
shader for that and also I render it in a separate pass to the color.
This stuff is then fetched from the GPU to the CPU by directly attaching
osg::Images to the cameras. This works perfectly, but is quite a bit
slow, as you might already have suspected, because the data is also
processed in CUDA kernels later, which is quite a back and forth ;-)

In fact, my application with three filter kernels based on CUDA (one
gauss blur with radius 21, one image subtract and one image "pseudo-add"
(about as elaborate as a simple add ;-)) yields about 15 fps with a
resolution of 1024 x 1024 (images for normal and absolute position
information are also rendered transferred from GPU to CPU here).

So with these 15 frames, I thought it should perform FAR better when
avoiding that GPU <-> CPU copying stuff. That's when I came across the
osgPPU-cuda example. As far as I am aware, this uses direct mapping of
PixelBuferObjects to cuda memory space. This should be fast! At least
that's what I thought, but running it at a resolution of 1024 x 1024
with a StatsHandler attached shows that it runs at just ~21 fps, not
getting too much better when the cuda kernel execution is completely
disabled.

Now my question is: Is that a general (known) problem which cannot be
avoided? Does it have anything to do with the memory mapping functions?
How can it be optimized? I know that, while osgPPU uses older CUDA
memory mapping functions, there are new ones as of CUDA 3. Is there a
difference in performance?

Any information on this is appreciated, because it will really help me
to decide wether I should integrate buffer mapping or just keep the
copying stuff going :-)

Best Regards
-Thorsten
___
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] osgPPU CUDA Example - slower than expected?

2010-12-16 Thread Thorsten Roth

Hi,

as I explained in some other mail to this list, I am currently working 
on a graph based image processing framework using CUDA. Basically, this 
is independent from OSG, but I am using OSG for my example application :-)


For my first implemented postprocessing algorithm I need color and depth 
data. As I want the depth to be linearized between 0 and 1, I used a 
shader for that and also I render it in a separate pass to the color. 
This stuff is then fetched from the GPU to the CPU by directly attaching 
osg::Images to the cameras. This works perfectly, but is quite a bit 
slow, as you might already have suspected, because the data is also 
processed in CUDA kernels later, which is quite a back and forth ;-)


In fact, my application with three filter kernels based on CUDA (one 
gauss blur with radius 21, one image subtract and one image "pseudo-add" 
(about as elaborate as a simple add ;-)) yields about 15 fps with a 
resolution of 1024 x 1024 (images for normal and absolute position 
information are also rendered transferred from GPU to CPU here).


So with these 15 frames, I thought it should perform FAR better when 
avoiding that GPU <-> CPU copying stuff. That's when I came across the 
osgPPU-cuda example. As far as I am aware, this uses direct mapping of 
PixelBuferObjects to cuda memory space. This should be fast! At least 
that's what I thought, but running it at a resolution of 1024 x 1024 
with a StatsHandler attached shows that it runs at just ~21 fps, not 
getting too much better when the cuda kernel execution is completely 
disabled.


Now my question is: Is that a general (known) problem which cannot be 
avoided? Does it have anything to do with the memory mapping functions? 
How can it be optimized? I know that, while osgPPU uses older CUDA 
memory mapping functions, there are new ones as of CUDA 3. Is there a 
difference in performance?


Any information on this is appreciated, because it will really help me 
to decide wether I should integrate buffer mapping or just keep the 
copying stuff going :-)


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


  1   2   3   4   5   >