Musgrove Texture Issues

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Racleborg
Posts: 618
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Musgrove Texture Issues

Post by Racleborg » Sun Jan 24, 2021 2:19 pm

Hi there

The Dimension, lacunarity, Octaves and Intensity values don't appear to be working in the Blender Musgrove Texture?

(See attached files)

Cheers
Attachments
Capture.PNG
high val settings.PNG
Test Musgrove.blend
(1.79 MiB) Downloaded 23 times

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

Re: Musgrove Texture Issues

Post by B.Y.O.B. » Tue Jan 26, 2021 2:27 pm

Thanks for the report, fixed.

Racleborg
Posts: 618
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Musgrove Texture Issues

Post by Racleborg » Tue Jan 26, 2021 4:34 pm

@BYOB

Thank you

I don't think the Noise Depth is working on the Marble texture, either. (attached Files)
Attachments
MARBLE 1000.PNG
MARBLE LOW.PNG
Test MARBLE.blend
(1.78 MiB) Downloaded 21 times

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

Re: Musgrove Texture Issues

Post by B.Y.O.B. » Tue Jan 26, 2021 5:27 pm

Fixed.

Racleborg
Posts: 618
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Musgrove Texture Issues

Post by Racleborg » Tue Jan 26, 2021 11:56 pm

@B.Y.O.B

Thank you :)

Racleborg
Posts: 618
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Musgrove Texture Issues

Post by Racleborg » Thu Jan 28, 2021 3:09 pm

@B/Y.O.B

In the Blender Marble Texture, the Noise depth appears to be doing some strange stuff at a value of 29 and above.
(attached files).
Attachments
val 30.PNG
Test MARBLE.blend
(1.78 MiB) Downloaded 25 times

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

Re: Musgrove Texture Issues

Post by B.Y.O.B. » Thu Jan 28, 2021 4:50 pm

Racleborg wrote:
Thu Jan 28, 2021 3:09 pm
In the Blender Marble Texture, the Noise depth appears to be doing some strange stuff at a value of 29 and above.
(attached files).
I suspect the problem is here: https://github.com/LuxCoreRender/LuxCor ... .cpp#L1399
(the noise depth is called "oct" in the code)

In this code, a signed integer 1 is bit-shifted to the left by oct + 1 places. Since an integer typically has 32 bits, the maximum we can shift is by 31, and since 1 is added to oct in the equation, oct should be limited to 30. And indeed, in the original Blender UI for the old marble texture, the noise depth is limited to 30.

Now, I'm not sure why the code would make problems from oct = 29 on like in your example. Maybe that problem is elsewhere.

One thing I noticed is that the integers should be unsigned (u suffix), but I'm not sure if the compiler automatically detects and fixes this.
So the expression would be:

Code: Select all

((float)(1u << oct) / (float)((1u << (oct + 1)) - 1))

Racleborg
Posts: 618
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Musgrove Texture Issues

Post by Racleborg » Thu Jan 28, 2021 5:08 pm

@B.Y.O.B

Thank you for the explanation :)

Could the input be restricted to a maximum of 29?

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

Re: Musgrove Texture Issues

Post by B.Y.O.B. » Thu Jan 28, 2021 5:16 pm

Racleborg wrote:
Thu Jan 28, 2021 5:08 pm
Could the input be restricted to a maximum of 29?
It should be max. 30 and the other bug causing it to fail at 29 should be found and fixed.

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

Re: Musgrove Texture Issues

Post by B.Y.O.B. » Thu Jan 28, 2021 6:19 pm

Since fscale is multiplied by 2 each loop iteration, it just gets very big. This causes the call of noisefunc() to return NAN at around iteration 29. When x, y, z are bigger values, maybe even sooner.

I don't know how/if the Blender developers dealt with this.
I would suggest to lower the max. noise depth even further to mitigate the problem, maybe to a max of 25. Note that most of the time, much lower noise depth values will be used, as the difference between them gets indistinguishable at low numbers like 8 or so.

Post Reply