Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (593)
Games in Android Showcase (168)
games submitted by our members
Games in WIP (646)
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 2607 times)
0 Members and 1 Guest are viewing this topic.
Offline anarchotron

Junior Devvie

...precious bodily fluids.

« Posted 2005-08-07 05: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?


Offline Spasi
« Reply #1 - Posted 2005-08-07 12: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 Devvie

« Reply #2 - Posted 2005-08-07 13: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) "


-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 14: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 Devvie

...precious bodily fluids.

« Reply #4 - Posted 2005-08-07 16: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 Devvie

...precious bodily fluids.

« Reply #5 - Posted 2005-08-08 01: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.

Offline Spasi
« Reply #6 - Posted 2005-08-08 10: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.

Riven (16 views)
2015-07-03 11:22:16

deepthought (43 views)
2015-06-30 15:39:44

deepthought (47 views)
2015-06-30 15:39:09

deepthought (57 views)
2015-06-30 15:36:52

Za\'Anzabar (27 views)
2015-06-29 05:44:54

TritonDreyja (43 views)
2015-06-24 17:10:40

CopyableCougar4 (43 views)
2015-06-23 00:34:45

BurntPizza (46 views)
2015-06-21 20:36:46

cookiecompiler (88 views)
2015-06-11 15:42:53

cookiecompiler (51 views)
2015-06-11 15:41:14
How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14 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‑
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!