OpenGL Terrain editor#59
Conversation
|
I'm wondering if I should remove the VBOs. GPU cached terrain triangles. Just re-draw them every frame there's not a huge amount of them even when zoomed out fully and diff might be a bit smaller/closer to original. |
| // BEGIN: /GFX/TEXTURES/TEX5.LBM | ||
| TILESET_GREENLAND_8BPP, | ||
| TILESET_GREENLAND_32BPP, | ||
| TILESET_GREENLAND, |
There was a problem hiding this comment.
Doesn't this break stuff? IIRC those were used as indices somewhere
There was a problem hiding this comment.
s25edit has P button to toggle 8bit/32bit terrain rendering marked experimental in F1 help window text.
Doesn't really make sense, maybe it was to add shadows. With OpenGL textures always being 32bit it really doesn't make sense to keep.
Also CFile had a pre-existing bug it would intermittently use the wrong colorkey and not have transparency on terrain edges.
Seems to make sense to use them given the map is mostly static. Do the VBOs still handle animated textures correctly? That would be a reason to not use them. Or limit to positions only, but I guess that wouldn't save much work
What do you mean by that? |
|
I mean relative to modern games a settlers2 map doesn't have many triangles. Biggest gain will be getting rid of 4K penalty ~33MB/frame ~2GB/second@60fps. yeah VBO is useful, but increases diff a lot and makes review harder for probably not too much benefit. Might be better to do as follow up. Also I just struggled to get nice diff that correctly aligns functions with all the the VBO code inserted above existing code. |
|
Also this PR still draws triangles to pixel positions and recalculates them on zoom. Would be better to use glScale(). But I think doesn't matter here can do in later PR, there's a lot more that could be done that would make PR bigger. |
| } | ||
|
|
||
| void CSurface::DrawTriangleField(SDL_Surface* display, const DisplayRectangle& displayRect, const bobMAP& myMap) | ||
| void CSurface::DrawTriangleField(const DisplayRectangle& displayRect, const bobMAP& myMap) |
There was a problem hiding this comment.
The diff for this function is unreviewable.
At least the method signature lines up in the diff now after removing VBO.
I'm going to do some more work and see if improve reviewability. I think we're mostly doing the same thing in same order so shouldn't look like this.
There was a problem hiding this comment.
Ok I now consider it reviewable.
Maybe still some details left still, but reviewable.
This branch has been really crazy. Basically went too far, and finished it by going backwards.
Crazy times with AI.
There was a problem hiding this comment.
Also would like to merge #57 before this one cause ice floe animations don't work.
2017269 to
beee331
Compare
Removes Surf_Map and renders terrain editor with OpenGL
It actaully works great as parallel branch & PR, only depends on some CFont and Texture changes from gl2-ui which have been pulled into this branch. If they are identical they shouldn't even conflict. Could extract to shared parent commit, but prob easiest to deal with any conflicts when the other/this PR is merged. There's minimal overlap.
Still working a bit on this one I didn't expect to submit it so early, but all feedback welcome even if quick and inaccurate.