Closed TontonTremblay closed 3 years ago
I’m not sure I follow what you’re doing. Could you explain the problem you’re working on a bit more?
entity ID shouldn’t be averaged over multiple frames, since then you’ll get invalid IDs at the boundary of objects.
Here is an example, look at the alpha .png on the boundaries, they are not hard boundaries. They are soft, so I could do a nice masking with this and put it over something else. But really this is used to train nerf. Check the link I shared to see how blender does it. You could imagine that this alpha is added to the final png by adding a flag.
Also look how I put the background at 0 and the rest at 1 then take the average to generate the smooth boundary.
Ah, I see. So you’d like the background color to be alpha transparent for primary rays? What should the behavior be for a mirror reflecting a transparent background?
Not really! What I want is given a pixel how many rays in that pixel hit the background vs. how many hit any geometries.
So for a given pixel you can do a sum(hit_geometry)/num_of_rays. You can also think about it as computing anti-anliaising for that given pixel.
sum(hit_geometry)/num_of_rays
what you are describing is exactly what I just said. 😅 We call this alpha transparency, and it’s done by setting the background color to something transparent.
Sounds like you don’t need anything fancy yet for secondary rays.
This has been added. Pass the alpha value to the background in the domelight or in the hdri 4th channel.
Hi,
I also ran into the issue of wanting to generate object masks and they're not antialiased. I did not understand the proposed solution: would it be perhaps possible to have some example code? Thank you!
So right now computing the alpha with the background is slowing my rendering pipeline a lot.
The code looks like something like this:
Would it be possible to have a render_data file like "alpha_background" and it takes as input spp as well. Really want I want is pretty much antianliasing output from the render.
An other approach could be like blender does. Add the alpha blend to the rendered png as a flag in nvisii? https://blender.stackexchange.com/questions/1303/can-blender-render-pngs-with-the-background-transparent.
Thoughts?