Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  EXT_framebuffer_object  (Read 2297 times)
0 Members and 1 Guest are viewing this topic.
Offline anarchotron

Junior Member




...precious bodily fluids.


« Posted 2005-08-07 07:15:44 »

Well I got render-to-texture via EXT_framebuffer_object working (hooray!).  There were a few busted examples I found through google, but I eventually worked through it.

I'm finding that it (unsuprisingly) only works with power-of-two textures for framebuffer render targets.  If I use a non-power-of-2 texture I don't get errors, but my app grinds down from 800 FPS to about 8 seconds per frame :/

My question is, to those of you who are more familiar with FBO & render-to-texture, how do you deal with this limitation when what you really want is a framebuffer object exactly the size of your 'primary' framebuffer?  Do you just render to a known region of your FBO and then clip/scale/whatever when you are rendering _from_ your FBO?

Thanks!


Offline Spasi
« Reply #1 - Posted 2005-08-07 14:40:19 »

Actually, NPOT textures work fine with FBO. I've successfully used both ARB_texture_rectangle textures on NV cards and GL20's NPOT textures on ATI cards.

There's only a bug with the current ATI drivers (will be fixed in Catalyst 5.9), the dimensions of NPOT textures should be multiples of 32. Also, don't forget to use GL_NEAREST for the min/mag filters.
Offline Daire Quinlan

Junior Member





« Reply #2 - Posted 2005-08-07 15:19:00 »

There's only a bug with the current ATI drivers (will be fixed in Catalyst 5.9), the dimensions of NPOT textures should be multiples of 32.

Ah good old ATI OGL drivers eh ??

"Use our new NPOT textures !!! (warning, texture dimension must be powers of 2) "

D.

-edit-  Actually I feel stupid now. can a texture be (say) 96x96 ?? I just read 'multiples' as 2,4,8,16 etc etc. too much time programming i guess ! -edit-
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Spasi
« Reply #3 - Posted 2005-08-07 16:09:32 »

can a texture be (say) 96x96 ??

Yes. Any dimension X that satisfies X % 32 == 0 works correctly. It still sucks though (imagine an image filter at 1/16 of the screen res, works at 1024x768 which downscales to 256x192, but fails at 800x600 which downscales to 200x150).
Offline anarchotron

Junior Member




...precious bodily fluids.


« Reply #4 - Posted 2005-08-07 18:17:25 »

I guess the thing to do in the meantime on ATI is to just pick power-of-two dimensions that fully enclose your primary framebuffer (e.g. 1024x1024 FBO for 1024x768, 2048x1024 for 1280x1024, etc...) then adjust your texture coordinates appropriately when rendering from the FBO (e.g. a quad is (s,t)*(1.0,0.75), or (s,t)*(0.625,1.0) respectively).

Or with Catalyst 5.9, pick the next-highest multiple of 32 and use the same technique.  Ugh. Smiley

Thanks for all the help!
Offline anarchotron

Junior Member




...precious bodily fluids.


« Reply #5 - Posted 2005-08-08 03:33:47 »

Why do you suggest using GL_NEAREST for the texture filters?  Is there a technical or performance problem with GL_LINEAR?  GL_LINEAR seems to be working for me when rendering my FBO quad to the screen, both magnified & minified.

Thanks!
Offline Spasi
« Reply #6 - Posted 2005-08-08 12:53:49 »

Yes, sorry, that's only necessary for fp textures.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (64 views)
2014-04-15 18:08:23

BurntPizza (62 views)
2014-04-15 03:46:01

UprightPath (75 views)
2014-04-14 17:39:50

UprightPath (58 views)
2014-04-14 17:35:47

Porlus (76 views)
2014-04-14 15:48:38

tom_mai78101 (101 views)
2014-04-10 04:04:31

BurntPizza (161 views)
2014-04-08 23:06:04

tom_mai78101 (256 views)
2014-04-05 13:34:39

trollwarrior1 (209 views)
2014-04-04 12:06:45

CJLetsGame (216 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!