there needs to be a better way to create buffers

in order to make fire fly demo run i had to use this:

 def makeFBO(self, name, auxrgba):
        # This routine creates an offscreen buffer.  All the complicated
        # parameters are basically demanding capabilities from the offscreen
        # buffer - we demand that it be able to render to texture on every
        # bitplane, that it can support aux bitplanes, that it track
        # the size of the host window, that it can render to texture
        # cumulatively, and so forth.
        winprops = WindowProperties()
        props = FrameBufferProperties()
        props.setRgbColor(1)
        props.setAlphaBits(1)
        props.setDepthBits(1)
        #props.setAuxRgba(auxrgba)
        
        return base.graphicsEngine.makeOutput(
             base.pipe, "model buffer", -2,
             props, winprops,
             GraphicsPipe.BFSizeTrackHost | 
             #GraphicsPipe.BFCanBindEvery  | 
             #GraphicsPipe.BFRttCumulative | 
             GraphicsPipe.BFRefuseWindow,
             base.win.getGsg(), base.win)

as you see i have disabled GraphicsPipe.BFCanBindEvery, GraphicsPipe.BFRttCumulative, auxrgba which broke it. It displays just as well. I think there should be way to say “wanted” features but id they are not there just go without them.

Hi, I’m new and learning Panda, greetings all. :slight_smile:

treeform, thanks for that, now I also can view the Fireflies demo. I also tried to investigate a bit and thought the info might be helpful. I made the application output info about the two buffers created, and this is what I found:

Directly underneath these lines that create the buffers on line 53/54 in Tut-Fireflies.py:

self.modelbuffer = self.makeFBO("model buffer",1)
self.lightbuffer = self.makeFBO("light buffer",0)

I put these lines to get output:

print "modelbuffer:", self.modelbuffer
print "lightbuffer:", self.lightbuffer

When I do what treeform did (disabling the two flags and props.setAuxRgba(auxrgba)), the demo runs and I get as output:

modelbuffer: <libpanda.ParasiteBuffer object at 0x5808aba8>
lightbuffer: <libpanda.ParasiteBuffer object at 0x5808abc0>

When I re-enable either one or both of the flags GraphicsPipe.BFCanBindEvery and GraphicsPipe.BFRttCumulative, the output is

modelbuffer: None
lightbuffer: None

When I re-enable only props.setAuxRgba(auxrgba), I get:

modelbuffer: None
lightbuffer: <libpanda.ParasiteBuffer object at 0x5808aba8>

In every case where at least one of the buffers is None, the demo expectedly fails with the onscreen message “Toon Shader: Video driver does not support multiple render targets”.

I find it interesting that I can only seem to get a parasite offscreen buffer, not the “regular” and better(?) offscreen buffer I read about in the manual.

My system specs are:
Kubuntu Linux 6.06 Dapper 64Bit, Nvidia GeForce 7600 GT with Nvidia’s drivers version 1.0-8762 provided by my distro (it’s a bit old, I know). I’m using the 32bit Panda3D version 1.4.2 for Dapper right now (because I couldn’t compile a 64Bit version - topic for another thread sometimes) together with a 32bit Python 2.4.3.

Sanne

Sanne, try to install the package “nvidia-glx-new”, and then executing this command:

sudo nvidia-glx-config enable

It worked for me.

pro-rsoft, thanks for your reply.

There’s no nvidia-glx-new in Dapper, it got introduced in Feisty after Nvidia split the driver for the newer cards. In Dapper, it’s just nvidia-glx which is the correct driver for my card.

The only thing I could do is to install a newer driver version directly from Nvidia, or upgrade to Gutsy, which I’ll do eventually, but not right now.

I tried to find out what was new in recent drivers regarding GLX extensions and found the only addition is GLX_EXT_texture_from_pixmap which got added in driver 1.0-9626 from October 2006. There’s no other addition up until the latest driver 169.07.

Could the missing GLX_EXT_texture_from_pixmap extension in my driver be the reason that I can’t get the more capable offscreen buffer?

You can try to run ‘glxinfo’ to see what extensions your driver supports.

If you run a version lower than feisty, you can install the little script called “envy” (should be in your repo’s, else download here), run it it will automatically download and install the latest nvidia drivers.

Yes, I already checked with glxinfo, and GLX_EXT_texture_from_pixmap is indeed not present.

Regarding Envy: I’m not comfortable running arbitrary scripts, so I won’t use that. I can look what it does, however, and do similar manually, or just use the ubuntu wiki. :slight_smile:

So before I go to the trouble of manually installing a newer driver, let me please ask to make sure:

The Firefly demo works for you on Linux as it is, pro-rsoft? What about the Shadow demo, does it work also? Which driver version do you use, and what Nvidia card do you have? treeform, may I ask you about this also?

Thanks for you patience. :slight_smile:

It didn’t work normally using gutsy’s default drivers.
However, it did work with both the envy drivers and the nvidia-glx-new drivers. (All envy does is download the latest drivers from nvidia website, build them, install them. You can run it on commandline and see excactly what it does.). I disabled Xgl as well (and used Xorg instead) to fix some weird errors I got on some offscreenrendering shaders, but I don’t think that is straightly related.
My card is an NVIDIA GeForce 5200 FX.

pro-rsoft,

thanks for the info, I should really try the newer drivers then. Thank you for all your help.

This thread has turned out a bit into a hijack by now with my driver issues… that wasn’t my intention initially, please accept my apologies, treeform.

the point is there should be a fall back mechanism

  • we have no clue what will be installed on other peoples computers and we cant have them go hunting for buffers when we can fix it with flags in our programs.

But yes there is always work arounds

Thanks treeform! I finally got to see the fireflies :slight_smile: . I am using a geforce 7600 GS under linux and I was not able to run this sample before.

Yes! The Shadows sample program can be “fixed” in the same way (see line 51). Great! :smiley:

my point is that most of then can be fixed this way… panda3d does the wrong thing in this case and not falling back. When i dig through the source code there is a fall back mechanism yet for some reason its not working.