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

FBO RTT -> CUDA Kernel -> FBO RTT Setup


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgCompute [osgCompute]
View previous topic :: View next topic  
Author Message
sholmes
User


Joined: 05 Sep 2011
Posts: 62

PostPosted: Wed Oct 05, 2011 8:23 pm    Post subject:
FBO RTT -> CUDA Kernel -> FBO RTT Setup
Reply with quote

Hi,

My schedule lightened up a bit... I have an extra 24 hours to work on my osg/cuda problem, so I would like to incorporate CUDA into osg the "correct" way, which I think may be osgCUDA.

Here's what I am currently doing

Step 1 App renders scene to a FLOAT texture via a FBO/RTT camera
Step 2 This texture is used as input to a shader on a second pass/RTT camera. The shader does some calibration stuff then renders it to a full screen quad.
Step 3 Final render pass renders quad from step 2.

Here's what I NEED to do...

Step 1.5 Pass texture from Step 1 to a cuda kernel for processing before the calibration pass (Step 2)

Questions:

1. Is this something I can use osgCUDA to do?
2. Would it be similar to the osgTexDemo?
3. Can I use an FBO, or do I have to switch to a PBO RTT?

CUDA 4.0 is not necessary but would be cool as I have to use it eventually, but to get past this proof of principal step I can use 3.2... or 2.3...

CD

Thank you!

Cheers,
Conan
Back to top
View user's profile Send private message
J.P. Delport
Guest





PostPosted: Thu Oct 06, 2011 7:03 am    Post subject:
FBO RTT -> CUDA Kernel -> FBO RTT Setup
Reply with quote

Hi,

On 05/10/2011 22:23, Conan Doyle wrote:
Quote:
Hi,

My schedule lightened up a bit... I have an extra 24 hours to work on
my osg/cuda problem, so I would like to incorporate CUDA into osg the
"correct" way, which I think may be osgCUDA.

Here's what I am currently doing

Step 1 App renders scene to a FLOAT texture via a FBO/RTT camera Step
2 This texture is used as input to a shader on a second pass/RTT
camera. The shader does some calibration stuff then renders it to a
full screen quad. Step 3 Final render pass renders quad from step 2.

Here's what I NEED to do...

Step 1.5 Pass texture from Step 1 to a cuda kernel for processing
before the calibration pass (Step 2)

Questions:

1. Is this something I can use osgCUDA to do? 2. Would it be
similar to the osgTexDemo? 3. Can I use an FBO, or do I have to
switch to a PBO RTT?

1. Absolutely
2. Not sure, but I will forward you an example from the osgCuda devs
too. I can also point you to one of our examples that does something
similar.
See the code here:
http://code.google.com/p/flitr/source/browse/#svn%2Ftrunk%2Fexamples%2Fcuda_auto_contrast
In the above example all you have to change is to place shader passes
before or after the cuda pass. E.g. take the glsl_shader example and
just change the texture types to osgCuda::TextureRectangle.

3. FBO is OK.

Quote:

CUDA 4.0 is not necessary but would be cool as I have to use it
eventually, but to get past this proof of principal step I can use
3.2... or 2.3...

CUDA 4.0 works fine and then you can play with Thrust too :)

cheers
jp

Quote:

CD

Thank you!

Cheers, Conan

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





_______________________________________________ osg-users mailing
list
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.



------------------
Post generated by Mail2Forum
Back to top
J.P. Delport
Guest





PostPosted: Thu Oct 06, 2011 7:18 am    Post subject:
FBO RTT -> CUDA Kernel -> FBO RTT Setup
Reply with quote

Hi,

On 06/10/2011 09:06, J.P. Delport wrote:

Quote:
Quote:
Questions:

1. Is this something I can use osgCUDA to do? 2. Would it be
similar to the osgTexDemo? 3. Can I use an FBO, or do I have to
switch to a PBO RTT?

1. Absolutely
2. Not sure, but I will forward you an example from the osgCuda devs
too. I can also point you to one of our examples that does something
similar.

just for future reference, the thread where the app is mentioned is here:
http://forum.openscenegraph.org/viewtopic.php?p=36373#36373

jp


--
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.



------------------
Post generated by Mail2Forum
Back to top
Mick
User


Joined: 11 Mar 2009
Posts: 31

PostPosted: Thu Oct 06, 2011 7:43 am    Post subject:
Reply with quote

