mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix: Cycles magic texture differs from OSL and EEVEE
The wrapping introduced in 57f46b9d5f was different for SVM than other
implementations, multiplying scale at a different point.
Pull Request: https://projects.blender.org/blender/blender/pulls/157532
This commit is contained in:
parent
e73813f5aa
commit
577d93f283
1 changed files with 6 additions and 6 deletions
|
|
@ -28,13 +28,13 @@ ccl_device_noinline_cpu float3 svm_magic(const float3 p,
|
|||
* smaller value. This is due to the value in the -2*PI to 2*PI range
|
||||
* effectively being lost due to floating point precision.
|
||||
*/
|
||||
const float px = fmodf(p.x, M_2PI_F);
|
||||
const float py = fmodf(p.y, M_2PI_F);
|
||||
const float pz = fmodf(p.z, M_2PI_F);
|
||||
const float px = fmodf(p.x * scale, M_2PI_F);
|
||||
const float py = fmodf(p.y * scale, M_2PI_F);
|
||||
const float pz = fmodf(p.z * scale, M_2PI_F);
|
||||
|
||||
float x = sinf((px + py + pz) * 5.0f * scale);
|
||||
float y = cosf((-px + py - pz) * 5.0f * scale);
|
||||
float z = -cosf((-px - py + pz) * 5.0f * scale);
|
||||
float x = sinf((px + py + pz) * 5.0f);
|
||||
float y = cosf((-px + py - pz) * 5.0f);
|
||||
float z = -cosf((-px - py + pz) * 5.0f);
|
||||
|
||||
if (n > 0) {
|
||||
x *= distortion;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue