WO2013082995A1 - Method for decomposing sampling task - Google Patents

Method for decomposing sampling task Download PDF

Info

Publication number
WO2013082995A1
WO2013082995A1 PCT/CN2012/084748 CN2012084748W WO2013082995A1 WO 2013082995 A1 WO2013082995 A1 WO 2013082995A1 CN 2012084748 W CN2012084748 W CN 2012084748W WO 2013082995 A1 WO2013082995 A1 WO 2013082995A1
Authority
WO
WIPO (PCT)
Prior art keywords
sequence
code
context
niederreiter
steps
Prior art date
Application number
PCT/CN2012/084748
Other languages
French (fr)
Chinese (zh)
Inventor
阳赛
Original Assignee
Yang Sai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yang Sai filed Critical Yang Sai
Publication of WO2013082995A1 publication Critical patent/WO2013082995A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/06Ray-tracing

Definitions

  • the present invention relates to a computer image rendering method, and more particularly to a rendering method for determining a position of a sample point using a quasi-random number.
  • BACKGROUND OF THE INVENTION In the field of computer image rendering, in order to simulate various light and shadow effects, for example, depth of field, motion blur, global illumination, etc., it is necessary to evaluate an integral having the following form: f(x (1) , x (2) , .. .,x (s) )dx (1) dx (2) ...dx (s) (1) where / is the unit interval, and the function /( ⁇ ) is determined by the effect to be simulated and the input scene data.
  • the formula (1) can't be solved exactly.
  • the numerical calculation method is always used to find the approximate value:
  • the method for determining the position of the sample points ( ⁇ , ⁇ ,..., ⁇ in equation (2) can be divided into two categories, one is the method using random numbers, and the other is the method using quasi-random numbers.
  • a random number is a distribution pattern with a good structure, in the formula
  • the integral estimation of (2) can provide higher efficiency than random numbers.
  • the ⁇ t,s sequence is a major quasi-random number type.
  • the method for generating the first dimension component of the first point in a hexadecimal (t ⁇ ) sequence is as follows:
  • C j . (cH:. – is the (_jj) sequence of the _/dimensional generator matrix (generator matrices) whose coefficient e is the element in the finite field F b .
  • b ⁇ represents the integer in hexadecimal representation The first digit, ie
  • M is the selected maximum precision in hexadecimal notation.
  • D is the number of parallel processing units
  • N d is the number of sample points allocated by the Jth processing unit.
  • the number of sample points allocated by different processing units may be the same or different.
  • the generator matrix of the sequence used must be reversible, so a sequence of (J) sequences such as Niederreiter-Xing sequences that do not satisfy this condition cannot be used;
  • the present invention provides a computer image rendering method that implements decomposition of a sample task by a hierarchical replacement operation based on a ( ⁇ ) sequence.
  • a solution for achieving the technical object of the present invention includes the following steps:
  • ⁇ ⁇ is the number of sample points
  • D is the number of parallel processing units
  • N d is the Jth processing Explain the number of sample points allocated by the book unit, and the number of sample points allocated by different processing units may be the same or different;
  • the decomposition of the sample task is achieved by a hierarchical replacement operation, compared to a method of grouping the ⁇ t, s) sequences in a selected dimension to achieve decomposition of the sample task.
  • the present invention does not need to group the sample points in an additional dimension, and there is no restriction on the generation matrix of the (t) sequence, and can be applied to any type of ( ⁇ ) sequence, and the quality of the sample points is not parallel.
  • BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail in conjunction with the embodiments.
  • Table 1 lists examples of C++ code for calculating binary Niederreiter sequences: Instruction sheet 1
  • Itemp A (itemp » k); result
  • (itemp & 1) « (Bit_Count - i); return (result);
  • the maximum precision is set to 32 bits. The reason for setting a maximum precision is that in numerical calculations, it is neither possible nor necessary to perform infinitely accurate calculations.
  • the maximum dimension is set to 12 dimensions.
  • the role of setting the maximum dimension is that, on the one hand, the data of the generator matrix needed to calculate the ⁇ t , s) sequence needs to be stored in a computer-readable medium in advance, and it is impossible for any device in reality to store an infinite number of
  • the quality of quasi-random numbers is better than random numbers, as the dimension increases, the quality of quasi-random numbers will gradually decrease, so it is not necessary to use infinite-dimensional quasi-random numbers in practice.
  • the selection of the largest dimension is based on its quality parameters t and the set maximum precision.
  • the principle is that the quality parameter of the selected largest dimension should not exceed the set maximum precision.
  • Table 2 lists the quality parameters of the binary Sobol sequence, the Niederreiter sequence, and the Niederreiter-Xing sequence in different dimensions. The smaller the parameter, the higher the quality and the minimum is 0. Instruction sheet 2
  • the maximum dimension should be selected as 12 dimensions, because the quality parameters of the 12-dimensional Sobol sequence and the Niederreiter sequence are 31 and respectively. 30, not exceeding 32, and the quality parameters of the 13-dimensional Sobol sequence and the Niederreiter sequence are 35 and 34, respectively, exceeding 32.
  • context.prev index
  • Context context double t[2]; sampling(t, 2, context, (i++) * programCount + programlndex); Vector dir; generate_dir(dir, t); Color result; raytrace(result, context, dir); Instruction manual
  • Table 5 lists examples of C++ code that uses the code shown in Table 4 during rendering:
  • Context next context; double t[2]; sampling(t, 2, next);
  • Vector dir generate_dir(dir, t); raytrace(result, next, dir);
  • the same s) sequence is used for each group of the dimension components of the sample, ie binary Niederreiter sequences, except for the same (t, sequence can also use ⁇ t, s) sequences with the same base but different types, for example, the binary Niederreiter-Xing sequence.
  • the quality of the Niederreiter-Xing sequence is superior to the Sobol sequence and the Niederreiter sequence, there is a limitation in the use that the total sampling dimension must be determined in advance, and thus is not suitable as a universally applicable method in image rendering, but if currently The grouping dimensions are known and there will be no higher dimensionality, and the Niederreiter-Xing sequence can be used to replace the Niederreiter sequence for better rendering.
  • An extension of the (t, s) sequence is called a randomized (t) sequence (ranized ⁇ t , s) sequences , which is used to estimate the error magnitude of the integral approximation.
  • this randomization method can be used to alleviate the flaws in the image in the rendering of the animation, that is, using different random number pairs for different image frames in the animation rendering. Randomize to fade out the possible enamel patterns.
  • Table 6 lists the C++ code examples with the addition of randomization steps based on the code shown in Table 4:

Abstract

The present invention provides a computer image rendering method. According to the method, on the basis of a (t, s) sequence, a sampling task is decomposed through a hierarchical displacement operation. Compared with a method of carrying out grouping on the (t, s) sequence in a selected dimension to decompose a sampling task, in the present invention, grouping is not required to be carried out on sampling points in an additional dimension, and no limited condition exists for a generator matrix of the (t, s) sequence. Therefore, the method can be used for any type of (t, s) sequence and the quality of the sampling points is not influenced by the quantity of parallel processing units.

Description

说 明 书 一种用于采样任务分解的方法  Description A method for sampling task decomposition
技术领域 本发明涉及一种计算机图像渲染方法, 特别是一种利用拟随机数 ( quasi-random numbers )确定釆样点位置的渲染方法。 背景技术 在计算机图像渲染领域, 为模拟各种光影效果, 例如, 景深、 运动模糊、 全局光照等 需要对具有如下形式的积分进行求值: f(x(1),x(2),...,x(s))dx(1)dx(2)...dx(s) (1) 其中 / 为单位区间, 函数 /(·) 由所要模拟的效果及输入的场景数据决定。 公式(1) -般无法精确求解, 在实际的渲染过程中总是使用数值计算的方法求其近似值:
Figure imgf000002_0001
确定公式 (2)中釆样点位置 (χ ,χ^,...,χ 的方法可分为两类, 一类是使用随机数的 方法, 另一类是使用拟随机数的方法。 拟随机数是一种具有良好结构的分布模式, 在公式
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer image rendering method, and more particularly to a rendering method for determining a position of a sample point using a quasi-random number. BACKGROUND OF THE INVENTION In the field of computer image rendering, in order to simulate various light and shadow effects, for example, depth of field, motion blur, global illumination, etc., it is necessary to evaluate an integral having the following form: f(x (1) , x (2) , .. .,x (s) )dx (1) dx (2) ...dx (s) (1) where / is the unit interval, and the function /(·) is determined by the effect to be simulated and the input scene data. The formula (1) can't be solved exactly. In the actual rendering process, the numerical calculation method is always used to find the approximate value:
Figure imgf000002_0001
The method for determining the position of the sample points (χ, χ^,...,χ in equation (2) can be divided into two categories, one is the method using random numbers, and the other is the method using quasi-random numbers. A random number is a distribution pattern with a good structure, in the formula
(2)的积分估计中能够提供比随机数更高的效率。 The integral estimation of (2) can provide higher efficiency than random numbers.
{t,s) 序列是一种主要的拟随机数类型, 生成 6进制 (t^) 序列中第 个点的第 ·维 分量的方法如下:  The {t,s) sequence is a major quasi-random number type. The method for generating the first dimension component of the first point in a hexadecimal (t^) sequence is as follows:
Figure imgf000002_0002
其中 Cj.= (cH:。 — 为 (tj) 序列的第 _/维生成矩阵(generator matrices ) , 其系 数 e 为有限域 Fb 中元素。 b人 ή 表示整数 在 6进制表示下的第 位数字, 即
Figure imgf000002_0002
Where C j .= (cH:. – is the (_jj) sequence of the _/dimensional generator matrix (generator matrices) whose coefficient e is the element in the finite field F b . b ή represents the integer in hexadecimal representation The first digit, ie
M-1 M-1
i=∑ br{i)br 。 M为所选择的在 6进制表示下的最大精度。 i=∑ b r {i)b r . M is the selected maximum precision in hexadecimal notation.
r = 0  r = 0
[t,s) ;>歹! ό iH " "包 4舌: Sobol序歹' j、 Faure序歹' j、 Niederreiter序歹1 j 口 Niederreiter- Xing序列等。 不同的 (t^) 序列的区别在于其生成矩阵的构造方法不同。 说 明 书 并行计算是另一种提高公式 (2)效率的方法, 该方法将公式 (2)中对函数 /(·) 的釆样分 解为两个或更多的部分, 每一部分交由一个独立的并行处理单元进行处理: [t,s) ;>歹! ό iH ""Pack 4 tongue: Sobol serial number ' j, Faure sequence 歹 ' j, Niederreiter sequence 歹1 j mouth Niederreiter- Xing sequence. The difference between different (t^) sequences is that the construction methods of their generator matrices are different. The parallel calculation of the specification is another way to improve the efficiency of the formula (2). The method decomposes the function of the function /(·) into two or more parts in the formula (2), and each part is assigned to an independent Parallel processing unit for processing:
Figure imgf000003_0001
其中,
Figure imgf000003_0002
为釆样点的数量, D为并行处理单元的数量, Nd 为第 J个处理 单元分配的釆样点数量。 不同的处理单元所分配的釆样点数量可以相同也可以不同。
Figure imgf000003_0001
among them,
Figure imgf000003_0002
For the number of sample points, D is the number of parallel processing units, and N d is the number of sample points allocated by the Jth processing unit. The number of sample points allocated by different processing units may be the same or different.
任何拟随机数都可直接用于公式 (2) , 但要用于公式 (4)则须作适当的变换。  Any quasi-random number can be used directly in equation (2), but it must be used for equation (4).
为同时获得使用拟随机数和并行计算的好处, 美国专利申请 US Patent Application No.12/432,498公开日期 2010年 11月 4日提供了一种通过对 ( , s) 序列在一个所选择的维 度中进行分组以实现对釆样任务的分解的方法。 该方法主要有以下几个缺陷:  In order to simultaneously obtain the benefits of using quasi-random numbers and parallel computations, U.S. Patent Application No. 12/432,498, issued November 4, 2010, provides a sequence of (, s) in a selected dimension. A method of grouping to achieve decomposition of a sample task. This method mainly has the following defects:
需要一个额外的维度以实现对釆样点的分组;  An additional dimension is required to enable grouping of sample points;
所用 序列的生成矩阵须为可逆的, 因而像 Niederreiter-Xing序列这种不满足该 条件的 ( J) 序列则无法使用;  The generator matrix of the sequence used must be reversible, so a sequence of (J) sequences such as Niederreiter-Xing sequences that do not satisfy this condition cannot be used;
为获得最佳的釆样质量, 并行处理单元的数量须为所用 ( ,s) 序列的基数的冪, 即 3m>0 , 满足 D = bm , 其中 D为并行处理单元的数量, 6为 ( J) 序列的基数, 当该 条件不满足时, 釆样点的质量会下降。 发明内容 本发明提供了一种计算机图像渲染方法, 该方法基于 ( ^) 序列, 通过层級化置换操 作实现对釆样任务的分解。 In order to obtain the best sample quality, the number of parallel processing units must be the power of the base of the (,) sequence used, ie 3m>0, satisfying D = b m , where D is the number of parallel processing units, 6 is ( J) The cardinality of the sequence. When this condition is not met, the quality of the sample will decrease. SUMMARY OF THE INVENTION The present invention provides a computer image rendering method that implements decomposition of a sample task by a hierarchical replacement operation based on a (^) sequence.
实现本发明技术目的的方案, 包括以下步骤:  A solution for achieving the technical object of the present invention includes the following steps:
(Α) 对于渲染图像时需要求值的积分 f(x{l x{2 ...,x{s))dx{l)dx{2)...dx{s) 使用数值计算的方法求其近似值, 包括以下步骤: (Α) For the integral of the required value when rendering the image f(x {l x {2 ..., x {s) )dx {l) dx {2) ...dx {s) Use the numerical calculation method Its approximation includes the following steps:
将对函数 /(·) 的釆样分解为两个或更多的部分, 每一部分交由一个独立的并行处理 单元进行处理  Decompose the function /(·) into two or more parts, each part being processed by a separate parallel processing unit
/ / N o 其中, Νά 为釆样点的数量, D为并行处理单元的数量, Nd 为第 J个处理 说 明 书 单元分配的釆样点数量, 不同的处理单元所分配的釆样点数量可以相同也可以不同; / / N o where Ν ά is the number of sample points, D is the number of parallel processing units, and N d is the Jth processing Explain the number of sample points allocated by the book unit, and the number of sample points allocated by different processing units may be the same or different;
(B) 确定步骤 (A)中所述变量 的值的方法, 其中 Q≤id≤Nd—\ , \≤d≤D , 包括以下步骤: (B) A method of determining the value of the variable described in the step (A), wherein Q ≤ i d ≤ N d — \ , \ ≤ d ≤ D, including the following steps:
将 ( ), ,..., )) 分组为 (χ ), ..., ), + 1), ..., ), ... + 1), · ··, 其中 P。=0 , Pq + 1 = s , 0<pv+1-pv≤smax 0≤v≤q , s 为所选择的最大维度; 对于变量组 ^ν + 1),..., ^ν+1) , 其中 0≤v≤g , 确定其值的方法包括以下步骤: Group ( ), ,..., )) into (χ ), ..., ), + 1 ), ..., ), ... + 1 ), · ··, where P. =0 , P q + 1 = s , 0<p v+1 -p v ≤s max 0≤v≤q , s is the selected largest dimension; for the variable group ^ ν + 1 ),..., ^ ν+1 ) , where 0 ≤ v ≤ g, the method of determining the value includes the following steps:
Figure imgf000004_0001
其巾,
Figure imgf000004_0001
Its towel,
为 一 6进制 ( ^) 序列的第 ·维生成矩阵, 表示整数 在 6进制表示下的第 H立数字 即 i=∑ b i r , Μ为所选择的在 6进制表示下的最大精度; 为层级化置换操作, 对一整数 x=∑ x、br , πν{χ):=∑ b;{ A matrix is generated for the first dimension of a hexadecimal (^) sequence, indicating that the H-th digit of the integer in hexadecimal notation is i=∑ bi r , where Μ is the maximum precision selected in the hexadecimal representation. ; for hierarchical replacement operations, for an integer x=∑ x, b r , π ν {χ):=∑ b; {
-=o  -=o
Medium
( + mod b ( + mod b
{bM ( + mod b {b M ( + mod b
( + mod b bo (x) = (b0{x) + ξν-1> ( mod b 其中 ζν> ζ ζ ,Ο,Ο' · ·· ' ζ … ' ζ , ≤V≤q , 为相互独立的随机数。 ( + mod b bo (x) = (b 0 {x) + ξ ν-1> ( mod b where ζ ν > ζ ζ , Ο, Ο ' · ·· ' ζ ... ' ζ , ≤ V ≤ q , Independent random numbers.
本发明具有以下优点:  The invention has the following advantages:
由于本发明基于 序列, 通过层級化置换操作实现对釆样任务的分解, 与通过对 {t,s) 序列在一个所选择的维度中进行分组以实现对釆样任务的分解的方法相比, 本发明 不需要在一个额外的维度中对釆样点进行分组, 对 (t ) 序列的生成矩阵也无限制条件, 可用于任何类型的 ( ^) 序列, 釆样点的质量亦不受并行处理单元数量的影响。 具体实施方式 以下结合实施例对本发明进行详细说明。  Since the present invention is based on sequences, the decomposition of the sample task is achieved by a hierarchical replacement operation, compared to a method of grouping the {t, s) sequences in a selected dimension to achieve decomposition of the sample task. The present invention does not need to group the sample points in an additional dimension, and there is no restriction on the generation matrix of the (t) sequence, and can be applied to any type of (^) sequence, and the quality of the sample points is not parallel. The impact of the number of processing units. BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail in conjunction with the embodiments.
表 1列出了计算 2进制 Niederreiter序列的 C++代码示例: 说 明 书 表 1 Table 1 lists examples of C++ code for calculating binary Niederreiter sequences: Instruction sheet 1
typedef unsigned int Uint;  Typedef unsigned int Uint;
typedef unsigned int32 Uint32;  Typedef unsigned int32 Uint32;
typedef unsigned int64 Uint64; typedef Uint32 Code—Type;  Typedef unsigned int64 Uint64; typedef Uint32 Code—Type;
#define Max Dimen 12 #define Max Dimen 12
#define Bit—Count 31  #define Bit—Count 31
#defme NBits 32 extern const Code—Type Nied2_Table[Max_Dimen] [NBits];  #defme NBits 32 extern const Code—Type Nied2_Table[Max_Dimen] [NBits];
Code—Type nied2 ( Code—Type nied2 (
Code—Type instance,  Code—Type instance,
Uint i dim)  Uint i dim)
Code—Type result = 0; for (Uint i = 0; i < NBits; ++i) Code—Type result = 0; for (Uint i = 0; i < NBits; ++i)
Code—Type itemp = instance & Nied2_Table[i_dim][i]; for (Uint k = l ; k < NBits; k «= 1) Code_Type itemp = instance &Nied2_Table[i_dim][i]; for (Uint k = l ; k < NBits; k «= 1)
itemp A= (itemp » k); result |= (itemp & 1) « (Bit—Count - i); return (result); 在表 1所示代码中, 最大精度设为 32位。 设定一个最大精度的原因是, 在数值计算中, 既不可能也无必要进行无限精度的计算。 Itemp A = (itemp » k); result |= (itemp & 1) « (Bit_Count - i); return (result); In the code shown in Table 1, the maximum precision is set to 32 bits. The reason for setting a maximum precision is that in numerical calculations, it is neither possible nor necessary to perform infinitely accurate calculations.
在表 1所示代码中, 最大维度设为 12维。 设定最大维度的作用在于, 一方面, 计算 {t , s) 序列需要用到的生成矩阵的数据需事先存储在计算机可读的介质中, 而现实中的任 何设备都不可能存储无限多的数据; 另一方面, 拟随机数的质量虽优于随机数, 但随着维度 的增大, 拟随机数的质量会逐渐下降, 所以在实际中也无必要使用无限维的拟随机数。  In the code shown in Table 1, the maximum dimension is set to 12 dimensions. The role of setting the maximum dimension is that, on the one hand, the data of the generator matrix needed to calculate the {t , s) sequence needs to be stored in a computer-readable medium in advance, and it is impossible for any device in reality to store an infinite number of On the other hand, although the quality of quasi-random numbers is better than random numbers, as the dimension increases, the quality of quasi-random numbers will gradually decrease, so it is not necessary to use infinite-dimensional quasi-random numbers in practice.
对不同的 序列, 最大维度的选取要根据其质量参数(quality parameters ) t和设 定的最大精度来决定, 其原则是, 所选择的最大维度的质量参数不应超过设定的最大精度。  For different sequences, the selection of the largest dimension is based on its quality parameters t and the set maximum precision. The principle is that the quality parameter of the selected largest dimension should not exceed the set maximum precision.
表 2列出了 2进制 Sobol序列、 Niederreiter序列和 Niederreiter-Xing序列在不同维度中 的质量参数。 该参数越小表示质量越高, 最小为 0。 说 明 书 表 2 Table 2 lists the quality parameters of the binary Sobol sequence, the Niederreiter sequence, and the Niederreiter-Xing sequence in different dimensions. The smaller the parameter, the higher the quality and the minimum is 0. Instruction sheet 2
Figure imgf000006_0001
Figure imgf000006_0001
从上表可以看出, 对于 2进制 Sobol序列和 Niederreiter序列, 如果最大精度设为 32位, 则最大维度应选为 12维, 因为 12维的 Sobol序列和 Niederreiter序列的质量参数分别为 31 和 30 , 未超过 32, 而 13维的 Sobol序列和 Niederreiter序列的质量参数分别为 35和 34 , 超 过了 32。  As can be seen from the above table, for the binary Sobol sequence and the Niederreiter sequence, if the maximum precision is set to 32 bits, the maximum dimension should be selected as 12 dimensions, because the quality parameters of the 12-dimensional Sobol sequence and the Niederreiter sequence are 31 and respectively. 30, not exceeding 32, and the quality parameters of the 13-dimensional Sobol sequence and the Niederreiter sequence are 35 and 34, respectively, exceeding 32.
使用 ( ^) 序列需要设定一个最大维度, 当渲染图像所需釆样点的维度超过该设定值 时, 需要对 {t,s) 序列的序号执行一次层級化置换操作, 置换后的序号可用于原 (t^) 序 列生成新的分量。 此外, 对釆样任务的分解也要用到这一层级化置换操作。 表 3列出了实 现该层级化置换操作的 C++代码示例:  To use the ( ^) sequence, you need to set a maximum dimension. When the dimension of the sample point required to render the image exceeds the set value, you need to perform a hierarchical replacement operation on the sequence number of the {t, s) sequence. The sequence number can be used to generate new components for the original (t^) sequence. In addition, this hierarchical replacement operation is also used for the decomposition of the sample task. Table 3 lists examples of C++ code that implements this hierarchical replacement operation:
表 3  table 3
inline Uint64 hash64 (  Inline Uint64 hash64 (
Uint64 v) v = v* 3935559000370003845ULL + 2691343689449507681ULL; v»21;  Uint64 v) v = v* 3935559000370003845ULL + 2691343689449507681ULL; v»21;
v « 37;  v « 37;
ν» 4; v *= 4768777513237032717ULL; v Λ= v « 20; ν» 4; v *= 4768777513237032717ULL; v Λ = v « 20;
νΛ=ν»41; ν Λ =ν»41;
ν Λ= ν « 5; return (v); ν Λ = ν « 5; return (v);
Code—Type hierch_perm ( Code—Type hierch_perm (
Code—Type instance,  Code—Type instance,
Uint level)  Uint level)
Uint64 const seed = Uint64(level) « NBits; Code—Type const mask =〜Code_Type(0); Code—Type result = instance; 说 明 书 for (Uint i = 0; i < Bit—Count; ++i) Uint64 const seed = Uint64(level) « NBits; Code_Type const mask =~Code_Type(0); Code_Type result = instance; Specification for (Uint i = 0; i <Bit-Count; ++i)
Code—Type index = (instance » (i + 1)) + (mask » (i + 1》; result A= Code_Type(hash64(seed | index) & 1) « i; result A= Code_Type(hash64(seed) & 1) « Bit—Count; return (result); 表 4列出了基于 2进制 Niederreiter序列, 通过层级化置换操作实现对釆样任务的分解 的 C++代码示例, 其中用到了在表 1和表 3中所示代码: Code_Type index = (instance » (i + 1)) + (mask » (i + 1); result A = Code_Type(hash64(seed | index) & 1) « i; result A = Code_Type(hash64(seed) & 1) « Bit_Count; return (result); Table 4 lists C++ code examples for decomposing a sample task by hierarchical substitution operations based on the binary Niederreiter sequence, which is used in Table 1 and Table The code shown in 3:
表 4  Table 4
struct Context {  Struct Context {
public:  Public:
Context();  Context();
Code—Type prev; Code—Type prev;
Code—Type curr;  Code—Type curr;
Uint dim;  Uint dim;
Uint level; inline Context: : Context () memset(this, 0, sizeof(*this)); void sampling (  Uint level; inline Context: : Context () memset(this, 0, sizeof(*this)); void sampling (
double result [],  Double result [],
Uint dim,  Uint dim,
Context &context)  Context &context)
Uint d = context, dim; for (Uint i = 0; i < dim; ++i) if (d >= Max Dimen) context.curr = hierch_perm(context.prev, context.level++); d = 0; 说 明 书 Uint d = context, dim; for (Uint i = 0; i <dim; ++i) if (d >= Max Dimen) context.curr = hierch_perm(context.prev, context.level++); d = 0; Instruction manual
Code—Type code = nied2(context.curr, d++); result[i] = double(code) I double(lULL « NBits); context.dim = d; void sampling ( Code—Type code = nied2(context.curr, d++); result[i] = double(code) I double(lULL « NBits); context.dim = d; void sampling (
double result [],  Double result [],
Uint dim,  Uint dim,
Context &context,  Context &context,
Code—Type index) context.prev = index; context.curr = hierch_perm(index, 0); context.dim = 0; context.level = 1 ; sampling(result, dim, context); void parallel_part (  Code_Type index) context.prev = index; context.curr = hierch_perm(index, 0); context.dim = 0; context.level = 1 ; sampling(result, dim, context); void parallel_part (
Uint programlndex,  Uint programlndex,
Uint programCount)  Uint programCount)
Code—Type i = 0; while (!aborted()) Code—Type i = 0; while (!aborted())
Context context; double t[2]; sampling(t, 2, context, (i++) * programCount + programlndex); Vector dir; generate_dir(dir, t); Color result; raytrace(result, context, dir); 说 明 书 Context context; double t[2]; sampling(t, 2, context, (i++) * programCount + programlndex); Vector dir; generate_dir(dir, t); Color result; raytrace(result, context, dir); Instruction manual
表 5列出了在渲染过程中使用表 4所示代码的 C++代码示例: Table 5 lists examples of C++ code that uses the code shown in Table 4 during rendering:
表 5  table 5
void renderer (  Void renderer (
Uint programCount) for (Uint i = 0; i < programCount; ++i)  Uint programCount) for (Uint i = 0; i < programCount; ++i)
parallel_part(i, programCount); void shader (  Parallel_part(i, programCount); void shader (
Color &result,  Color &result,
Context const &context)  Context const &context)
Context next = context; double t[2]; sampling(t, 2, next); Context next = context; double t[2]; sampling(t, 2, next);
Vector dir; generate_dir(dir, t); raytrace(result, next, dir); 在表 4所示代码中, 对釆样点诸维分量的各个分组均使用了相同的 s) 序列, 即 2 进制 Niederreiter序列, 除使用相同的 (t , 序列外也可使用基数相同但类型不同的 {t , s) 序列, 例如, 2进制 Niederreiter-Xing序列。 Niederreiter-Xing序列的质量虽优于 Sobol序列和 Niederreiter序列, 但在使用上存在一个限制, 即必须事先确定总的釆样维度, 因而不适宜作为图像渲染中一种普遍适用的方法, 不过如果当前分组的维度已知且不会有更 高维的釆样, 则可用 Niederreiter-Xing序列替换 Niederreiter序列以获得更好的渲染效果。 Vector dir; generate_dir(dir, t); raytrace(result, next, dir); In the code shown in Table 4, the same s) sequence is used for each group of the dimension components of the sample, ie binary Niederreiter sequences, except for the same (t, sequence can also use {t, s) sequences with the same base but different types, for example, the binary Niederreiter-Xing sequence. Although the quality of the Niederreiter-Xing sequence is superior to the Sobol sequence and the Niederreiter sequence, there is a limitation in the use that the total sampling dimension must be determined in advance, and thus is not suitable as a universally applicable method in image rendering, but if currently The grouping dimensions are known and there will be no higher dimensionality, and the Niederreiter-Xing sequence can be used to replace the Niederreiter sequence for better rendering.
一种 (t , s) 序列的扩展称之为随机化 (t ) 序列 ( randomized {t , s) sequences ) , 其作用在于能估计积分近似值的误差大小。 虽然渲染图像时不必去估计积分近似值的误差大 小, 但这种随机化方法可用于在动画的渲染中緩解图像中的瑕疵, 即对动画渲染中不同的图 像帧使用不同的随机数对釆样点进行随机化, 以淡化可能存在的瑕疵图案。  An extension of the (t, s) sequence is called a randomized (t) sequence (ranized {t , s) sequences , which is used to estimate the error magnitude of the integral approximation. Although it is not necessary to estimate the error magnitude of the integral approximation when rendering the image, this randomization method can be used to alleviate the flaws in the image in the rendering of the animation, that is, using different random number pairs for different image frames in the animation rendering. Randomize to fade out the possible enamel patterns.
表 6列出了在表 4所示代码的基础上增加了随机化步骤的 C++代码示例:  Table 6 lists the C++ code examples with the addition of randomization steps based on the code shown in Table 4:
表 6  Table 6
inline Uint64 random (  Inline Uint64 random (
Uint64 v) 说 明 书 v = v * 3202034522624059733ULL + 4354685564936845319ULL; v Λ= v » 11 ; Uint64 v) Specification v = v * 3202034522624059733ULL + 4354685564936845319ULL; v Λ = v » 11 ;
v Λ= v « 29; v Λ = v « 29;
ν Λ= ν » 14; ν *= 2685821657736338717ULL; ν Λ= ν « 30; ν Λ = ν » 14; ν *= 2685821657736338717ULL; ν Λ = ν « 30;
ν Λ= ν » 35; ν Λ = ν » 35;
ν Λ= ν « 13; return (v); void randomized sampling ( ν Λ = ν « 13; return (v); void randomized sampling (
double result[],  Double result[],
Uint dim,  Uint dim,
Context &context,  Context &context,
Uint frame)  Uint frame)
Uint64 seed = (Uint64(frame) « NBits) + Uint64 seed = (Uint64(frame) « NBits) +
context. level * Max Dimen + context.dim; sampling(result, dim, context); for (Uint d = 0; d < dim; ++d)  Context. level * Max Dimen + context.dim; sampling(result, dim, context); for (Uint d = 0; d < dim; ++d)
Code—Type code = Code_Type(result[d] * (1ULL « NBits)); code A= (Code_Type)random(seed++); result[d] = double(code) I double(lULL « NBits); Code_Type code = Code_Type(result[d] * (1ULL « NBits)); code A = (Code_Type)random(seed++); result[d] = double(code) I double(lULL « NBits);

Claims

权 利 要 求 书 Claim
1. 一种计算机图像渲染方法, 其特征为, 包括以下步骤: A computer image rendering method, comprising: the following steps:
(A) 对于渲染图像时需要求值的积分 f(x{l x{2 ...,x{s))dx{l)dx{2)...dx{s) 使用数值计算的方法求其近似值, 包括以下步骤: (A) For the integral of the required value when rendering the image f(x {l x {2 ..., x {s) )dx {l) dx {2) ...dx {s) Its approximation includes the following steps:
将对函数 /(·) 的釆样分解为两个或更多的部分, 每一部分交由一个独立的并行处理 单元进行处理  Decompose the function /(·) into two or more parts, each part being processed by a separate parallel processing unit
D Nd-l d=\ i ==00 D N d -ld=\ i ==00
a  a
其中, N ^ Nd 为釆样点的数量, Z)为并行处理单元的数量, Nd 为第 个处理 d = \ Where N ^ N d is the number of sample points, Z) is the number of parallel processing units, and N d is the first processing d = \
单元分配的釆样点数量, 不同的处理单元所分配的釆样点数量可以相同也可以不同; The number of sample points allocated by the unit, the number of sample points allocated by different processing units may be the same or different;
(B) 确定步骤 (A)中所述变量 (χ ^···^)) 的值的方法, 其中 Q≤id≤Nd - 1 , \≤d≤D , 包括以下步骤: (B) A method of determining the value of the variable ( χ ^···^)) in the step (A), wherein Q ≤ i d ≤ N d - 1 , \ ≤ d ≤ D, including the following steps:
将 分组为 ( 。+ 1),..., ), + 1),...^..., + 1),_ +1)) ,Will be grouped as ( . + 1 ),..., ), + 1 ),...^..., + 1 ), _ +1 )) ,
' d d d ' d d d d d d 其中 P。=0 , Pq + l = s , 0<pv+l-pv≤smax , 0≤v≤q , s 为所选择的最大维度; 对于变量组 ^V + 1),..., ^V+1) , 其中 0≤v≤g , 确定其值的方法包括以下步骤: χ^ + Δ)Δ(1^) , 0≤v≤q , \<Λ≤ρν+ν ; D + d) , 0<ν≤ί7 ;'ddd ' dddddd where P. =0 , P q + l = s , 0<p v+l -p v ≤s max , 0≤v≤q , s is the selected largest dimension; for the variable group ^ V + 1 ),..., ^ V+1 ) , where 0 ≤ v ≤ g, the method of determining the value includes the following steps: χ^ + Δ) = Η Δ (1^) , 0 ≤ v ≤ q , \<Λ ≤ ρ ν +ν ; D + d) , 0<ν≤ί7 ;
Figure imgf000011_0001
其中
Figure imgf000011_0002
Figure imgf000011_0001
among them
Figure imgf000011_0002
6进制 ( ^) 序列的第 ·维生成矩阵, 表示整数 在 6进制表示下的第 H立数字 The hexadecimal ( ^) sequence of the dimension · the generation matrix, representing the integer number in the hexadecimal representation of the H number
M-1 M-1
即 i=∑ i)br , Μ为所选择的在 6进制表示下的最大精度; That is, i=∑ i)b r , where Μ is the selected maximum precision in hexadecimal representation;
M-1 M-1  M-1 M-1
^Α') 为层级化置换操作, 对一整数 x=∑ br x r , πν{χ):=∑ b;{ ]{x)br , 其 ^Α') is a hierarchical permutation operation, for an integer x=∑ b r x r , π ν {χ):=∑ b; { ] {x)b r ,
=0  =0
Medium
Figure imgf000011_0003
Figure imgf000011_0003
bo](x) = (b0{x) + ξν_ (46 mod b Bo ] (x) = (b 0 {x) + ξ ν _ ( 46 mod b
权 利 要 求 书 其中 ^ν 1 … , ≤V≤q , 为相互独立的随机数。 The claim requires ^ν 1 ... , ≤V≤q to be independent random numbers.
2. 如权利要求 1.所述方法, 还包括, 对釆样点诸维分量的各个分组使用相同的 ( ^) 序列或基数相同但类型不同的 ( ^) 序列。  2. The method of claim 1, further comprising using the same (^) sequence or a (^) sequence of the same base but different types for each group of the dimensional components of the sample.
3. 如权利要求 1.所述方法, 其中, 所述 序列包括 Sobol序列、 Faure序列、 Niederreiter序歹 口 Niederreiter-Xing序歹 。  The method according to claim 1, wherein the sequence comprises a Sobol sequence, a Faure sequence, and a Niederreiter sequence mouth Niederreiter-Xing sequence.
4. 如权利要求 1.所述方法, 其中, 所述 (t^) 序列还包括随机化的 (t^) 序列。  4. The method of claim 1, wherein the (t^) sequence further comprises a randomized (t^) sequence.
PCT/CN2012/084748 2011-12-06 2012-11-16 Method for decomposing sampling task WO2013082995A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110400054.3 2011-12-06
CN 201110400054 CN102496170A (en) 2011-12-06 2011-12-06 Method for decomposing sampling task

Publications (1)

Publication Number Publication Date
WO2013082995A1 true WO2013082995A1 (en) 2013-06-13

Family

ID=46187992

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/084748 WO2013082995A1 (en) 2011-12-06 2012-11-16 Method for decomposing sampling task

Country Status (2)

Country Link
CN (1) CN102496170A (en)
WO (1) WO2013082995A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102496170A (en) * 2011-12-06 2012-06-13 阳赛 Method for decomposing sampling task
CN103020203B (en) * 2012-12-05 2017-04-12 北京奇虎科技有限公司 Method and device for processing data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030063082A1 (en) * 2001-06-07 2003-04-03 Georgy Abramov System and method for rendering images using a strictly-deterministic methodology for generating a coarse sequence of sample points
CN101065784A (en) * 2004-11-29 2007-10-31 Arm挪威股份有限公司 Processing of computer graphics
US20100281480A1 (en) * 2009-04-29 2010-11-04 Alexander Keller System, method, and computer program product for decomposing a sampling task into a plurality of jobs
CN101916453A (en) * 2008-10-24 2010-12-15 Arm有限公司 Method of and apparatus for processing computer graphics
CN102496170A (en) * 2011-12-06 2012-06-13 阳赛 Method for decomposing sampling task

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030063082A1 (en) * 2001-06-07 2003-04-03 Georgy Abramov System and method for rendering images using a strictly-deterministic methodology for generating a coarse sequence of sample points
CN101065784A (en) * 2004-11-29 2007-10-31 Arm挪威股份有限公司 Processing of computer graphics
CN101916453A (en) * 2008-10-24 2010-12-15 Arm有限公司 Method of and apparatus for processing computer graphics
US20100281480A1 (en) * 2009-04-29 2010-11-04 Alexander Keller System, method, and computer program product for decomposing a sampling task into a plurality of jobs
CN102496170A (en) * 2011-12-06 2012-06-13 阳赛 Method for decomposing sampling task

Also Published As

Publication number Publication date
CN102496170A (en) 2012-06-13

Similar Documents

Publication Publication Date Title
Arendt et al. Weyl's Law: Spectral properties of the Laplacian in mathematics and physics
JP2009003925A (en) Extension of repetition period of random sequence
ATE373288T1 (en) IMAGE SYNTHESIS USING PRECISELY DETERMINISTIC METHODOLOGY USING RECURSIVE ROTATIONS FOR PATTERN POINT GENERATION
Moon et al. Efficient multiple scattering in hair using spherical harmonics
WO2013082995A1 (en) Method for decomposing sampling task
JP2005286959A5 (en)
Janke Pseudo random numbers: Generation and quality checks
Günther et al. Recursive approach to determine correlation functions in multibaryon systems
Shchur et al. Cluster Monte Carlo: tScaling of systematic errors in the two-dimensional Ising model
AU2020202883B1 (en) Systems and computer-implemented methods for generating pseudo random numbers
ES2906626T3 (en) Image processing device and two-dimensional image generation program
CN106683041A (en) Quantum image shearing method based on NEQR expression
Zhang et al. Graph-based fire synthesis
CN110708160B (en) SM2 algorithm scalar multiplication coding-based side channel attack resisting method and system
Schemann et al. An adaptive Rothe method for the wave equation
WO2013097557A1 (en) Quasi-random number generation method for image rendering
WO2013082992A1 (en) Digimigration method used for splitting sampling points
WO2013082993A1 (en) Hierarchical replacement method for (t, s) sequence
L’Ecuyer et al. On array-RQMC for Markov chains: mapping alternatives and convergence rates
WO2013082994A1 (en) Method for generating high-dimensional component of sampling point
Tretiakov et al. Efficient Monte Carlo simulations using a shuffled nested Weyl sequence random number generator
Cloutier et al. Mapping the discrete logarithm
Thorne Four perspectives on secondary terms in the Davenport-Heilbronn theorems
Wikramaratna Pseudo-random number generation for parallel Monte Carlo-a splitting approach
Moysis et al. Validating a Chaos Based PRBG Under Different Chaotic Maps

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12855429

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12855429

Country of ref document: EP

Kind code of ref document: A1