nV News Forums


nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   Software Development (http://www.nvnews.net/vbulletin/forumdisplay.php?f=53)
-   -   question on framebuffer object implementation (http://www.nvnews.net/vbulletin/showthread.php?t=84098)

gensk 01-12-07 03:06 AM

question on framebuffer object implementation

I'm programming some opengl demos in c++ under Linux (for os/system specs see end of posting).

I'm implementing some different reflection techniques.
I want to use a stencil render buffer attached to a fbo (stencil reflections) . But it seems to be not possible to make it attachment complete. Here is the code:


glGenFramebuffersEXT(1, &texture.fBuf);
glGenRenderbuffersEXT(1, &texture.dBuf);
glGenRenderbuffersEXT(1, &texture.sBuf);
glGenTextures(1, &texture.texID);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, texture.fBuf);

// initialize color texture
glBindTexture(GL_TEXTURE_2D, texture.texID);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, texture.width, texture.height, 0,GL_RGB, GL_INT, NULL);

// initialize depth renderbuffer
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, texture.dBuf);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_DEPTH_COMPONENT24, texture.width, texture.height);

// initialize stencil renderbuffer
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, texture.sBuf);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_STENCIL_INDEX, texture.width, texture.height);

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

If I omit the stencil buffer part I'm able to draw to the texture.
The code snipped is taken from http://www.opengl.org/registry/specs...fer_object.txt

Are there any errors or have I forgotten something important?

Here are the specs:

939 athlon 3000+ venice
2GB ram
geforce-7600gt with nvidia-drivers-1.0.9746

I'm on an gentoo system, so


Portage 2.1.2_rc4-r8 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.19-gentoo-r3 x86_64)
System uname: 2.6.19-gentoo-r3 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.12.8
Last Sync: Thu, 11 Jan 2007 16:01:01 +0000
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:    2.4.4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:    2.4-r6
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:  1.5.22
virtual/os-headers:  2.6.19
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=athlon64 -O2 -pipe -msse3"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=athlon64 -O2 -pipe -msse3"
FEATURES="autoconfig ccache distlocks keeptemp keepwork metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="16bit X aac acpi aio akode allegro alsa amd64 amr apm arts audiofile bash-completion bcp berkdb bitmap-fonts bjam blas boost branding bzip2 c++ cairo cdio cdparanoia cdr cdrom cli cpudetection cracklib crypt ctype cups dbus dio directfb dlloader dmi doc dri dts dvd dvdr dvdread eds emboss encode epson examples expat fam fbcon ffmpeg fftw firefox fixes font-server fontconfig foomaticdb fortran fortran95 gcc64 gdbm gif glib glitz glut gnome gnome-print gnomecanvas gnomedb gpm graphviz gstreamer gtk gtk2 gtkhtml hal icons iconv icq icu ipv6 isdnlog jack java jpeg kde kdeenablefinal kdehiddenvisibility kdm kqemu ladspa lcms ldap libg++ logitech-mouse mmap mng mp3 mpeg musepack ncurses net nls nptl nptlonly nsplugin nvidia ogg openexr opengl pam pam_console patented pcre pdf perl png portaudio posix ppds pppd python qt3 qt4 quicktime rdesktop readline reflection rrdtool rtc runlevels scanner sdl session slp sockets spell spl sse-filters ssl svg sysfs tcpd threads tidy tiff truetype truetype-fonts type1-fonts udev unicode usb utempter vim vorbis wxwindows xcomposite xine xml xorg xscreensaver xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="nvidia nv"

oc2k1 01-12-07 06:42 AM

Re: question on framebuffer object implementation
I would use a EXT_packed_depth_stencil renderbuffer with packed depth (24bit) and stencil (8 bit).
What prints CHECK_FRAMEBUFFER_STATUS(); out? Does the other code work with disabled FBO?

gensk 01-12-07 03:08 PM

Re: question on framebuffer object implementation
With stencil code I get the error code "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT"!

The code is working perfectly including depth buffer without stencil buffer. I have tried to init a stencil buffer as texture. I can initialize it but it seems not working at rtt time?????

oc2k1 01-12-07 05:06 PM

Re: question on framebuffer object implementation
in my opinion it's not possible to use a texture as stencil attachment (maybe in future?) Try to use EXT_packed_depth_stencil insteat two buffers.

gensk 01-13-07 05:08 AM

Re: question on framebuffer object implementation
Over night I googled - one more time - and found the same solution. But - the extension registry entry is very tight-lipped. I will further test it... It seems to be a kludge

If anyone has got an example how to use it at hand, feel free to post it here. Otherwise consider this post as answered and closed. Thanks for reading and helping!

squeen 01-15-07 05:33 AM

Re: question on framebuffer object implementation
I thought I saw in the list of GL extension for the n80 something about adding a stencil to FBOs. You might peek at the spec.

All times are GMT -5. The time now is 07:36 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.