Good morning!

Thanks JP for providing help.

Conan, osgCompute/osgCuda fits to your needs exactly. The links JP posted should give you a good starting point.

Best regards,
Mick

_________________
SVT Group
Back to top
View user's profile Send private message
sholmes
User


Joined: 05 Sep 2011
Posts: 62

PostPosted: Thu Oct 06, 2011 3:27 pm    Post subject:
Reply with quote

Hi,

SCORE! Thanks guys.

Thank you!

Cheers,
Conan
Back to top
View user's profile Send private message
sholmes
User


Joined: 05 Sep 2011
Posts: 62

PostPosted: Fri Oct 07, 2011 3:32 pm    Post subject:
Re: FBO RTT -> CUDA Kernel -> FBO RTT Setup
Reply with quote

Sorry for the seemingly off topic post here, but I am having troubles building flitr, of which the cuda_auto_contrast example is a part.

This is what I am doing

cd flitr
mkdir build
cd build
ccmake ../
[hit 'c', make mods if necessary, hit 'g' ]
make

The first time through this process, there was a problem locating AVPATH, or something like that, so I determined I needed to install FFMPEG, which I did. The second time through, I am getting error messages regarding boost/tr1, which isn't on my machine, but boost is, so apparently not all of boost is... so I will 'cut to the chase' and ask... How do I build this thing called flitr? What are the 3rd party dependencies? I noticed in the cmake file there is a pointer to 3rd party root dir...

CD




J.P. Delport wrote:
Hi,

On 05/10/2011 22:23, Conan Doyle wrote:
Quote:
Hi,

My schedule lightened up a bit... I have an extra 24 hours to work on
my osg/cuda problem, so I would like to incorporate CUDA into osg the
"correct" way, which I think may be osgCUDA.

Here's what I am currently doing

Step 1 App renders scene to a FLOAT texture via a FBO/RTT camera Step
2 This texture is used as input to a shader on a second pass/RTT
camera. The shader does some calibration stuff then renders it to a
full screen quad. Step 3 Final render pass renders quad from step 2.

Here's what I NEED to do...

Step 1.5 Pass texture from Step 1 to a cuda kernel for processing
before the calibration pass (Step 2)

Questions:

1. Is this something I can use osgCUDA to do? 2. Would it be
similar to the osgTexDemo? 3. Can I use an FBO, or do I have to
switch to a PBO RTT?

1. Absolutely
2. Not sure, but I will forward you an example from the osgCuda devs
too. I can also point you to one of our examples that does something
similar.
See the code here:
http://code.google.com/p/flitr/source/browse/#svn%2Ftrunk%2Fexamples%2Fcuda_auto_contrast
In the above example all you have to change is to place shader passes
before or after the cuda pass. E.g. take the glsl_shader example and
just change the texture types to osgCuda::TextureRectangle.

3. FBO is OK.

Quote:

CUDA 4.0 is not necessary but would be cool as I have to use it
eventually, but to get past this proof of principal step I can use
3.2... or 2.3...

CUDA 4.0 works fine and then you can play with Thrust too Smile

cheers
jp

Quote:

CD

Thank you!

Cheers, Conan

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





_______________________________________________ osg-users mailing
list
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.



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
J.P. Delport
Guest





PostPosted: Mon Oct 10, 2011 6:53 am    Post subject:
FBO RTT -> CUDA Kernel -> FBO RTT Setup
Reply with quote

Hi,

On 07/10/2011 17:32, Conan Doyle wrote:
Quote:
I went to the link for the cuda_auto_contrast example... looks like
it is part of flitr(?)... do I have to build all of flitr to build
this cuda example?

you only have to build it if you want a running example. Alternatively
you can just study the code to see how an FBO texture is passed into
osgCuda.

jp

Quote:

CD




J.P. Delport wrote:
Quote:
Hi,

On 05/10/2011 22:23, Conan Doyle wrote:

Quote:
Hi,

My schedule lightened up a bit... I have an extra 24 hours to
work on my osg/cuda problem, so I would like to incorporate CUDA
into osg the "correct" way, which I think may be osgCUDA.

Here's what I am currently doing

Step 1 App renders scene to a FLOAT texture via a FBO/RTT camera
Step 2 This texture is used as input to a shader on a second
pass/RTT camera. The shader does some calibration stuff then
renders it to a full screen quad. Step 3 Final render pass
renders quad from step 2.

