Sounds like a job for the stencil buffer!
..oh.. wait..
(Be forewarned that I typed this on my phone whilst very sleepy, I won't be home for a while, so if I'm rambling, please, ignore it.)
Yeah, with a stencil buffer you could take pics1 and make an overlay of sorts where black pixels are non-filtered and white pixels are filtered, then for the problem tiles that are half grass half non-grass, draw over them with the stencil buffer to crop out that specific area.
In current, non-stencil buffer Graal, you could draw it as a big overlay, then draw non-grass tiles from a separate pics1 with teansparency where the grass should show up on tip of that image. This would probably lag on older machines, though. Perhaps the best solution is to do the previously mentioned for only "problem tiles" that are half grass half non grass and separate the rest into tile layers, although I'm unsure how tile layers work exactly and if you can draw under them while still maintaining that the player be drawn above them.
Furthermore, I'm sure you can come up with something remotely satisfactory if you were to "bake" it into the level by automating the entire process via a third party scrypt you can write in Python or whatnot to redraw the level based on tile indexes that you send over, use a special pics1 with white being grass and black being non grass, parse out the grass parts via the black or white pixel color, I guess, make a 1024x1024 overlay for the entire level that is only on the grass portions, and send it back to the server to be downloaded and drawn by the client via a system NPC, all of which is perfectly doable in PHP with the GD library, or Python, or whatever you so choose to interface with on the server. And it would only have to be calculated once per level, forever and ever. That's what I did for my lightmapping system and it worked fabulously, with extremely zero lag since it's simply a 1024x1024 graphic being drawn over the screen at the level's top left corner.
Orrrrrr you can try and tinker with TDrawingPanels, but I wish you luck in getting those to work without freezing the client for a good two or three minutes while you redraw the level to a GUIControl, parse out the grass sections, and draw your detail texture to the grass areas to overlay.
Your best bet? The second to last method I described. Hooray for anything that looks good in Graal being a huge ****in' hack. |