Sign in to follow this  
Exustio

Substitute for Framebuffer Objects?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this