Panda3D Manual: Multi-Pass RenderingMulti-Pass RenderingSometimes you may need to draw the same scene more than once per frame, each view looking different. This is where multi-pass rendering comes into play.
However, this method assumes you have two independent scene graphs. If you use this method to render the same scene graph, it is only useful for showing the scene from a different camera view. To actually make the scenes have different RenderStates (i.e. one without lighting, one with lighting) you must also change how each Camera renders the scene. Each Camera node has a function called #this makes everything drawn by the default camera use myNodePath's RenderState base.cam.setInitialState(myNodePath.getState()) You may, however, want more control over what RenderState gets assigned to each node in the scene. You can do this using the Camera class methods #Assume we have CgShaderAttrib instances toonShadingAttrib and blurShadingAttrib #and we have a Camera whose NodePath is myCamera base.cam.node().setTagStateKey("Toon Shading") base.cam.node().setTagState("True", RenderState.make(toonShadingAttrib)) myCamera.node().setTagStateKey("Blur Shading") myCamera.node().setTagState("True", RenderState.make(blurShadingAttrib)) # this makes myNodePath and its children get toonShaded # when rendered by the default camera myNodePath.setTag("Toon Shading", "True") .... #now if you want myNodePath to be blurred when seen by myCamera, #it's as easy as adding a tag myNodePath.setTag("Blur Shading", "True") For a full guide about Multi-Pass rendering in Panda3D, please read the Howto on Multipass Rendering of the original Panda3D documentation. © Carnegie Mellon University 2010 |