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: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Musgrove Texture Issues

Post by Racleborg »

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 209 times
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Musgrove Texture Issues

Post by B.Y.O.B. »

Thanks for the report, fixed.
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Musgrove Texture Issues

Post by Racleborg »

@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 210 times
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Musgrove Texture Issues

Post by B.Y.O.B. »

Fixed.
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Musgrove Texture Issues

Post by Racleborg »

@B.Y.O.B

Thank you :)
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Musgrove Texture Issues

Post by Racleborg »

@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 193 times
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Musgrove Texture Issues

Post by B.Y.O.B. »

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: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: Musgrove Texture Issues

Post by Racleborg »

@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
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Musgrove Texture Issues

Post by B.Y.O.B. »

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
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Musgrove Texture Issues

Post by B.Y.O.B. »

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