hide,I want to add shadow to my scene
first , I place a camera on the light pos, and draw deep map
then ,I disconnect deep map from buffer,and disable the camera
but ,if I disable the camera,the deep map will be changed
winprops = WindowProperties.size(2048, 2048)
props = FrameBufferProperties()
props.setRgbColor(1)
props.setAlphaBits(1)
props.setDepthBits(1)
LBuffer = base.graphicsEngine.makeOutput(
base.pipe, "offscreen buffer", -2,
props, winprops,
GraphicsPipe.BFRefuseWindow,
base.win.getGsg(), base.win)
self.LCam = base.makeCamera(LBuffer)
self.LCam.reparentTo(render)
self.LCam.node().setScene(render)
#self.LCam.node().getLens().setFov(40)
self.LCam.node().getLens().setNearFar(10, 20000)
self.LCam.setPos(SunPos)
self.LCam.lookAt(SunLookAt)
self.LCam.node().setInitialState(lci.getState())
self.LCam.node().setCameraMask(VIEWCAM_MASK)
Ldepthmap_static = Texture()
LBuffer.addRenderTexture(Ldepthmap_static, GraphicsOutput.RTMBindOrCopy,
GraphicsOutput.RTPDepthStencil)
if base.win.getGsg().getSupportsShadowFilter():
Ldepthmap_static.setMinfilter(Texture.FTShadow)
Ldepthmap_static.setMagfilter(Texture.FTShadow)
Lcolormap_static = Texture()
LBuffer.addRenderTexture(Lcolormap_static, GraphicsOutput.RTMBindOrCopy,
GraphicsOutput.RTPColor)
base.graphicsEngine.renderFrame()
LBuffer.clearRenderTextures()
self.LCam.node().setActive(False)
if i add “self.LCam.node().setActive(False)”,Ldepthmap_static will be changed