Re: [PyOpenGL-Users] More difficulties with framebuffers
Brought to you by:
mcfletch
From: Christopher B. <Chr...@no...> - 2010-12-22 18:29:23
|
Sorry for the slow response -- lots going on here. Derakon wrote: > I took a look at your code, but it looks like you're doing this all > "manually" while I'm trying to leverage OpenGL to do the work for me. I'm not sure that's true. We do break the process down into two stages: 1) generate the tiles at different zoom levels. 2) render them. 1) is done without using OpenGL at all. Perhaps we should have used it, but we've had in mind being able to use different rendering back-ends, for instance for PDF generation or printing, so we wanted to b able to have the tiles without any OpenGL. We've also separated the generation of tiles from rendering because we may well want to use tiles that are pre-generated, such as from OpenStreetMap and the like. 2) The rendering stage is using OpenGL as much as I know how. For a given zoom level, we need to determine which scale of tiles to use, which specific tiles to use, how they are scaled to OpenGL coords, then pass them in. Isn't that what you are doing? > The basic flow of my code is: > > Main render function: > if zoomed far out: > render each megatile in view > else: > render each individual tile in view That's pretty much what we do, except we have many levels of zoom -- it looks like you have only two. > Add new tile function: > find megatile(s) that this tile overlaps > render tile to megatiles ahh -- that is a bit different. rather than renderintg each tile each time, you render to a megatile, then just render that. What is the advantage of that, why not just render the tiles directly? I suppose that does take a Python loop, but I don't think that's very slow in this case. Our tiles are 256X256, so for a 1000X1000 screen, that's 16 tiles --not many at all. > Something is going wrong in the "render to megatile" code, since when > I render the megatile later in the main render function, its scale is > off. But I can't figure out why. It is a real pain to get the math right for that kind of thing. All I can suggest is some really tedious debugging/print statements, and check the math at each step. good luck, -Chris > -Chris > > On Thu, Dec 16, 2010 at 4:31 PM, Christopher Barker > <Chr...@no...> wrote: >> On 12/16/10 4:26 PM, Christopher Barker wrote: >>> Sorry, no time to try to take a look at your code, but we have a similar >>> system in maproom, for rending tiles at different zoom levels, maybe it >>> will help you figure out your issue: >>> >>> https://bitbucket.org/dhelfman/maproom/wiki/Home >> I think this is the relevant file: >> >> https://bitbucket.org/dhelfman/maproom/src/668ea464624e/maproomlib/plugin/Tile_set_layer.py -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |