Blender Git Commit Log

Git Commits -> Revision 57f46b9

Revision 57f46b9 by William Leeson (master)
December 10, 2021, 08:09 (GMT)
Fix T92036: `Magic Texture` in Volumetric World Shaders render differently with the CPU and GPU

When rendering volume surfaces in unbounded worlds the volume stepping can produce large values. If used with a magic texture node the values can results in a Inf float which when used in a sin or cos produces a NaN.

To fix this the input values are mapped into the periodic range of the sin and cos functions (-2*PI 2*PI) this stops the possibility of a Inf occurring and thus the NaN. It also improves the accuracy and smoothness of the result due to loss of precision when large values are summed with smaller ones effectively removing the parts of the smaller number (i.e. those in the -2PI to 2PI range) that result in variation of the output of sin and cos.

Reviewed By: brecht

Maniphest Tasks: T92036

Differential Revision: https://developer.blender.org/D12821

Commit Details:

Full Hash: 57f46b9d5f370dfacc92786dab596060400a21a8
Parent Commit: 566a458
Lines Changed: +32, -12

3 Modified Paths:

/intern/cycles/kernel/osl/shaders/node_magic_texture.osl (+9, -6) (Diff)
/intern/cycles/kernel/svm/magic.h (+21, -5) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_tex_magic.glsl (+2, -1) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021