depth texture (shadows) problems for x600 on both w&l

depth texture (shadows) problems for x600 on both winows and linux
running the Tut-Shadow-Mapping gives me

“Shadow Demo: Video driver cannot create an offscreen buffer.”

i have put outputs in the source and compiled. This is what happen it gets to the 10 try loop “for (int retry=0; retry<10; retry++) {” in graphicsEngine.cxx it passes it on the first time and takes 2nd return statement. It fails the first one " if ((precertify) && (gsg != 0) && (window->get_gsg()==gsg)) {"
but “do_add_window(window, threading_model); open_windows();” the “window->is_valid()” and i get the value of the window being some thing like (0x85368f8:6) - just a pointer an a “is_valid()” one at that. But when it gets to python it is None. I think the window is created correctly but not outputted properly to python. i did “print LBuffer,type(LBuffer)” > “None <type ‘NoneType’>” its a true none not just some thing that just == None because id(LBuffer) == id(None) so its the same memory address.

If i try to create more windows after in the same manner i get the " Sanity check everything failed" then the 10 tries and “Could not create a window to the user’s specs.” and clearly returns Null unlike the 1st time. But the result is always the same : None.

Here is my log:

Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)

:display(debug): enterd GraphicsEngine::make_output .
    :display(debug): If a gsg or host was supplied, and either is not yet initialized: .
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): DisplayRegion::do_compute_pixels(800, 600)
    :display(debug): DisplayRegion::do_compute_pixels(800, 600)
    :display(debug): Creating new window window1
    :display(debug): Created glxGraphicsWindow 0x85368f0
    :display(debug): Windows resorted: window1(0)
     window1(0)
    :pgraph(spam): Comparing 0 to 1 result = -1
    :pgraph(spam): Comparing 0 to 1 result = -1
    :display:gsg:glgsg(debug): GL_VENDOR = ATI Technologies Inc.
    :display:gsg:glgsg(debug): GL_RENDERER = MOBILITY RADEON X600 SE
    :display:gsg:glgsg(debug): GL_VERSION = 2.0.6334 (8.34.8), decoded to 2.0.6334
    :display:gsg:glgsg(debug): GLX_VENDOR (client) = ATI
    :display:gsg:glgsg(debug): GLX_VERSION (client) = 1.3
    :display:gsg:glgsg(debug): GLX_VENDOR (server) = SGI
    :display:gsg:glgsg(debug): GLX_VERSION (server) = 1.2
    :display:gsg:glgsg(debug): GLX_VERSION = 1.2
    :display:gsg:glgsg(debug): GL Extensions:
    :display:gsg:glgsg(debug): GLX_ARB_get_proc_address
    :display:gsg:glgsg(debug): GLX_ARB_multisample
    :display:gsg:glgsg(debug): GLX_EXT_import_context
    :display:gsg:glgsg(debug): GLX_EXT_visual_info
    :display:gsg:glgsg(debug): GLX_EXT_visual_rating
    :display:gsg:glgsg(debug): GL_ARB_depth_texture
    :display:gsg:glgsg(debug): GL_ARB_draw_buffers
    :display:gsg:glgsg(debug): GL_ARB_fragment_program
    :display:gsg:glgsg(debug): GL_ARB_fragment_program_shadow
    :display:gsg:glgsg(debug): GL_ARB_fragment_shader
    :display:gsg:glgsg(debug): GL_ARB_multisample
    :display:gsg:glgsg(debug): GL_ARB_multitexture
    :display:gsg:glgsg(debug): GL_ARB_occlusion_query
    :display:gsg:glgsg(debug): GL_ARB_pixel_buffer_object
    :display:gsg:glgsg(debug): GL_ARB_point_parameters
    :display:gsg:glgsg(debug): GL_ARB_point_sprite
    :display:gsg:glgsg(debug): GL_ARB_shader_objects
    :display:gsg:glgsg(debug): GL_ARB_shading_language_100
    :display:gsg:glgsg(debug): GL_ARB_shadow
    :display:gsg:glgsg(debug): GL_ARB_shadow_ambient
    :display:gsg:glgsg(debug): GL_ARB_texture_border_clamp
    :display:gsg:glgsg(debug): GL_ARB_texture_compression
    :display:gsg:glgsg(debug): GL_ARB_texture_cube_map
    :display:gsg:glgsg(debug): GL_ARB_texture_env_add
    :display:gsg:glgsg(debug): GL_ARB_texture_env_combine
    :display:gsg:glgsg(debug): GL_ARB_texture_env_crossbar
    :display:gsg:glgsg(debug): GL_ARB_texture_env_dot3
    :display:gsg:glgsg(debug): GL_ARB_texture_float
    :display:gsg:glgsg(debug): GL_ARB_texture_mirrored_repeat
    :display:gsg:glgsg(debug): GL_ARB_texture_rectangle
    :display:gsg:glgsg(debug): GL_ARB_transpose_matrix
    :display:gsg:glgsg(debug): GL_ARB_vertex_blend
    :display:gsg:glgsg(debug): GL_ARB_vertex_buffer_object
    :display:gsg:glgsg(debug): GL_ARB_vertex_program
    :display:gsg:glgsg(debug): GL_ARB_vertex_shader
    :display:gsg:glgsg(debug): GL_ARB_window_pos
    :display:gsg:glgsg(debug): GL_ATIX_texture_env_combine3
    :display:gsg:glgsg(debug): GL_ATIX_texture_env_route
    :display:gsg:glgsg(debug): GL_ATIX_vertex_shader_output_point_size
    :display:gsg:glgsg(debug): GL_ATI_draw_buffers
    :display:gsg:glgsg(debug): GL_ATI_element_array
    :display:gsg:glgsg(debug): GL_ATI_envmap_bumpmap
    :display:gsg:glgsg(debug): GL_ATI_fragment_shader
    :display:gsg:glgsg(debug): GL_ATI_map_object_buffer
    :display:gsg:glgsg(debug): GL_ATI_separate_stencil
    :display:gsg:glgsg(debug): GL_ATI_texture_env_combine3
    :display:gsg:glgsg(debug): GL_ATI_texture_float
    :display:gsg:glgsg(debug): GL_ATI_texture_mirror_once
    :display:gsg:glgsg(debug): GL_ATI_vertex_array_object
    :display:gsg:glgsg(debug): GL_ATI_vertex_attrib_array_object
    :display:gsg:glgsg(debug): GL_ATI_vertex_streams
    :display:gsg:glgsg(debug): GL_EXT_abgr
    :display:gsg:glgsg(debug): GL_EXT_bgra
    :display:gsg:glgsg(debug): GL_EXT_blend_color
    :display:gsg:glgsg(debug): GL_EXT_blend_func_separate
    :display:gsg:glgsg(debug): GL_EXT_blend_minmax
    :display:gsg:glgsg(debug): GL_EXT_blend_subtract
    :display:gsg:glgsg(debug): GL_EXT_clip_volume_hint
    :display:gsg:glgsg(debug): GL_EXT_compiled_vertex_array
    :display:gsg:glgsg(debug): GL_EXT_draw_range_elements
    :display:gsg:glgsg(debug): GL_EXT_fog_coord
    :display:gsg:glgsg(debug): GL_EXT_framebuffer_object
    :display:gsg:glgsg(debug): GL_EXT_multi_draw_arrays
    :display:gsg:glgsg(debug): GL_EXT_packed_pixels
    :display:gsg:glgsg(debug): GL_EXT_point_parameters
    :display:gsg:glgsg(debug): GL_EXT_rescale_normal
    :display:gsg:glgsg(debug): GL_EXT_secondary_color
    :display:gsg:glgsg(debug): GL_EXT_separate_specular_color
    :display:gsg:glgsg(debug): GL_EXT_shadow_funcs
    :display:gsg:glgsg(debug): GL_EXT_stencil_wrap
    :display:gsg:glgsg(debug): GL_EXT_texgen_reflection
    :display:gsg:glgsg(debug): GL_EXT_texture3D
    :display:gsg:glgsg(debug): GL_EXT_texture_compression_s3tc
    :display:gsg:glgsg(debug): GL_EXT_texture_cube_map
    :display:gsg:glgsg(debug): GL_EXT_texture_edge_clamp
    :display:gsg:glgsg(debug): GL_EXT_texture_env_add
    :display:gsg:glgsg(debug): GL_EXT_texture_env_combine
    :display:gsg:glgsg(debug): GL_EXT_texture_env_dot3
    :display:gsg:glgsg(debug): GL_EXT_texture_filter_anisotropic
    :display:gsg:glgsg(debug): GL_EXT_texture_lod_bias
    :display:gsg:glgsg(debug): GL_EXT_texture_mirror_clamp
    :display:gsg:glgsg(debug): GL_EXT_texture_object
    :display:gsg:glgsg(debug): GL_EXT_texture_rectangle
    :display:gsg:glgsg(debug): GL_EXT_vertex_array
    :display:gsg:glgsg(debug): GL_EXT_vertex_shader
    :display:gsg:glgsg(debug): GL_HP_occlusion_test
    :display:gsg:glgsg(debug): GL_NV_blend_square
    :display:gsg:glgsg(debug): GL_NV_occlusion_query
    :display:gsg:glgsg(debug): GL_NV_texgen_reflection
    :display:gsg:glgsg(debug): GL_S3_s3tc
    :display:gsg:glgsg(debug): GL_SGIS_generate_mipmap
    :display:gsg:glgsg(debug): GL_SGIS_texture_border_clamp
    :display:gsg:glgsg(debug): GL_SGIS_texture_edge_clamp
    :display:gsg:glgsg(debug): GL_SGIS_texture_lod
    :display:gsg:glgsg(debug): GL_SGI_color_matrix
    :display:gsg:glgsg(debug): GL_SUN_multi_draw_arrays
    :display:gsg:glgsg(debug): HAS EXT GLX_ARB_get_proc_address 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_point_sprite 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_vertex_blend 1
    :display:gsg:glgsg(debug): max vertex transforms = 4
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_matrix_palette 0
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_depth_texture 1
    :display:gsg:glgsg(debug): HAS EXT GL_EXT_packed_depth_stencil 0
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_texture_cube_map 1
    :display:gsg:glgsg(debug): HAS EXT GL_EXT_bgra 1
    :display:gsg:glgsg(debug): HAS EXT GL_EXT_rescale_normal 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_multisample 1
    :display:gsg:glgsg(debug): HAS EXT GL_SGIS_generate_mipmap 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_texture_non_power_of_two 0
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_depth_texture 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_shadow 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_fragment_program_shadow 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_texture_env_combine 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_texture_env_crossbar 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_texture_env_dot3 1
    :display:gsg:glgsg(debug): HAS EXT GL_ATI_draw_buffers 1
    :display:gsg:glgsg(debug): HAS EXT GL_EXT_framebuffer_object 1
    :display:gsg:glgsg(debug): Occlusion query counter provides 32 bits.
    :display:gsg:glgsg(debug): HAS EXT GL_SGIS_texture_edge_clamp 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_texture_border_clamp 1
    :display:gsg:glgsg(debug): HAS EXT GL_ARB_texture_mirrored_repeat 1
    :display:gsg:glgsg(debug): HAS EXT GL_EXT_texture_mirror_clamp 1
    :display:gsg:glgsg(debug): max texture dimension = 2048, max 3d texture = 2048, max cube map = 2048
    :display:gsg:glgsg(debug): max_elements_vertices = 2147483647, max_elements_indices = 65535
    :display:gsg:glgsg(debug): vertex buffer objects are supported.
    :display:gsg:glgsg(debug): Supported compressed texture formats:
      GL_COMPRESSED_RGB_S3TC_DXT1_EXT
      GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
      GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
      GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
    :display:gsg:glgsg(debug): HAS EXT GL_EXT_stencil_wrap 1
    :display:gsg:glgsg(debug): HAS EXT GL_EXT_stencil_two_side 0
    :display:gsg:glgsg(debug): max lights = 8
    :display:gsg:glgsg(debug): max clip planes = 6
    :display:gsg:glgsg(debug): max texture stages = 8
    :display:gsg:glgsg(debug): 
    Cg vertex profile = arbvp1  id = 6150
    Cg pixel profile = arbfp1  id = 7000
    shader model = 2
    :display:gsg:glgsg(debug): HAS EXT GLX_SGI_swap_control 0
    :display:glxdisplay(debug): Raw mice not requested.
    :display(debug): DisplayRegion::do_compute_pixels(800, 600)
    :display(spam): begin_frame(refresh): glxGraphicsWindow window1 0x85368f0
    :display(spam): end_frame(refresh): glxGraphicsWindow window1 0x85368f0
    :display(debug): system_changed_properties(size=(800, 600) )
    :display(debug): system_changed_size(800, 600)
    :display(debug): system_changed_properties(size=(800, 600) )
    :display(debug): system_changed_size(800, 600)
    :display(debug): system_changed_properties(!minimized )
    :display(debug): system_changed_properties(foreground )
    :event(debug): Throwing event window-event
    :display(spam): begin_frame(refresh): glxGraphicsWindow window1 0x85368f0
    :display(spam): end_frame(refresh): glxGraphicsWindow window1 0x85368f0
