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 

Render lower Resolution with unitOut than wandow / fullscreen


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


Joined: 14 Oct 2009
Posts: 60

PostPosted: Mon Jun 06, 2011 7:54 pm    Post subject:
Render lower Resolution with unitOut than wandow / fullscreen
Reply with quote

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
Back to top
View user's profile Send private message
art (Art Tevs)
Site Admin


Joined: 20 Dec 2008
Posts: 414
Location: Saarbr├╝cken, Germany

PostPosted: Mon Jun 06, 2011 8:11 pm    Post subject:
Re: Render lower Resolution with unitOut than wandow / fullscreen
Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
ParticlePeter
User


Joined: 14 Oct 2009
Posts: 60

PostPosted: Tue Jun 07, 2011 7:40 am    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Riccardo Corsi
Guest





PostPosted: Tue Jun 07, 2011 8:51 am    Post subject:
Render lower Resolution with unitOut than wandow / fullscreen
Reply with quote

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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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
(
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
art (Art Tevs)
Site Admin


Joined: 20 Dec 2008
Posts: 414
Location: Saarbr├╝cken, Germany

PostPosted: Tue Jun 07, 2011 11:07 am    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
ParticlePeter
User


Joined: 14 Oct 2009
Posts: 60

PostPosted: Wed Jun 08, 2011 1:58 pm    Post subject:
Reply with quote

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 Smile
But still a good Debugging Hint, didn't know that till now.

Cheers, PP
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgPPU [osgPPU] 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 Render to texture with GL3. Raizel General 3 Tue May 23, 2017 10:33 am View latest post
No new posts Multiple render passes and multithrea... SMesserschmidt General 2 Wed May 03, 2017 3:53 pm View latest post
No new posts Recommended way to render a scene fro... Hannes Naude General 6 Tue Apr 11, 2017 11:12 am View latest post
No new posts How do cameras handle the render target? wernerM General 3 Wed Mar 15, 2017 9:59 am View latest post
No new posts Offline screen render without pbuffer... tnassour General 0 Wed Feb 15, 2017 7:29 am 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