Issue With Too Many Alpha Textured Meshes

Use this forum for general user support and related questions.
Post Reply
rrubberr
Posts: 9
Joined: Sun Mar 25, 2018 5:21 am

Issue With Too Many Alpha Textured Meshes

Post by rrubberr » Sat Jul 28, 2018 5:01 am

Hi, I've had an issue since I originally started using Luxrender around version 1.4 of original Lux where, when trying to render grass with flat texture cards, the particularly dense areas where the "alpha" of the grass cards overlap turns black.
testt1.png
An example of this showing the entire scene thus far.
testt1ex.png
A zoomed in example.
The weird part about this is that it doesn't happen in the trees, which have many overlapping leaves, but it does happen in the grass. I have tried increasing the maximum light depth, but it doesn't seem to resolve the issue.

Does this have to do with using a particle system to place the grass, or is it just because there are so many layers of grass? Any assistance is greatly appreciated.

User avatar
B.Y.O.B.
Developer
Posts: 1316
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Issue With Too Many Alpha Textured Meshes

Post by B.Y.O.B. » Sat Jul 28, 2018 9:16 am

Can you show your material node setup?
Are you using the opacity socket or still the old "mix with null"? The opacity socket is a lot faster.
If I remember correctly, it should also not be dependent on the path depth, however in a quick test I can reproduce a darkening effect that appears weakly when stacking 16 planes behind each other and grows stronger when more planes are added, eventually leading to a black area.

It might be a bug in LuxCore.
I opened an issue: https://github.com/LuxCoreRender/LuxCore/issues/124

(These were all rendered with path depth 1):
Attachments
0001.jpg
0002.jpg
0003.jpg
0004.jpg
0005.jpg
0006.jpg
0007.jpg
0008.jpg
0009.jpg
0010.jpg
0011.jpg
opacity.blend
(894.98 KiB) Downloaded 4 times
opacity_LuxCore.zip
(539.96 KiB) Downloaded 3 times
Support LuxCoreRender project with salts and bounties

rrubberr
Posts: 9
Joined: Sun Mar 25, 2018 5:21 am

Re: Issue With Too Many Alpha Textured Meshes

Post by rrubberr » Sat Jul 28, 2018 3:29 pm

B.Y.O.B. wrote:
Sat Jul 28, 2018 9:16 am
Can you show your material node setup?
Are you using the opacity socket or still the old "mix with null"? The opacity socket is a lot faster.
If I remember correctly, it should also not be dependent on the path depth, however in a quick test I can reproduce a darkening effect that appears weakly when stacking 16 planes behind each other and grows stronger when more planes are added, eventually leading to a black area.

It might be a bug in LuxCore.
I opened an issue: https://github.com/LuxCoreRender/LuxCore/issues/124

(These were all rendered with path depth 1):
I was using the mix with null method, but I will update all of my transparencies to use opacity instead. Thank you for the tip.

No way to solve it though, currently?

User avatar
Dade
Developer
Posts: 1187
Joined: Mon Dec 04, 2017 8:36 pm

Re: Issue With Too Many Alpha Textured Meshes

Post by Dade » Sat Jul 28, 2018 4:11 pm

I think I have already described this problem some time ago :?: It isn't exactly a bug but a quite complex problem.

Long story short: the code needs an undefined and unbounded number of random variables to handle multiple layers of transparent objects however it receives only one single random variable from the sampler (because it can only generate a bounded number of variables).
So, the only solution was to generate a new random variable starting from the previous one, when new layer of transparent surface is found. The problem is that this operation requires more and more numerical precision each layer you find. With only 32bit floating point numbers, it runs out of "bits" after few layers (ending probably to generate always 0.0 as value).

However, in the mean time, I had the same problem when I re-wrote the volume rendering code and I used there a new solution, one that doesn't suffer from the numerical precision problem.

Now, I have applied the same solution used for heterogeneous volume rendering, to the generic scene intersection code and it seems to works fine and to solve the above problem:
opa.jpg
Support LuxCoreRender project with salts and bounties

rrubberr
Posts: 9
Joined: Sun Mar 25, 2018 5:21 am

Re: Issue With Too Many Alpha Textured Meshes

Post by rrubberr » Sat Jul 28, 2018 7:28 pm

Dade wrote:
Sat Jul 28, 2018 4:11 pm
Now, I have applied the same solution used for heterogeneous volume rendering, to the generic scene intersection code and it seems to works fine and to solve the above problem:
Thank you for the quick fix.

User avatar
Sharlybg
Supporting Users
Posts: 636
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Issue With Too Many Alpha Textured Meshes

Post by Sharlybg » Sat Jul 28, 2018 10:59 pm

Now, I have applied the same solution used for heterogeneous volume rendering, to the generic scene intersection code and it seems to works fine and to solve the above problem:
Wow just like black magic. Like listen the best of Mozart. You are an artist i think.playing with line of code like that is just mind blowing.
Thank you.
Support LuxCoreRender project with salts and bounties

Post Reply