Home Technical Talk

Automatically reducing Overdraw?

polycounter
Offline / Send Message
Davision3D polycounter
Overdraw (transparent pixels rendered on top of other transparent pixels) can be really taxing on performance and I was wondering if there are any good solution for automatically reducing overdraw? Like the mesh planes get automatically tweaked so that its roughly only around the visible pixels.

The best case would be some plugin for Blender that does it but I couldn't find much on the topic in general. I however know that UE4 has some automatic overdraw mesh plane adjustment for particles. In my case I need it for hair cards for a character for a Unity game. I'm already at the stage where I have all the haird cards drawn through Gravity Sketch so I don't have just a few hair card mesh instances that I could tweak manually.

Replies

  • Eric Chadwick
    Hmm, that would be pretty cool to have. You would probably have to use a voxelize system, and remesh. Not sure if that's available anywhere though. And you would likely cause significant new interpenetrations with the new topo, since it would be averaged from the voxels. It's an interesting problem!
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Working on the assumption that you're not using alpha blending on the hair shader (if you are you're doing it wrong ) it shouldn't be a massive problem provided you're lodding, not using thousands of cards and are mostly filling them up with hair. 

    simplygon has some tools for clipping faces out if they're not visible but you're asking for something that trims your hair cards to more closely fit the alpha right? If so it's not an especially difficult tool to write - I made a simple script for max years ago that gridded a mesh up into roughly pixel sized quads, chopped off the transparent bits and then decimated the result. With a bit of refinement something like that would probably work fairly well. 

    tbh though, it feels like you've done this in the wrong order. I'd be looking at ways to generate splines from the existing cards and deforming new meshes to them - anything that involves processing a poly soup like this is just a pain in the arse 
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    I actually happen to be working on something like this... But its an Unreal tool. You give it an opacity map and it returns a convex or concave hull of the shape based on a user set vertex count.  Similarly to the particle cutout feature.There are several limitations of the tech I'm currently using though.  Also, I need to agree with that this should not be a real issue with alpha test. My original intention was to target this tool towards foliage and cutting them out from an atlas and produce a triangle fan type of a mesh. I have not thought about usage on hair.But its an interesting thought. Feel free to hit me up with some example files if you have them.
  • thomasp
    Offline / Send Message
    thomasp hero character
    My question would be what these hair textures look like and how they are being mapped? At least I'm not seeing a lot of empty space in any that I'm working with.

    Hair drawn through Gravity Sketch sounds ... unusual as a workflow for starters. Perhaps there's room for optimization there?

  • Davision3D
    Offline / Send Message
    Davision3D polycounter
    poopipe said:
    Working on the assumption that you're not using alpha blending on the hair shader (if you are you're doing it wrong ) it shouldn't be a massive problem provided you're lodding, not using thousands of cards and are mostly filling them up with hair. 

    simplygon has some tools for clipping faces out if they're not visible but you're asking for something that trims your hair cards to more closely fit the alpha right? If so it's not an especially difficult tool to write - I made a simple script for max years ago that gridded a mesh up into roughly pixel sized quads, chopped off the transparent bits and then decimated the result. With a bit of refinement something like that would probably work fairly well. 

    tbh though, it feels like you've done this in the wrong order. I'd be looking at ways to generate splines from the existing cards and deforming new meshes to them - anything that involves processing a poly soup like this is just a pain in the arse 

    As I understand it with alpha clip the transparent pixel are the problem because every transparent pixel on top takes extra rendering time. While with alpha blend its simply all pixels are considered transparent and add up.

    Yea, it should trim existing cards. That approach sounds interesting, not so sure if a grid pattern with quads deleted allows for good decimation though.

    Definately would have been much better to work with instances or make meshes for each hair texture trimed before hand. However that is not possible with any VR program I know. In VR its super fast to draw hair cards thats why I used Gravity Sketch.

    Obscura said:
    I actually happen to be working on something like this... But its an Unreal tool. You give it an opacity map and it returns a convex or concave hull of the shape based on a user set vertex count.  Similarly to the particle cutout feature.There are several limitations of the tech I'm currently using though.  Also, I need to agree with that this should not be a real issue with alpha test. My original intention was to target this tool towards foliage and cutting them out from an atlas and produce a triangle fan type of a mesh. I have not thought about usage on hair.But its an interesting thought. Feel free to hit me up with some example files if you have them.
    Interesting but wouldn't you do all foliage with alpha test as well? Or is this purely for saving texture space?

    I can't share anything since its client work but its basically noisy hair strubby hair.

    thomasp said:
    My question would be what these hair textures look like and how they are being mapped? At least I'm not seeing a lot of empty space in any that I'm working with.

    Hair drawn through Gravity Sketch sounds ... unusual as a workflow for starters. Perhaps there's room for optimization there?

    Its very strubby hair, I have one hair card texture that is square and hair kinda goes in all directions which i use throughout the character to break up the combed strands look you easily get with hair cards. Optimizing that alone or getting rid of it would theoretically improve it a lot.

    Gravity Sketch is just for the VR aspect because just drawing in VR is very fast compared to any desktop workflow. It auto generates those meshes on the fly but with Blender decimation you basically can get them any polycount but not in any way optimized for pixels.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    @Davision3D - I making this so that I don't have to cut things out from atlases by hand.
Sign In or Register to comment.