:display(debug):  window type 2. (0x85368f0:6)

:pgraph(debug): Constructing 0x8890260, camera
:pgraph(debug): Constructing 0x8890340, cam
:display(debug): DisplayRegion::do_compute_pixels(800, 600)
:display(debug): DisplayRegion::do_compute_pixels(800, 600)
:pgraph(debug): Constructing 0x8890ef8, keyboard/mouse
:pgraph(debug): Constructing 0x8891138, keyboard/mouse
:pgraph(debug): Constructing 0x88918f8, keyboard/mouse
:pgraph(debug): Constructing 0x8891bb0, trackball
:pgraph(debug): Constructing 0x8891e48, drive
:pgraph(debug): Constructing 0x8892410, mouse2cam
:pgraph(debug): Constructing 0x88925c8, timeButtons
:display(debug): DisplayRegion::do_compute_pixels(800, 600)
:display(debug): DisplayRegion::do_compute_pixels(800, 600)
:pgraph(debug): Constructing 0x8892c28, cam2d
:pgraph(debug): Constructing 0x8892d90, camera2d
:display(debug): DisplayRegion::do_compute_pixels(800, 600)
:display(debug): DisplayRegion::do_compute_pixels(800, 600)
:pgraph(debug): Constructing 0x8893470, cam2d
:pgraph(debug): Constructing 0x88935d8, camera2dp
:display: Unable to set window properties: !undecorated 
:display(spam): begin_frame(refresh): glxGraphicsWindow window1 0x85368f0
:display(spam): end_frame(refresh): glxGraphicsWindow window1 0x85368f0
:display(spam): begin_frame(refresh): glxGraphicsWindow window1 0x85368f0
:display(spam): end_frame(refresh): glxGraphicsWindow window1 0x85368f0
:audio(debug): create_AudioManager()
  audio_library_name="p3fmod_audio"
