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 

get output texture from unitInOut


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


Joined: 22 Oct 2009
Posts: 4

PostPosted: Tue Apr 20, 2010 6:06 pm    Post subject:
get output texture from unitInOut
Reply with quote

Hi,

I create osgppu pipeline with a prerender camera as input. The pipeline working fine but only one issue, the output unit. If I let outputUnit to render to framebuffer, it will cover all the scene ( I mean the rendering scene from main camera). I try to use UnitInOut to output PPU's rendering result as a texture and apply then mix the texture with main Camera's rendering. But so far not working. Here is what I did:
create osg texture,
assign texture to UnitInOut with setOutputTexture().
apply texture to main camera with shader.

So far this way not working.

Any idea how to get output texture from ppu's pipeline?

Thank you!

Cheers,
Huiliang
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: Tue Apr 20, 2010 7:13 pm    Post subject:
Reply with quote

Hi Huiliang,

so as far as I understand you want to have the output of the osgPPU's pipeline for further processing, right? If so, then take a look into video example. There the output of the osgPPU pipeline is used as texture over the quad. In this example last unit is UnitInOut in order to use the output of very last procesing stage. I assume this is what you are looking for.

If you just want osgPPU to render only in certain parts of the screen, then use Unit::setViewport() on the very last UnitOut to specify the viewport where pipeline should render its output. Here the lsat unit should be UnitOut in order to render directly to the screen.

regards,
Art
Back to top
View user's profile Send private message Visit poster's website
allensaucier
Appreciator


Joined: 10 Apr 2009
Posts: 126

PostPosted: Fri Apr 23, 2010 2:31 pm    Post subject:
Reply with quote

Hi Hui,

I have learned through dissecting the examples that any output to the "UnitOut" ppu goes directly to the frame buffer for immediate display on the screen.

So, I typically perform any "shading" techniques before sending anything to UnitOut, which, for me, is the final output which goes to the frame buffer for immediate display.

Here's my example code that I use to blur and glow a scene. Hope it helps! Very Happy

Cheers,
Allen
Back to top
View user's profile Send private message
allensaucier
Appreciator


Joined: 10 Apr 2009
Posts: 126

PostPosted: Fri Apr 23, 2010 3:20 pm    Post subject:
Reply with quote

sorry guys, major mistake on my part. DO NOT use the code I previously posted!

Here is the correct version that actually works correctly.

Cheers,
Allen
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 How to replace the texture data in th... xdfanfan General 1 Wed Apr 05, 2017 12:44 pm View latest post
No new posts Multitexture: projection a texture on... Ekaterina General 2 Mon Feb 06, 2017 1:48 pm View latest post
No new posts How to set texture coordinates Ekaterina General 0 Fri Jan 13, 2017 5:39 pm View latest post
No new posts Camera::resizeAttachments + texture rect James Turner General 1 Wed Jan 04, 2017 5:22 pm View latest post
No new posts Any good site/software to get texture... vinothrajendran4 VirtualPlanetBuilder [vpb] 1 Fri Dec 30, 2016 9:31 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