View Single Post
  #7  
Old 04-05-2013, 11:37 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Your code is applying the shader to all objects in the scene. It seems like you should be applying the shader to the quad that is rendering the rendered texture instead:
Code:
quad1.apply(InvShader)
quad1.apply(viz.addUniformInt('InputTex',0))
Also, you might want to consider using the vizfx.postprocess library. For example, here is your script converted to use the library with the built-in inverse color effect applied:
Code:
import viz
viz.go()

#Adding WebCam
video = viz.add('VideoCamera.dle')
cam = video.addWebcam()

#Adding piazza environment to Scene2
piazza = viz.addChild('piazza.osgb')

#Adding & setting quad to Scene 2
quad2 = viz.addTexQuad()
quad2.setScale(2,1.5)
quad2.setPosition(0,2,6)
quad2.texture(cam)

#Apply inverse post-process effect
import vizfx.postprocess
from vizfx.postprocess.color import InvertColorEffect
vizfx.postprocess.addEffect(InvertColorEffect())
Reply With Quote