:audio(debug):   dl_name="libp3fmod_audio.so"
:audio(error): _system->init(): Error initializing output device. 
:audio(debug): create_NullAudioManger()
:audio: NullAudioManager
:audio(debug): create_AudioManager()
  audio_library_name="p3fmod_audio"
:audio(error): _system->init(): Error initializing output device. 
:audio(debug): create_NullAudioManger()
:audio: NullAudioManager
:util(warning): Adjusting global clock's real time by 1.40461 seconds.
:pgraph(spam): find_matches pass: 0 NodePaths, 1, 7000
    (dataRoot):(match_many),0
:pgraph(spam): find_matches pass: 0 NodePaths, 1, 6999
    (dataRoot/keyboard/mouse):(match_many),0
    (dataRoot/keyboard/mouse): solution!
    
:display(debug): enterd GraphicsEngine::make_output .
    :display(debug): Sanity check everything faild
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): Ask the pipe to create a window. (10 tries) .
    :display(debug): Ask the pipe to create a window. (10 tries) .
:display(debug): Could not create a window to the user's specs. .

after talking to pro-rsoft who had similar problems he says he got it to work with earlier piece of code. He gave me his code and i stuck that into the tutorial and wala it works…

here is the tutorial code that worked for me


from pandac.PandaModules import *
import sys,os

