Weird Alpha Issue with FiberFX

Destriarch

New member
There's a peculiar problem with FiberFX. Seems like a bug but... well, let me explain.

I'm trying to create an image alpha mapped for a sprite, but anywhere there are fibres, there is a very, very slight dip in alpha, even when there's another opaque object behind it. You can see it in the finished image as it moves, and it's quite visible in the alpha map buffer. I have no idea why this would happen, but I can't be going around fixing every single render's alpha channel manually, and I need fiberFX for hair and similar systems to produce accurate alpha maps.

Here's a clip of the alpha map. Notice how you can distinctly see the fur's texture, even though it's growing from a solid object:
Screenshot 2021-04-19 at 07.36.40.png


Anyone know what causes this and how I can prevent it?
 

Destriarch

New member
Further info: issue seems to occur when setting 'tip transparency' to a value above 0 in the Hair material, although setting 'End Caps' to None in FiberFX bizarrely still results in faulty alpha maps. Not sure what to do about this right now. Capping the fibre tips with transparency increases the visual appeal of the image significantly, but if it's going to ruin the alpha map in the process I'm not sure it's worth it.
 

Destriarch

New member
I'd still love to know if there is a way of avoiding this issue, but in the meantime I've made a workaround. It's a bit overkill, but I've essentially made a small Mac app that merges the alpha values of two images, taking whichever value is the higher. I then render the same image twice, one with fibrefx turned on and one with it turned off, and feed it through my little Mac app. The result is a nice image transparency with perfect fur alpha.
 

lardbros

Not so newbie member
My guess would be:
If you set tip transparency, it means the renderer needs to trace through each and every fiber.

This could mean that it needs a tonne of ray recursions in order to reach the opaque object at the back. Unfortunately, in LW, before it reaches the ray limit, it defaults to a transparent alpha.

There are ways to force the rays to be changed after a certain number of bounces, which you'd probably require for this. It needs the ray-switcher node, and some jiggery pokery using that.
 

lardbros

Not so newbie member
Just tested this theory here and it does seem to be the case.
Low 'Refraction Recursion Limit' causes the alpha to be like your example.

Need to make sure your 'Ray Recursion Limit' AND the 'Refraction Recursion Limit' AND the 'Transparency Recursion Limit' are higher than the number of fibers the ray will pass through on its route to the hair growing object.

After toying about, it seems as though Transparency Recursion of 1, will allow a dense alpha, even with the Ray Recursion Limit set to 6.
There is a bug here somewhere, but at least you might be able to work around it.
 
Top Bottom