Substitute for Framebuffer Objects?

Started by
2 comments, last by Exustio 15 years, 3 months ago
Hello, I am working on a 2d rpg game, seen from above. Like in many other games the screen is supposed to be dark when entering a dungeon, and the only light is supposed to come from specific lightsources like torches. I have managed to fix this with rendering a shadowmap with the help of a framebuffer object, and then simply rendering it above the finnished scene, just before swapping buffers. This works perfectly on my computer, but on my laptop it doesn't. Probably because of the lack of hardware support for the FBO. I have tried using PBuffers, but I can't really make them work good either. - So I need a method for rendering to a bitmap, that does not require hardware support for FBOs or Pixelbuffers. Can anyone point me in the right direction? - In addition to this I would like a hint on where I can find information about shading without hardwaresupport. Any help would be really appreciated.
Advertisement
you could use glCopyTexSubImage2D to read the entire screen to a texture. i wouldnt recommend calling it every frame though because its slow. i would call it every time the camera moved or something moved in front of it.
it sounds like youre doing the lighting backwards

ie rendering scene + then applying the darkness over the top
usually ppl do it the same way as in reallife, for each object see what lights affect it + then render it that way.

though as adam17 saiz use glCopyTexSubImage2D.
I wouldnt worry about speed, its not *that* slow, though be aware if a machine doesnt support FBO, it must be quite old, ( even my onboard intel supports it ) and also most likely doesnt support non power of 2 sized textures
Quote:Original post by zedz
it sounds like youre doing the lighting backwards

ie rendering scene + then applying the darkness over the top
usually ppl do it the same way as in reallife, for each object see what lights affect it + then render it that way.

Well, the problem is that I render several layers on the screen, first I render the groundlayer, on top of that I render objects like plants, stones etc, and after that I render creatures. And even after that I still have the effects, like fireballs to render.
Because of this I can't start off with leaving the "shadowmap" below and then multiplying everything onto it.

I have tried using glLight, and it works well, but when using it I only have access to a certain number of lightsources, and with over 30 characters in the screen at once, each wielding a torch, it would be hard to cover. Or maybe I have missed something important about it?

anyhow, glCopyTexSubImage2D seems like a rather good idea, except the fact that I will be copying the entire screen instead of a small area. Or is it limited to the viewport I am currently using?

This topic is closed to new replies.

Advertisement