#loadPrcFileData("", "fullscreen 1")
#loadPrcFileData('', 'notify-level debug')
loadPrcFileData('', 'show-buffers 1')
loadPrcFileData("", "framebuffer-multisample 1")
loadPrcFileData("", 'vfs-case-sensitive 0')

# loadPrcFileData('', 'want-pstats 1')
# os.spawnl(os.P_NOWAIT, "D:/Panda3D-1.3.2/bin/pstats.exe")
# PStatClient.connect()

import direct.directbase.DirectStart
from direct.interval.IntervalGlobal import *
from direct.gui.DirectGui import OnscreenText
from direct.showbase.DirectObject import DirectObject
from direct.actor import Actor
from random import *

# Function to put instructions on the screen.
def addInstructions(pos, msg):
    return OnscreenText(text=msg, style=1, fg=(1,1,1,1), mayChange=1,
                        pos=(-1.3, pos), align=TextNode.ALeft, scale = .05, shadow=(0,0,0,1), shadowOffset=(0.1,0.1))

# Function to put title on the screen.
def addTitle(text):
    return OnscreenText(text=text, style=1, fg=(1,1,1,1),
                        pos=(1.3,-0.95), align=TextNode.ARight, scale = .07)

class World(DirectObject):
    def __init__(self):
        # Preliminary capabilities check.
    
        if (base.win.getGsg().getSupportsBasicShaders()==0):
            self.t=addTitle("Shadow Demo: Video driver reports that shaders are not supported.")
            return
        if (base.win.getGsg().getSupportsDepthTexture()==0):
            self.t=addTitle("Shadow Demo: Video driver reports that depth textures are not supported.")
            return
          
        # creating the offscreen buffer.
    
        winprops = WindowProperties.size(512,512)
        props = FrameBufferProperties()
        props.setRgbColor(1)
        props.setAlphaBits(1)
        props.setDepthBits(1)

        Ldepthmap=Texture()
        Ldepthmap.setFormat(Texture.FDepthComponent) #to store depth value instead of color
        Ldepthmap.setMinfilter(Texture.FTShadow)     #to use OpenGL SGIX_shadow extension
        Ldepthmap.setMagfilter(Texture.FTShadow)
        Ldepthmap.setWrapU(Texture.WMBorderColor)
        Ldepthmap.setWrapV(Texture.WMBorderColor)
        Ldepthmap.setBorderColor(Vec4(1,1,1,1))
        self.mapsize = 512
        LBuffer=base.win.makeTextureBuffer('depthmap',self.mapsize,self.mapsize,Ldepthmap)
        light=base.makeCamera(LBuffer)  
        
           
