Off-Topic Discussion > Programming

Finally starting to learn OpenGL

<< < (2/2)

The E:

--- Quote from: Flipside on May 16, 2015, 03:45:56 pm ---Been looking through things, the downside to a shader is that FBO's aren't very frequent update compatible, so I'm rendering the main texture to the main window in live mode, though the Menus etc may well make it to a buffer.

--- End quote ---

That's.... not true. FBOs are very definitely usable with frequent updating; after all, this is how you do render-to-texture in OpenGL.

See, this is part of the problem I'm facing, every tutorial has its own favourite ways of doing things and its own collection of misunderstandings or downright falsehoods.

The first tutorial I did defined vertices on a 2D Quad where 0,0 was the top-left corner, but some other tutorials use a system where 0,0 is the centre, still not sure which is 'right', that could quite possibly be because some of the tutorials are for 2D and others are for 3D. I'm using the 0,0 system anyway because I'm lazy and its easier to calculate actual position on screen from the xy location using it, rotation required a bit of Translatef fun, but nothing serious.

I've been looking up more on FBO's since my last post, since they seemed like the solution to most of my problems with regards to rendering, positioning and constraining stuff, and it does appear that whoever said that FBO's didn't like being updated was talking rubbish.

I'll probably look at starting to move things over today or tomorrow. On the plus side, it should make zooming in a lot easier, since I can resize the entire block of graphics depending on magnification rather than each tiles size and position, which causes a slight 'juddering' effect with the tiles, probably, due to the whole float/integer thing.

Just one bit of advice I would ask from anyone who knows. The system I use only worries about 'room' areas, each room is stored as an array structure, with the gaps between them ignored, so, rather than drawing a 2D grid with tiles on for a map, the engine just draws the rooms that are currently on screen (think Dungeon Keeper where ONLY the rooms are rendered). Would it be better to render each room as an FBO and then render those onto a final FBO to generate the main display, or to render it all to one FBO. The former seems easier to comprehend and code around in the future, the second seems faster, and means I would only have to toggle any light-shaders etc, once per render pass, rather than for each room area. (Edit - Not strictly true on consideration, I can turn on the shader, then cycle through rooms, then turn it off)

It's not so much a question of which is 'right' or 'wrong', either would work I suspect, but just wondering what people would suggest?


[0] Message Index

[*] Previous page

Go to full version