Here's what I NEED to do...

Step 1.5 Pass texture from Step 1 to a cuda kernel for
processing before the calibration pass (Step 2)

Questions:

1. Is this something I can use osgCUDA to do? 2. Would it be
similar to the osgTexDemo? 3. Can I use an FBO, or do I have to
switch to a PBO RTT?


1. Absolutely 2. Not sure, but I will forward you an example from
the osgCuda devs too. I can also point you to one of our examples
that does something similar. See the code here:
http://code.google.com/p/flitr/source/browse/#svn%2Ftrunk%2Fexamples%2Fcuda_auto_contrast


In the above example all you have to change is to place shader passes
Quote:
Quote:
before or after the cuda pass. E.g. take the glsl_shader example
and just change the texture types to osgCuda::TextureRectangle.

3. FBO is OK.


Quote:

CUDA 4.0 is not necessary but would be cool as I have to use it
eventually, but to get past this proof of principal step I can
use 3.2... or 2.3...


CUDA 4.0 works fine and then you can play with Thrust too :)

cheers jp


Quote:

CD

Thank you!

Cheers, Conan

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





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




--
Quote:
Quote:
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.

_______________________________________________ osg-users mailing
list

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Quote:
Quote:
Post generated by Mail2Forum


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





_______________________________________________ osg-users mailing
list
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.



------------------
Post generated by Mail2Forum
Back to top
sholmes
User


Joined: 05 Sep 2011
Posts: 62

PostPosted: Mon Oct 10, 2011 2:19 pm    Post subject:
Re: FBO RTT -> CUDA Kernel -> FBO RTT Setup
Reply with quote

I finally got everything built and running... one more question... What type of video format does the cuda_auto_contrast example takes as input. I had an avi (not sure of any specfics) on my machine and the example read it and display it (as far as I could tell) but it was scrolling in a funky way other wierness...

CD


J.P. Delport wrote:
Hi,

On 07/10/2011 17:32, Conan Doyle wrote:
Quote:
I went to the link for the cuda_auto_contrast example... looks like
it is part of flitr(?)... do I have to build all of flitr to build
this cuda example?

you only have to build it if you want a running example. Alternatively
you can just study the code to see how an FBO texture is passed into
osgCuda.

jp

Quote:

CD




J.P. Delport wrote:
Quote:
Hi,

On 05/10/2011 22:23, Conan Doyle wrote:

Quote:
Hi,

My schedule lightened up a bit... I have an extra 24 hours to
work on my osg/cuda problem, so I would like to incorporate CUDA
into osg the "correct" way, which I think may be osgCUDA.

Here's what I am currently doing

Step 1 App renders scene to a FLOAT texture via a FBO/RTT camera
Step 2 This texture is used as input to a shader on a second
pass/RTT camera. The shader does some calibration stuff then
renders it to a full screen quad. Step 3 Final render pass
renders quad from step 2.

Here's what I NEED to do...

Step 1.5 Pass texture from Step 1 to a cuda kernel for
processing before the calibration pass (Step 2)

Questions:

1. Is this something I can use osgCUDA to do? 2. Would it be
similar to the osgTexDemo? 3. Can I use an FBO, or do I have to
switch to a PBO RTT?


1. Absolutely 2. Not sure, but I will forward you an example from
the osgCuda devs too. I can also point you to one of our examples
that does something similar. See the code here:
http://code.google.com/p/flitr/source/browse/#svn%2Ftrunk%2Fexamples%2Fcuda_auto_contrast


In the above example all you have to change is to place shader passes
Quote:
Quote:
before or after the cuda pass. E.g. take the glsl_shader example
and just change the texture types to osgCuda::TextureRectangle.

3. FBO is OK.


Quote:

CUDA 4.0 is not necessary but would be cool as I have to use it
eventually, but to get past this proof of principal step I can
use 3.2... or 2.3...


CUDA 4.0 works fine and then you can play with Thrust too Smile

cheers jp


Quote:

CD

Thank you!

Cheers, Conan

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





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




--
Quote:
Quote:
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.

_______________________________________________ osg-users mailing
list

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Quote:
Quote:
Post generated by Mail2Forum


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





_______________________________________________ osg-users mailing
list
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.



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
J.P. Delport
Guest