#        if (LBuffer == None):
#           self.t=addTitle("Shadow Demo: Video driver cannot create an offscreen buffer.")
#           return
#        
#        Ldepthmap = Texture()
#        LBuffer.addRenderTexture(Ldepthmap, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPDepth)
#        Ldepthmap.setMinfilter(Texture.FTShadow) # to use OpenGL SGIX_shadow extension
#        Ldepthmap.setMagfilter(Texture.FTShadow) 
#
#	# Adding a color texture is totally unnecessary, but it helps with debugging.
#        Lcolormap = Texture()
#        LBuffer.addRenderTexture(Lcolormap, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPColor)
#    
    
        self.inst_p = addInstructions(0.95, 'P : stop/start the Panda Rotation')
        self.inst_w = addInstructions(0.90, 'W : stop/start the Walk Cycle')
        self.inst_t = addInstructions(0.85, 'T : stop/start the Teapot')
        self.inst_l = addInstructions(0.80, 'L : move light source far or close')
        self.inst_v = addInstructions(0.75, 'V: View the Depth-Texture results')
        self.inst_x = addInstructions(0.70, 'Left/Right Arrow : switch camera angles')
        self.inst_a = addInstructions(0.65, 'Something about A/Z and push bias')
    
        base.setFrameRateMeter(1)
        base.setBackgroundColor(0,0,0,1)
    
        base.camLens.setNearFar(1.0,10000)
        base.camLens.setFov(75)
        base.disableMouse()
    
        # Load the scene.
    
        floorTex=loader.loadTexture('maps/envir-ground.jpg')
        cm=CardMaker('')
        cm.setFrame(-2,2,-2,2)
        floor = render.attachNewNode(PandaNode("floor"))
        for y in range(12):
            for x in range(12):
                nn = floor.attachNewNode(cm.generate())
                nn.setP(-90)
                nn.setPos((x-6)*4, (y-6)*4, 0)
        floor.setTexture(floorTex)
        floor.flattenStrong()
    
        self.pandaAxis=render.attachNewNode('panda axis')
        self.pandaModel=Actor.Actor('panda-model',{'walk':'panda-walk4'})
        self.pandaModel.reparentTo(self.pandaAxis)
        self.pandaModel.setPos(9,0,0)
        self.pandaModel.setShaderInput("scale",0.01,0.01,0.01,1.0)
        self.pandaWalk = self.pandaModel.actorInterval('walk',playRate=1.8)
        self.pandaWalk.loop()
        self.pandaMovement = self.pandaAxis.hprInterval(20.0,Point3(-360,0,0),startHpr=Point3(0,0,0))
        self.pandaMovement.loop()
    
        self.teapot=loader.loadModel('teapot')
        self.teapot.reparentTo(render)
        self.teapot.setPos(0,-20,10)
        self.teapot.setShaderInput("texDisable",1,1,1,1)
        self.teapotMovement = self.teapot.hprInterval(50,Point3(0,360,360))
        self.teapotMovement.loop()
    
        self.accept('escape',sys.exit)
    
        self.accept("arrow_left", self.incrementCameraPosition, [-1])
        self.accept("arrow_right", self.incrementCameraPosition, [1])
        self.accept("p", self.toggleInterval, [self.pandaMovement])
        self.accept("P", self.toggleInterval, [self.pandaMovement])
        self.accept("t", self.toggleInterval, [self.teapotMovement])
        self.accept("T", self.toggleInterval, [self.teapotMovement])
        self.accept("w", self.toggleInterval, [self.pandaWalk])
        self.accept("W", self.toggleInterval, [self.pandaWalk])
        self.accept("v", base.bufferViewer.toggleEnable)
        self.accept("V", base.bufferViewer.toggleEnable)
        self.accept("l", self.incrementLightPosition, [1])
        self.accept("L", self.incrementLightPosition, [1])
        self.accept("o", base.oobe)
        self.accept('a',self.adjustPushBias,[1.1])
        self.accept('A',self.adjustPushBias,[1.1])
        self.accept('z',self.adjustPushBias,[0.9])
        self.accept('Z',self.adjustPushBias,[0.9])
    
       
        self.LCam=base.makeCamera(LBuffer)
        self.LCam.node().setScene(render)
        self.LCam.node().getLens().setFov(40)
        self.LCam.node().getLens().setNearFar(10,100)
    
        # default values
        self.pushBias=0.04
        self.ambient=0.0
        self.cameraSelection = 0
        self.lightSelection = 0
    
        # setting up shader
        render.setShaderInput('light',self.LCam)
        render.setShaderInput('Ldepthmap',Ldepthmap)
        render.setShaderInput('ambient',self.ambient,0,0,1.0)
        render.setShaderInput('texDisable',0,0,0,0)
        render.setShaderInput('scale',1,1,1,1)
    
        # Put a shader on the Light camera.
        lci = NodePath(PandaNode("Light Camera Initializer"))
        lci.setShader(Shader.load('caster.sha'))
        self.LCam.node().setInitialState(lci.getState())
    
        # Put a shader on the Main camera.
        mci = NodePath(PandaNode("Main Camera Initializer"))
        mci.setShader(Shader.load('shadow.sha'))
        base.cam.node().setInitialState(mci.getState())
    
        self.incrementCameraPosition(0)
        self.incrementLightPosition(0)
        self.adjustPushBias(1.0)
    
