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 

Real time Strobing effect for on screen animation


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


Joined: 26 May 2017
Posts: 6

PostPosted: Thu Oct 19, 2017 1:12 pm    Post subject:
Real time Strobing effect for on screen animation
Reply with quote

Hi,
I am trying to achieve the strobing effect with OSG for an animation that I play on screen.
I have the animation of a moving human. I want to have all past frames displayed along with the current frame. This will show the motion path as the human moves on screen.
I tried to do a screen capture and superpose a buffer with the latest render buffer. I also take care that the background pixel are not superposed. Only the areas where the human animation is there those pixels are superposed.
This gives me a final static image with strobing effect. This image is overlayed on the window.

I want to see the strobing effect as the animation plays.
The attached picture shows what I am trying to achieve the screen will keep updating with the new motion frames.

Is there any way to achieve this. Any thought would very much appreciated.
...

Thank you!

Cheers,
Rakesh
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12321

PostPosted: Thu Oct 19, 2017 3:39 pm    Post subject:
Real time Strobing effect for on screen animation
Reply with quote

Hi Rakesh,


Is the figure something you animating and rendering in 3D? Or are you playing a video on a textured quad for the animation?


Robert.


On 19 October 2017 at 14:12, Rakesh Prasad < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,
I am trying to achieve the strobing effect with OSG for an animation that I play on screen.
I have the animation of a moving human. I want to have all past frames displayed along with the current frame. This will show the motion path as the human moves on screen.
I tried to do a screen capture and superpose a buffer with the latest render buffer. I also take care that the background pixel are not superposed. Only the areas where the human animation is there those pixels are superposed.
This gives me a final static image with strobing effect. This image is overlayed on the window.

I want to see the strobing effect as the animation plays.
The attached picture shows what I am trying to achieve the screen will keep updating with the new motion frames.

Is there any way to achieve this. Any thought would very much appreciated.
...

Thank you!

Cheers,
Rakesh

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




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



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


Joined: 26 May 2017
Posts: 6

PostPosted: Thu Oct 19, 2017 4:55 pm    Post subject:
Re: Real time Strobing effect for on screen animation
Reply with quote

Hi Robert,
The human model is comprised of independent 3DS max models of each body part like head, arms pelvis, thorax. The way animation is being done is by moving through code the position and orientation of these body parts. The background is fixed to RGB(80,80,80) .
Hope this clarifies.

I was hoping if there is a way to get the final render buffer (for read and write)for each frame just before it is displayed to the screen. I could create another buffer which will be a superposition of all past buffer. Only the model
part will be superposed since I know the background color RGB(80,80,80). I don't expect RGB(80,80,80) to occur in the model and animation render.
The new superposed buffer could be overwritten onto the final render buffer to be rendered to screen.

Thanks,
Rakesh

robertosfield wrote:
Hi Rakesh,


Is the figure something you animating and rendering in 3D? Or are you playing a video on a textured quad for the animation?


Robert.


On 19 October 2017 at 14:12, Rakesh Prasad < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,
I am trying to achieve the strobing effect with OSG for an animation that I play on screen.
I have the animation of a moving human. I want to have all past frames displayed along with the current frame. This will show the motion path as the human moves on screen.
I tried to do a screen capture and superpose a buffer with the latest render buffer. I also take care that the background pixel are not superposed. Only the areas where the human animation is there those pixels are superposed.
This gives me a final static image with strobing effect. This image is overlayed on the window.

I want to see the strobing effect as the animation plays.
The attached picture shows what I am trying to achieve the screen will keep updating with the new motion frames.

Is there any way to achieve this. Any thought would very much appreciated.
...

Thank you!

Cheers,
Rakesh

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




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



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


Joined: 18 Mar 2009
Posts: 12321

PostPosted: Thu Oct 19, 2017 5:20 pm    Post subject:
Real time Strobing effect for on screen animation
Reply with quote

Hi Rakesh,

On 19 October 2017 at 17:56, Rakesh Prasad < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Robert,
The human model is comprised of independent 3DS max models of each body part like head, arms pelvis, thorax. The way animation is being done is by moving through code the position and orientation of these body parts. The background is fixed to RGB(80,80,80) .
Hope this clarifies.


