Fix T48301: Cycles incorrect render with CMJ and viewport samples 0.

Max samples 2147483647 was causing integer overflow.
This commit is contained in:
Brecht Van Lommel 2016-04-28 23:46:00 +02:00
parent a48d740798
commit 636195e402
Notes: blender-bot 2023-02-14 07:56:10 +01:00
Referenced by issue #48300, Using the Search Menu (Spacebar) outside the 3D View can cause crashes, mouse pointer capture in certain cases
Referenced by issue #48301, Correlated multi-jittered Renderd Viewport Bug
2 changed files with 10 additions and 10 deletions

View File

@ -193,57 +193,57 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
cls.aa_samples = IntProperty(
name="AA Samples",
description="Number of antialiasing samples to render for each pixel",
min=1, max=10000,
min=1, max=2097151,
default=4,
)
cls.preview_aa_samples = IntProperty(
name="AA Samples",
description="Number of antialiasing samples to render in the viewport, unlimited if 0",
min=0, max=10000,
min=0, max=2097151,
default=4,
)
cls.diffuse_samples = IntProperty(
name="Diffuse Samples",
description="Number of diffuse bounce samples to render for each AA sample",
min=1, max=10000,
min=1, max=1024,
default=1,
)
cls.glossy_samples = IntProperty(
name="Glossy Samples",
description="Number of glossy bounce samples to render for each AA sample",
min=1, max=10000,
min=1, max=1024,
default=1,
)
cls.transmission_samples = IntProperty(
name="Transmission Samples",
description="Number of transmission bounce samples to render for each AA sample",
min=1, max=10000,
min=1, max=1024,
default=1,
)
cls.ao_samples = IntProperty(
name="Ambient Occlusion Samples",
description="Number of ambient occlusion samples to render for each AA sample",
min=1, max=10000,
min=1, max=1024,
default=1,
)
cls.mesh_light_samples = IntProperty(
name="Mesh Light Samples",
description="Number of mesh emission light samples to render for each AA sample",
min=1, max=10000,
min=1, max=1024,
default=1,
)
cls.subsurface_samples = IntProperty(
name="Subsurface Samples",
description="Number of subsurface scattering samples to render for each AA sample",
min=1, max=10000,
min=1, max=1024,
default=1,
)
cls.volume_samples = IntProperty(
name="Volume Samples",
description="Number of volume scattering samples to render for each AA sample",
min=1, max=10000,
min=1, max=1024,
default=1,
)

View File

@ -175,7 +175,7 @@ ccl_device void cmj_sample_2D(int s, int N, int p, float *fx, float *fy)
#else
int m = float_to_int(sqrtf(N));
#endif
int n = (N + m - 1)/m;
int n = (N - 1)/m + 1;
float invN = 1.0f/N;
float invm = 1.0f/m;
float invn = 1.0f/n;