# end of __init__

    def toggleInterval(self, ival):
        if (ival.isPlaying()):
            ival.pause()
        else:
            ival.resume()

    def incrementCameraPosition(self,n):
        self.cameraSelection = (self.cameraSelection + n) % 6
        if (self.cameraSelection == 0):
            base.cam.reparentTo(render)
            base.cam.setPos(30,-45,26)
            base.cam.lookAt(0,0,0)
            self.LCam.node().hideFrustum()
        if (self.cameraSelection == 1):
            base.cam.reparentTo(self.pandaModel)
            base.cam.setPos(7,-3,9)
            base.cam.lookAt(0,0,0)
            self.LCam.node().hideFrustum()
        if (self.cameraSelection == 2):
            base.cam.reparentTo(self.pandaModel)
            base.cam.setPos(-7,-3,9)
            base.cam.lookAt(0,0,0)
            self.LCam.node().hideFrustum()
        if (self.cameraSelection == 3):
            base.cam.reparentTo(render)
            base.cam.setPos(7,-23,12)
            base.cam.lookAt(self.teapot)
            self.LCam.node().hideFrustum()
        if (self.cameraSelection == 4):
            base.cam.reparentTo(render)
            base.cam.setPos(-7,-23,12)
            base.cam.lookAt(self.teapot)
            self.LCam.node().hideFrustum()
        if (self.cameraSelection == 5):
            base.cam.reparentTo(render)
            base.cam.setPos(1000,0,195)
            base.cam.lookAt(0,0,0)
            self.LCam.node().showFrustum()
  
    def incrementLightPosition(self,n):
        self.lightSelection = (self.lightSelection + n) % 2
        if (self.lightSelection == 0):
            self.LCam.setPos(0,-40,25)
            self.LCam.lookAt(0,-10,0)
            self.LCam.node().getLens().setNearFar(10,100)
        if (self.lightSelection == 1):
            self.LCam.setPos(0,-600,200)
            self.LCam.lookAt(0,-10,0)
            self.LCam.node().getLens().setNearFar(10,1000)
  
    def shaderSupported(self):
        return base.win.getGsg().getSupportsBasicShaders() and \
               base.win.getGsg().getSupportsDepthTexture() and \
               base.win.getGsg().getSupportsShadowFilter()
  
    def adjustPushBias(self,inc):
        self.pushBias *= inc
        self.inst_a.setText('A/Z: Increase/Decrease the Push-Bias [%F]' % self.pushBias)
        render.setShaderInput('push',self.pushBias,self.pushBias,self.pushBias,0)
  