Yes, this information is what was missing form the original post message.  The solution depends entirely on the nature of what you are doing so need this clarification.

 
Quote:
I was hoping if there is a way to get the final render buffer (for read and write)for each frame just before it is displayed to the screen. I could create another buffer which will be a superposition of all past buffer. Only the model
part will be superposed since I know the background color RGB(80,80,80). I don't expect RGB(80,80,80) to occur in the model and animation render.
The new superposed buffer could be overwritten onto the final render buffer to be rendered to screen.-----------


In OpenGL and OSG you can either use a accumulation buffer or render to texture.  The osgmotionblur example illustrates how to do motion blur use a GL accumulation buffer, not all hardware&drivers support this though.  The render to texture approach is similar to the accumulation buffer approach but implements the functionality use render to texture.  The osgprerender and osgdistortion examples illustrate how to render to texture, with modern graphics cards this would be the way I'd suggest doing it.


To do render to texture you'll need to render the 3D model into a texture by using an osg::Camera with a Texture assigned as the colour buffer to provide the Render to Texture (RTT) , with the subgraph of the Camera being the 3D model you want to render to it. You can accumulate successive frames into this texture by disabling the clear of the RTT Camera using the Camera::setClearMaks(0x0). 



You then just render this texture to the whole screen as per the osgdistortion example.



There are variations on this approach, but the above approach should be simple enough.


Robert.



 

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


Joined: 26 May 2017
Posts: 6

PostPosted: Thu Oct 19, 2017 5:47 pm    Post subject:
Re: Real time Strobing effect for on screen animation
Reply with quote

Hi Robert,
I did go through the osgmotionblurr example. But I guess I need to look at the problem from the render to texture view point. I looked at it from blur point of view and was trying to figure out a way to selectively read and write pixels in the GL accumulator.
Will go in detail through the osgprerender and osgdistortion.
Thanks for referring to these relevant examples and the steps for render to texture.
Will revert back with my findings and test results.
Regards,
Rakesh

robertosfield wrote:
Hi Rakesh,

On 19 October 2017 at 17:56, Rakesh Prasad < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi Robert,
The human model is comprised of independent 3DS max models of each body part like head, arms pelvis, thorax. The way animation is being done is by moving through code the position and orientation of these body parts. The background is fixed to RGB(80,80,80) .
Hope this clarifies.


Yes, this information is what was missing form the original post message.  The solution depends entirely on the nature of what you are doing so need this clarification.

 
Quote:
I was hoping if there is a way to get the final render buffer (for read and write)for each frame just before it is displayed to the screen. I could create another buffer which will be a superposition of all past buffer. Only the model
part will be superposed since I know the background color RGB(80,80,80). I don't expect RGB(80,80,80) to occur in the model and animation render.
The new superposed buffer could be overwritten onto the final render buffer to be rendered to screen.-----------


In OpenGL and OSG you can either use a accumulation buffer or render to texture.  The osgmotionblur example illustrates how to do motion blur use a GL accumulation buffer, not all hardware&drivers support this though.  The render to texture approach is similar to the accumulation buffer approach but implements the functionality use render to texture.  The osgprerender and osgdistortion examples illustrate how to render to texture, with modern graphics cards this would be the way I'd suggest doing it.


To do render to texture you'll need to render the 3D model into a texture by using an osg::Camera with a Texture assigned as the colour buffer to provide the Render to Texture (RTT) , with the subgraph of the Camera being the 3D model you want to render to it. You can accumulate successive frames into this texture by disabling the clear of the RTT Camera using the Camera::setClearMaks(0x0). 



You then just render this texture to the whole screen as per the osgdistortion example.



There are variations on this approach, but the above approach should be simple enough.


Robert.



 

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

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

Similar Topics
Topic Author Forum Replies Posted
No new posts How to reset osgAnimation (put the an... GiacomoB General 1 Fri Jul 26, 2019 12:11 pm View latest post
No new posts long waiting time between cull and draw tomas259 General 3 Wed Jul 03, 2019 7:47 pm View latest post
No new posts off screen rendering with OSG Sorin General 0 Mon May 13, 2019 8:14 am View latest post
No new posts getting the world coordinate by scree... snowlove General 0 Tue Jan 08, 2019 1:58 am View latest post
No new posts Get Animation current time dhhabyc General 9 Thu Dec 27, 2018 5:54 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