PostPosted: Mon Oct 10, 2011 2:42 pm    Post subject:
FBO RTT -> CUDA Kernel -> FBO RTT Setup
Reply with quote

Hi Conan,

be sure to update to the latest revision of flitr and osgCuda. There has
been some fixes (very recent) for the proper handling of cudaMallocPitch
allocated arrays.

The example should be able to read any movie file that FFmpeg can
consume. It would even consume single .jpg/.png image files too. The
example will convert any input to grayscale.

If you still get weird tearing, try making a 1024x1024 image and see
what that does.

HTH
jp


On 10/10/2011 16:19, Conan Doyle wrote:
Quote:
I finally got everything built and running... one more question...
What type of video format does the cuda_auto_contrast example takes
as input. I had an avi (not sure of any specfics) on my machine and
the example read it and display it (as far as I could tell) but it
was scrolling in a funky way other wierness...

CD



J.P. Delport wrote:
Quote:
Hi,

On 07/10/2011 17:32, Conan Doyle wrote:

Quote:
I went to the link for the cuda_auto_contrast example... looks
like it is part of flitr(?)... do I have to build all of flitr to
build this cuda example?


you only have to build it if you want a running example.
Alternatively you can just study the code to see how an FBO texture
is passed into osgCuda.

jp


Quote:

CD




J.P. Delport wrote:

Quote:
Hi,

On 05/10/2011 22:23, Conan Doyle wrote:


Quote:
Hi,

My schedule lightened up a bit... I have an extra 24 hours
to work on my osg/cuda problem, so I would like to
incorporate CUDA into osg the "correct" way, which I think
may be osgCUDA.

Here's what I am currently doing

Step 1 App renders scene to a FLOAT texture via a FBO/RTT
camera Step 2 This texture is used as input to a shader on a
second pass/RTT camera. The shader does some calibration
stuff then renders it to a full screen quad. Step 3 Final
render pass renders quad from step 2.

Here's what I NEED to do...

Step 1.5 Pass texture from Step 1 to a cuda kernel for
processing before the calibration pass (Step 2)

Questions:

1. Is this something I can use osgCUDA to do? 2. Would it
be similar to the osgTexDemo? 3. Can I use an FBO, or do I
have to switch to a PBO RTT?



1. Absolutely 2. Not sure, but I will forward you an example
from the osgCuda devs too. I can also point you to one of our
examples that does something similar. See the code here:
http://code.google.com/p/flitr/source/browse/#svn%2Ftrunk%2Fexamples%2Fcuda_auto_contrast





In the above example all you have to change is to place shader passes
Quote:
Quote:

Quote:

Quote:
before or after the cuda pass. E.g. take the glsl_shader
example and just change the texture types to
osgCuda::TextureRectangle.

3. FBO is OK.



Quote:

CUDA 4.0 is not necessary but would be cool as I have to use
it eventually, but to get past this proof of principal step I
can use 3.2... or 2.3...



CUDA 4.0 works fine and then you can play with Thrust too :)

cheers jp



Quote:

CD

Thank you!

Cheers, Conan

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





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








--
Quote:
Quote:

Quote:

Quote:
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.

_______________________________________________ osg-users
mailing list

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






------------------
Quote:
Quote:

Quote:

Quote:
Post generated by Mail2Forum



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





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




--
Quote:
Quote:
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.

_______________________________________________ osg-users mailing
list

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Quote:
Quote:
Post generated by Mail2Forum


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





_______________________________________________ osg-users mailing
list
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.



------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgCompute [osgCompute] All times are GMT
Page 1 of 1

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

Similar Topics
Topic Author Forum Replies Posted
No new posts OSG_GL_ setup typo and filnet Submission 0 Wed Jun 22, 2016 7:01 am View latest post
No new posts Pass an osg::Texture2D to CUDA driver... mille25 General 6 Wed Jun 15, 2016 12:37 pm View latest post
No new posts How to setup multi channel Dan Liu General 5 Wed Jan 13, 2016 3:55 am View latest post
No new posts Open Scene Graph 3.4.0 has bug when u... Twiddeldidu General 21 Tue Sep 01, 2015 7:59 am View latest post
No new posts osgEarth SkyNode code setup Carlos Sanches General 2 Tue Oct 21, 2014 12:50 pm View latest post


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