World()
run()

Is this the same problem as
https://discourse.panda3d.org/viewtopic.php?t=2984&highlight=offscreen+buffer
?

I have the same error on Linux (Ubuntu 7.04) using Radeon 1950 Pro.
Your code does run - thanks, & yipee!

But I wonder whether it is working properly.

  1. Push-Bias greater than 0.1 causes the teapot’s shadow to appear on the front of the teapot itself !

  2. “V : View the depth-texture” shows a blank white buffer window.

  3. Un-commenting the lines

        # Adding a color texture is totally unnecessary, but it helps with debugging.
        Lcolormap = Texture()
        LBuffer.addRenderTexture(Lcolormap, GraphicsOutput.RTMBindOrCopy, GraphicsOutput.RTPColor)

gives an extra buffer window that seems to be showing the correct depth=>grey.
However the top edge of that buffer seems to be a magnified closeup of the panda’s feet, in colour.

BTW
Is this related to ynjh_jo’s
https://discourse.panda3d.org/viewtopic.php?t=2172&highlight=shadow+mapping
That looked brilliant !

Yes, this is basically a simplified version of ynjh_jo’s example.

I am pretty sure that the workaround is not quite right, at least on my Linux+ATI.

The magnified panda feet are caused by the unnecessary

light=base.makeCamera(LBuffer)

More important, only the teapot casts a shadow. The panda does not.
I am guessing that it is a problem with tex2Dproj() in the shader.

I have started a new topic, in case other ATI+Linux people are getting the same thing, or have better ideas than me.
https://discourse.panda3d.org/viewtopic.php?p=16998#16998