Overlapping transparent objects crash CUDA, need to redesign shader?

I think this is the right board, as opposed to Technical Support. I’ve found at least broadly what is causing the problem, I just need help getting the same effect in a different way.

The short version is this: I have a blend file which reliably causes a CUDA crash when rendering (or viewing in viewport render) in certain positions. While I don’t know the precise cause, a bunch of trial-and-error and looking at debug output has led me to determine that it has something to do with the transparency in a material that I have made. So I need to redesign the material , and an hoping I could get a nudge or three in the right direction.

The longer version:

I am making a feathered wing rig, using mesh feathers. I am going for a somewhat cartoony style rather than photorealism.

My material mixes a transparent BSDF with anistropic based on the “pointiness” input, in order to make the edges of each feather fade into invisibility instead of just stopping abruptly. It isn’t really PBR, but I really like the look.

The problem is that when rendering a whole wing’s worth of the feathers, especially when the wing is folded so they are overlapping even more (and occasionally intersecting) I get a CUDA crash, or a full on blender crash.

The actual error that seems to refer to the crash in the console is “WM_operator_last_properties_store: storing properties for ‘INFO_OT_reports_display_update’” but I’m not specifically looking for help in interpreting that. My GPU memory usage when it crashes is less than a gig out of the 8 my card has, for reference

I’ve found that I can avoid the crash by either turning down the transparency bounces to 3 or so, or just replacing the transparent shader node with translucent.

So while I don’t know PRECISELY what is causing it, but it’s obviously something related to having a zillion overlapping and intersecting transparent meshes causing an overflow or something similar. But when it doesn’t crash, the shader effect is SO PRETTY, and using translucency instead of transparency doesn’t look nearly as nice.

So… does anyone have any suggestions on what I might do to deal with this? Even when it doesn’t cause a crash, the render time is massively bigger with the transparency node in there. Is there perhaps some way to have it automatically cull out the overlapping or intersecting parts of the feather meshes? If not, I guess I’ll live and find another approach.

Here is my blend file: https://www.dropbox.com/s/dv5gldjesr4htnf/new%20wings2.blend?dl=0

The material in question is “Anisitropic feathers”. I have animation set up, so going from frame 1 to 50 will fold the wings.

For reference here is what it looks like when it doesn’t crash:

Any help would be appreciated, but I also appreciate that people only have so much time to help neophytes with their problems. :slight_smile:

CUDA crashes out on windows machines when it 1 samples takes longer then to compute then the TDR timeout… Which i think is 1 second or so. This is not a blender problem but a windows problem. (linux will render fine, it will just lock up your computer for longer)

Things you can do to prevent crashing
– Less Transparent bounces
– Reduce complexity in the shader
– Adding in a override based of the type of bounce (ie diffuse bounces get overridden with a diffuse shader etc.etc
– Reducing tile size (will only effect render tdr crashes, not viewport)
– Increasing TDR timeout in windows.

Good to know I’m not just totally full of fail, then. I wonder if you could elaborate on the “adding an override” suggestion? I get the idea, but I’m learning, so I’m not entirely sure how to implement that.