SlideShare a Scribd company logo
1 of 62
Texturering & Modeling
               a Procedual Approach



              김정근
Chapter 2

Building Procedural Textures
Agenda


 MAKING NOISES
   –   Introduction Noise Function

   –   Definition

   –   Interpolation

   –   Lattice Noises

   –   Value Noise

   –   Gradient Noise

   –   Value-Gradient Noise

   –   Lattice Convolution Noise

   –   Sparse Convolution Noise

   –   Explicit Noise Algorithms

   –   Fourier Spectral Synthesis




                                              3
Making Noises




사실적인 절차적 텍스쳐를 생성하기 위해서는
      불규칙한 패턴이 필요

                          4
Making Noises




               Noise
      Irregular Primitive Function
확률적이거나 너무 정규화 되는 단조로움을 깨는 기능




                                     5
Making Noises




Random
             Stochastic


                          6
Making Noises




  White Noise
 완전히 무작위적인 신호



                7
Making Noises




White Noise는 반복되지 않기 때문에
 우리가 원하는 Noise 가 아니다




      White Noise
     완전히 무작위적인 신호



                           8
Making Noises




진정한 임의성은 컴퓨터과학에서 특이한 것이고   절
     차적 텍스쳐에 바람직하지 않은 것




                               9
Making Noises



동일한 프레임을 유지하기 위한 패턴이 필요
어떤 오브젝트 표면의 패턴을 제작하고자 할때




   임의지만 일부 입력의 반복적인 기능의 함수가 필요



       실제로 랜덤 기능(Function)은 입력이 없음



          확률적 텍스쳐 프리미티브는 텍스쳐 좌표를 입력으로 표현



               항상 동일한 텍스쳐 좌표가 주는 동일한 값을 리턴




                                             10
Making Noises




                11
Making Noises




                12
Making Noises




                13
Making Noises




샘플링 속도는 화이트 노이즈 세부 사항을 포착
할 정도로 충분하지 않음




   화이트 노이즈보다 부드러운 확률적 함수가 필
   요(Aliasing)




        화이트 노이즈의 로우패스필터 버젼을 사용




                                 14
Making Noises




Pseudorandom                known range      band-limited :
                               [ - 1 ~ 1]   maximum frequency 1




No              obvious
periodicities or regular   Stationary        Isotropic
       patterns




                                                                  15
Introduction


   노이즈 함수는 Seed 값에 의한 난수 생성기(Pseudorandom Number Generator)

   인자로 하나의 정수를 받아서 그 인자에 기반한 난수를 반환

   같은 인자를 두 번 전달하면 동일한 수가 두 번 생성

   이 값들 사이를 부드럽게 보간함으로서 전달인자를 정수로 받지 않는 연속적인 함수를 정의




                                                               16
Definition

Amplitude(진폭) : 함수가 가질 수 있는 최대, 최소값의 차이


WaveLength(파장) : 한점(빨간점)에서 다음 점 까지의 거리


Frequency(주파수) : 1/WaveLength로 알아냄



                                            함수의 차원에 따라 정의된 난수값




           Sin 곡선                         Noise 곡선


                                                            17
Definition

Octave(옥타브) : 현재 더해지고 있는 연속적인 노이즈 함수   (아래 그림에서 쓰인 옥타브 수는 6개)


Persistence(지속성) : 진폭이 작아져 가는 정도




                                                                18
Definition




             19
Interpolation




 노이즈 함수의 품질 결과는
보간 방식의 성격에 따라 달라짐




                    20
Interpolation




1차 Linear Interpolate(a, b, x)
 return a*(1-x) + b*x




                                 21
Interpolation




2차 Cosine Interpolate(a, b, x)
   ft = x * 3.1415927
   f = (1 - cos(ft)) * .5
   return a*(1-f) + b*f


                                 22
Interpolation




2차 Cosine Interpolate(a, b, x)
   ft = x * 3.1415927
   f = (1 - cos(ft)) * .5
   return a*(1-f) + b*f


                                 23
Interpolation




3차 Hermite interpolation

v = lerp(v0, v1, x^2(3-2x))




                              24
Interpolation




              Cubic Interpolate(v0, v1, v2, v3,x)

v0 = the point before a             P = (v3 - v2) - (v0 - v1)
v1 = the point a                    Q = (v0 - v1) - P
v2 = the point b                    R = v2 - v0 S = v1
v3 = the point after b              return Px3 + Qx2 + Rx + S

                                                                25
Interpolation




   Smooth Noise




                  26
Lattice Noises




절차적 텍스처 애플리케이션을 위한 노이즈의 가장 인기있는 구현




        단순하고 효율적이며 우수한 결과



노이즈의 필요한 로우패스필터링은                      PRN
      사이에 smooth interpolation 하여 수행




                                             27
Lattice Noises




Lattice Noise + Smooth interpolation




                                       28
Lattice Noises




                 29
Value Noise




lattice 포인트에 -1 그리고 1 사이에 정해진 PRN ,      노이
    즈 함수는 이러한 임의의 값 사이에서 보간에 의해 계산


보간방법이 중요,                             선형보간에
        서 큐빅보간까지 다양한 방법에 범위에 사용




      선형보간은 노이즈를 부드럽게 보기에는 부족(셀 아티팩트),
     파생된 두번째 유도체가 모두 연속일수록 큐빅 보간방법을 사용




                                              30
Value Noise




Catmull-Rom spline interpolation




                            이 스플라인은 64 Control Point를 가지며 아주 비싼 보간을 함,   최적
                                        화 된 스플라인함수를 사용하는 것이 유용



                                                                              31
Value Noise




Quadratic interpolation                   Cubic B-Spline interpolation




             자주 쓰이는 방식들, 그 외에 wiener (Lewis) 보간 등이 있음




                                                                         32
Value Noise




graph of a 1D sample   2D slice of the function   Power spectrum




                                                                   33
Gradient Noise




            The function that
               launched a
           thousand textures.




                                34
Gradient Noise




           Perlin Noise

다양한 주파수와 진폭을 가진 부드러운 함수들을 많이 가지고 있다면,
   그 함수들을 모두 더함으로써 노이즈 함수를 만들수 있음




                                        35
Gradient Noise




Creating the Perlin Noise Function : 1 Dimension

                                                   36
Gradient Noise




Creating the Perlin Noise Function : 2 Dimension

                                                   37
Gradient Noise



    표준 삼차원 Perlin Noise. 4 옥타브, 지속성 0.25 와 0.5




낮은 지속성. 결과에 함수를 적용해 Perlin Noise에 날카로운 경계를 생성




     높은 지속성의 함수의 줄무늬 / 낮은 지속성의 얼룩




      [3차원 Perlin Noise]

                                                 38
Gradient Noise


     Perlin 함수를 코사인 함수에 대한 Offset

        texture = cosine( x + perlin(x,y,z) )




               g = perlin(x,y,z) * 20
               grain = g - int(g)




 bumps = perlin(x*50, y*50, z*20)
 if bumps < .5 then bumps = 0 else bumps = 1t




    [3차원 Perlin Noise]

                                                39
Gradient Noise

      • Controlling virtual beings:
1차원
      • Drawing sketched lines



      • Landscapes:
2차원   • Clouds
      • Generating Textures


      • 3D Clouds
3차원   • Animated Clouds
      • Solid Textures




4차원   • Animated 3D Textures and Clouds:




                                      Perlin Noise의 응용분야

                                                           40
Gradient Noise




pseudorandom gradient vector를 생성하고 확률적 함수를          생
              성하는 Gradient를 사용하는 것


gradient noise의 값은 정수 Lattice Point 의 모든 값에서 0,     p
  seudorandom gradients는 Lattice Point 사이의 동작을 결정



   하나의 lattice cell의 8 Conner에서 gradients를 기반한 보간




                                                        41
Gradient Noise




Pseudorandom Gradient 벡터의 테이블을 초
  기화하기 위해 다음과 같은 루틴을 사용




표 ix, iy, 그리고 iz와 함께 하나의 정수 Lattice
Point에 대해 Gradient Noise의 Value를 생성




                                           42
Gradient Noise




선형 보간은 입력 좌표의 소수 부분의
 smoothstep 같은 함수에 의해 제어




                                   43
Gradient Noise




graph of a 1D sample     2D slice of the function   Power spectrum




                                                                     44
Value Gradient Noise




Gradient noise 는 정수 lattice point 모두 value = 0(zero)      Z
      ero 들의일반적인 패턴은 눈에 띄는 Grid 패턴을 만듬


    gradiant noise 장점을 유지하면서 이 문제를 피하기 위해
          Value method 와 Gradient method 를 혼합


Value noise 와 Gradient Noise 와의                        Weig
               hted sum(가중치 합) 만으로 구현




                                                              45
Value Gradient Noise




graph of a 1D sample            2D slice of the function            Power spectrum




             [Catmull-Rom vnoise 와 gradient gnoise 의 weighed sum]

                                                                                     46
Value Gradient Noise




graph of a 1D sample           2D slice of the function   Power spectrum




                         [Cubic Hermite Interpolation]

                                                                           47
Value-Gradient Noise




                        Hermite interpolation




Hermite spline 은 Spline value 와 Spline value 각각의 End point 에서의
   Tangent 에 의해 결정하며 Gradient 값을 spline tangent 로 사용




                                                                 48
Lattice Convolution Noise



Lattice noise 의 한가지 단점은 “axis-aligned 아티팩트”             l
attice PRN을 Blend 할때 보간의 비등방성(anisotrophic) 특성때문



불연속 Convolution technique을 사용해서 비등방성을 피하는 것



Lattice point에서 PRN들은 Random value 들이 impulse인 것으로
       다루고, 방사형 구조로 대칭적인 filter 와 convolve




Catmull-Rom Filter 를 사용, Input-Point로부터의 거리계산된 것의 합에서   사
                     용되는 계산 비용을 줄일 수 있음




                                                            49
Lattice Convolution Noise




   catrom2 함수가 호출 squared distance
function 으로 Catmull-Rom filter 값들이 있는
          table 을 참조하여 계산



  이 table 로 부터 look-up value 를 호출




                                            50
Lattice Convolution Noise




graph of a 1D sample          2D slice of the function   Power spectrum




                                                                          51
Sparse Convolution Noise




random 하게 분포되어있는 random 값의 collection 으로               구
               성된 filter function 을 convolve


White Noise 의 Low-pass Filtering 은 Filter Function 에 의해 수행
      되기 때문에 Filter 를 modify 함으로써 제어할 수 있음


  PRN값들이 각각의 lattice cell내에 pseudorandom point 들로
                 자리잡고 있다는 점이 다름




                                                             52
Sparse Convolution Noise




       3개의 랜덤값이 생성되어
       각각의 lattice cell에 위치



125개의 lattice cell들 주변에 위치한 cell들은
 각각의 cell들이 noise function 이라고 간주




          계산 비용이 비쌈




                                         53
Sparse Convolution Noise




graph of a 1D sample          2D slice of the function   Power spectrum




                                                                          54
Explicit Noise Algorithms



Implicit procedural texture 합성을 할때 Noise를 생성하는 방법과
           랜덤 Fractal을 그렇게 편리하지 않음



Explicit 방식은 Noise 값들을 한번에 모두 하나의 큰 Batch로 생성




랜더링 하는 동안 implicit procedural texture안에서       사
  용하기 위해서는, noise value 들은 렌더링 하기 전에
generate 해서 table이나 texture image 로 저장되여야함




                                                     55
Explicit Noise Algorithms




Midpoint displacement method (Fournier, Fussell, Carpenter 1982)


                                                                   56
Fourier Spectral Synthesis




주어진 frequency 에서, 원하는 noise 에 근접하게 맞는 power 상태에
       서 불연속 유사랜덤 frequency 스펙트럼을 생성


지정된 frequency 범위내에서 해당 frequency에 대응되는       noi
         se 값을 얻기 위해, 푸리에 역변환을 수행


cloud texture 를 만들기 위해 사용된 손수 집어낸           많은
          "random" 계수 (coefficient)들을 보여줌




                                                   57
Fourier Spectral Synthesis




                             58
Fourier Spectral Synthesis


   discrete 푸리에 역변환을 구현하기 위해 specturm 합을 사용해서, 지정된 random frequency 범위
    내에서 해당 frequency에 대응되는 function 값을 generation


   FFT(푸리에 변환) 보다는 덜 효율적이지만, implicit procedural texture 에서 한번에 한 point 값을 구
    할 수 있는 장점


   Gardner 의 texture 가 불규칙하고 복잡해 보이는 것도 noise처럼 보이는 확률함수로 위장


   noise 를 그대로 푸리에 합성하면 lattice noise 보다 너무 느리고, procedural texture 합성의 실용성
    을 잃게 될 것임


   Lattice convolution 과 sparse convolution 방법들은 noise 의 spectrum 을 보다 섬세하게 제어할 수
    있음이 보장되는 방법



                                                                                59
Reference


•   http://www.siggraph.org/education/materials/HyperGraph/mapping/r_wolfe/r_wolfe_mapping_6.htm

•   http://blog.naver.com/sorkelf/40156271551

•   http://blog.daum.net/rockeracer/7

•   http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

•   http://mrl.nyu.edu/~perlin/

•   http://www.redwiki.net/wiki/wiki.php/Perlin%20Noise#s-11.1

•   http://www.dreamincode.net/forums/topic/66480-perlin-noise/

•   http://www.csee.umbc.edu/~ebert/691/Au00/Notes/procedural.html

•   http://developer.nvidia.com/node/106

•   http://www.scratchapixel.com/lessons/3d-advanced-lessons/noise-part-1/introduction/

•   http://physbam.stanford.edu/cs448x/old/Procedural_Noise%282f%29Categories.html#LatticeGradientNoises

•   http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter26.html
                                                                                                           60
Q&A
감사합니다

More Related Content

What's hot

Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해SangYun Yi
 
Chapter 20 Deep generative models
Chapter 20 Deep generative modelsChapter 20 Deep generative models
Chapter 20 Deep generative modelsKyeongUkJang
 
언차티드4 테크아트 파트2 mipFog
언차티드4 테크아트 파트2 mipFog언차티드4 테크아트 파트2 mipFog
언차티드4 테크아트 파트2 mipFogDae Hyek KIM
 
[0529 박민근] 전역조명(global illumination)
[0529 박민근] 전역조명(global illumination)[0529 박민근] 전역조명(global illumination)
[0529 박민근] 전역조명(global illumination)MinGeun Park
 
논문-정규분포변환
논문-정규분포변환논문-정규분포변환
논문-정규분포변환jdo
 
Real-Time Global Illumination Techniques
Real-Time Global Illumination TechniquesReal-Time Global Illumination Techniques
Real-Time Global Illumination TechniquesJangho Lee
 
120427 celluar texture
120427 celluar texture120427 celluar texture
120427 celluar textureCARROTCG
 
11_SH를 이용한 실시간 투명 근사법
11_SH를 이용한 실시간 투명 근사법11_SH를 이용한 실시간 투명 근사법
11_SH를 이용한 실시간 투명 근사법noerror
 
언차티드4 테크아트 파트4 Special Case Materials - Moss & Wetness & Glass
언차티드4 테크아트 파트4 Special Case Materials - Moss & Wetness & Glass언차티드4 테크아트 파트4 Special Case Materials - Moss & Wetness & Glass
언차티드4 테크아트 파트4 Special Case Materials - Moss & Wetness & GlassDae Hyek KIM
 
노말 맵핑(Normal mapping)
노말 맵핑(Normal mapping)노말 맵핑(Normal mapping)
노말 맵핑(Normal mapping)QooJuice
 
여러 컨볼루션 레이어 테크닉과 경량화 기법들
여러 컨볼루션 레이어 테크닉과 경량화 기법들여러 컨볼루션 레이어 테크닉과 경량화 기법들
여러 컨볼루션 레이어 테크닉과 경량화 기법들Dongyi Kim
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명홍배 김
 
Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)민웅 이
 
120106 ch 5_basic image compositing_re
120106 ch 5_basic image compositing_re120106 ch 5_basic image compositing_re
120106 ch 5_basic image compositing_reCARROTCG
 
Basic ofreflectance kor
Basic ofreflectance korBasic ofreflectance kor
Basic ofreflectance korchangehee lee
 
Screen space reflection
Screen space reflectionScreen space reflection
Screen space reflectionBongseok Cho
 
제어-물리적시스템의 수학적모델링
제어-물리적시스템의 수학적모델링제어-물리적시스템의 수학적모델링
제어-물리적시스템의 수학적모델링jdo
 

What's hot (20)

Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해Display color와 Digital texture format의 이해
Display color와 Digital texture format의 이해
 
Chapter 20 Deep generative models
Chapter 20 Deep generative modelsChapter 20 Deep generative models
Chapter 20 Deep generative models
 
언차티드4 테크아트 파트2 mipFog
언차티드4 테크아트 파트2 mipFog언차티드4 테크아트 파트2 mipFog
언차티드4 테크아트 파트2 mipFog
 
[0529 박민근] 전역조명(global illumination)
[0529 박민근] 전역조명(global illumination)[0529 박민근] 전역조명(global illumination)
[0529 박민근] 전역조명(global illumination)
 
논문-정규분포변환
논문-정규분포변환논문-정규분포변환
논문-정규분포변환
 
Real-Time Global Illumination Techniques
Real-Time Global Illumination TechniquesReal-Time Global Illumination Techniques
Real-Time Global Illumination Techniques
 
120427 celluar texture
120427 celluar texture120427 celluar texture
120427 celluar texture
 
11_SH를 이용한 실시간 투명 근사법
11_SH를 이용한 실시간 투명 근사법11_SH를 이용한 실시간 투명 근사법
11_SH를 이용한 실시간 투명 근사법
 
언차티드4 테크아트 파트4 Special Case Materials - Moss & Wetness & Glass
언차티드4 테크아트 파트4 Special Case Materials - Moss & Wetness & Glass언차티드4 테크아트 파트4 Special Case Materials - Moss & Wetness & Glass
언차티드4 테크아트 파트4 Special Case Materials - Moss & Wetness & Glass
 
R.T.Bach
R.T.BachR.T.Bach
R.T.Bach
 
노말 맵핑(Normal mapping)
노말 맵핑(Normal mapping)노말 맵핑(Normal mapping)
노말 맵핑(Normal mapping)
 
Ssao
SsaoSsao
Ssao
 
여러 컨볼루션 레이어 테크닉과 경량화 기법들
여러 컨볼루션 레이어 테크닉과 경량화 기법들여러 컨볼루션 레이어 테크닉과 경량화 기법들
여러 컨볼루션 레이어 테크닉과 경량화 기법들
 
Motion blur
Motion blurMotion blur
Motion blur
 
Convolution 종류 설명
Convolution 종류 설명Convolution 종류 설명
Convolution 종류 설명
 
Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)Light in screen_space(Light Pre Pass)
Light in screen_space(Light Pre Pass)
 
120106 ch 5_basic image compositing_re
120106 ch 5_basic image compositing_re120106 ch 5_basic image compositing_re
120106 ch 5_basic image compositing_re
 
Basic ofreflectance kor
Basic ofreflectance korBasic ofreflectance kor
Basic ofreflectance kor
 
Screen space reflection
Screen space reflectionScreen space reflection
Screen space reflection
 
제어-물리적시스템의 수학적모델링
제어-물리적시스템의 수학적모델링제어-물리적시스템의 수학적모델링
제어-물리적시스템의 수학적모델링
 

More from CARROTCG

20120713 ch13
20120713 ch1320120713 ch13
20120713 ch13CARROTCG
 
20120713 ch12
20120713 ch1220120713 ch12
20120713 ch12CARROTCG
 
Procedural synthesis of geometry
Procedural synthesis of geometryProcedural synthesis of geometry
Procedural synthesis of geometryCARROTCG
 
Texture Modeling a Procedual Approach Chater 2 : Building Procedural Textures
Texture Modeling a Procedual Approach Chater 2 : Building Procedural TexturesTexture Modeling a Procedual Approach Chater 2 : Building Procedural Textures
Texture Modeling a Procedual Approach Chater 2 : Building Procedural TexturesCARROTCG
 
Volumetric cloud modeling with implicit functions web
Volumetric cloud modeling with implicit functions webVolumetric cloud modeling with implicit functions web
Volumetric cloud modeling with implicit functions webCARROTCG
 
Texture Modeling a Procedual Approach #01
Texture Modeling a Procedual Approach #01Texture Modeling a Procedual Approach #01
Texture Modeling a Procedual Approach #01CARROTCG
 
120216 ch 12_creating_elements
120216 ch 12_creating_elements120216 ch 12_creating_elements
120216 ch 12_creating_elementsCARROTCG
 
120119 ch 7_time_and_temporal_manipulations
120119 ch 7_time_and_temporal_manipulations120119 ch 7_time_and_temporal_manipulations
120119 ch 7_time_and_temporal_manipulationsCARROTCG
 
120106 ch 6_matte_creation_and_manipulation_web
120106 ch 6_matte_creation_and_manipulation_web120106 ch 6_matte_creation_and_manipulation_web
120106 ch 6_matte_creation_and_manipulation_webCARROTCG
 
111028 ch 3_the digital representation of visual information
111028 ch 3_the digital representation of visual information111028 ch 3_the digital representation of visual information
111028 ch 3_the digital representation of visual informationCARROTCG
 
The Art and Science of Digital Compositing Chapter 1,2
The Art and Science of Digital Compositing Chapter 1,2The Art and Science of Digital Compositing Chapter 1,2
The Art and Science of Digital Compositing Chapter 1,2CARROTCG
 

More from CARROTCG (14)

20120921
2012092120120921
20120921
 
20120824
2012082420120824
20120824
 
20120810
2012081020120810
20120810
 
20120713 ch13
20120713 ch1320120713 ch13
20120713 ch13
 
20120713 ch12
20120713 ch1220120713 ch12
20120713 ch12
 
Procedural synthesis of geometry
Procedural synthesis of geometryProcedural synthesis of geometry
Procedural synthesis of geometry
 
Texture Modeling a Procedual Approach Chater 2 : Building Procedural Textures
Texture Modeling a Procedual Approach Chater 2 : Building Procedural TexturesTexture Modeling a Procedual Approach Chater 2 : Building Procedural Textures
Texture Modeling a Procedual Approach Chater 2 : Building Procedural Textures
 
Volumetric cloud modeling with implicit functions web
Volumetric cloud modeling with implicit functions webVolumetric cloud modeling with implicit functions web
Volumetric cloud modeling with implicit functions web
 
Texture Modeling a Procedual Approach #01
Texture Modeling a Procedual Approach #01Texture Modeling a Procedual Approach #01
Texture Modeling a Procedual Approach #01
 
120216 ch 12_creating_elements
120216 ch 12_creating_elements120216 ch 12_creating_elements
120216 ch 12_creating_elements
 
120119 ch 7_time_and_temporal_manipulations
120119 ch 7_time_and_temporal_manipulations120119 ch 7_time_and_temporal_manipulations
120119 ch 7_time_and_temporal_manipulations
 
120106 ch 6_matte_creation_and_manipulation_web
120106 ch 6_matte_creation_and_manipulation_web120106 ch 6_matte_creation_and_manipulation_web
120106 ch 6_matte_creation_and_manipulation_web
 
111028 ch 3_the digital representation of visual information
111028 ch 3_the digital representation of visual information111028 ch 3_the digital representation of visual information
111028 ch 3_the digital representation of visual information
 
The Art and Science of Digital Compositing Chapter 1,2
The Art and Science of Digital Compositing Chapter 1,2The Art and Science of Digital Compositing Chapter 1,2
The Art and Science of Digital Compositing Chapter 1,2
 

120413 making noises

  • 1. Texturering & Modeling a Procedual Approach 김정근
  • 3. Agenda  MAKING NOISES – Introduction Noise Function – Definition – Interpolation – Lattice Noises – Value Noise – Gradient Noise – Value-Gradient Noise – Lattice Convolution Noise – Sparse Convolution Noise – Explicit Noise Algorithms – Fourier Spectral Synthesis 3
  • 4. Making Noises 사실적인 절차적 텍스쳐를 생성하기 위해서는 불규칙한 패턴이 필요 4
  • 5. Making Noises Noise Irregular Primitive Function 확률적이거나 너무 정규화 되는 단조로움을 깨는 기능 5
  • 6. Making Noises Random Stochastic 6
  • 7. Making Noises White Noise 완전히 무작위적인 신호 7
  • 8. Making Noises White Noise는 반복되지 않기 때문에 우리가 원하는 Noise 가 아니다 White Noise 완전히 무작위적인 신호 8
  • 9. Making Noises 진정한 임의성은 컴퓨터과학에서 특이한 것이고 절 차적 텍스쳐에 바람직하지 않은 것 9
  • 10. Making Noises 동일한 프레임을 유지하기 위한 패턴이 필요 어떤 오브젝트 표면의 패턴을 제작하고자 할때 임의지만 일부 입력의 반복적인 기능의 함수가 필요 실제로 랜덤 기능(Function)은 입력이 없음 확률적 텍스쳐 프리미티브는 텍스쳐 좌표를 입력으로 표현 항상 동일한 텍스쳐 좌표가 주는 동일한 값을 리턴 10
  • 14. Making Noises 샘플링 속도는 화이트 노이즈 세부 사항을 포착 할 정도로 충분하지 않음 화이트 노이즈보다 부드러운 확률적 함수가 필 요(Aliasing) 화이트 노이즈의 로우패스필터 버젼을 사용 14
  • 15. Making Noises Pseudorandom known range band-limited : [ - 1 ~ 1] maximum frequency 1 No obvious periodicities or regular Stationary Isotropic patterns 15
  • 16. Introduction  노이즈 함수는 Seed 값에 의한 난수 생성기(Pseudorandom Number Generator)  인자로 하나의 정수를 받아서 그 인자에 기반한 난수를 반환  같은 인자를 두 번 전달하면 동일한 수가 두 번 생성  이 값들 사이를 부드럽게 보간함으로서 전달인자를 정수로 받지 않는 연속적인 함수를 정의 16
  • 17. Definition Amplitude(진폭) : 함수가 가질 수 있는 최대, 최소값의 차이 WaveLength(파장) : 한점(빨간점)에서 다음 점 까지의 거리 Frequency(주파수) : 1/WaveLength로 알아냄 함수의 차원에 따라 정의된 난수값 Sin 곡선 Noise 곡선 17
  • 18. Definition Octave(옥타브) : 현재 더해지고 있는 연속적인 노이즈 함수 (아래 그림에서 쓰인 옥타브 수는 6개) Persistence(지속성) : 진폭이 작아져 가는 정도 18
  • 20. Interpolation 노이즈 함수의 품질 결과는 보간 방식의 성격에 따라 달라짐 20
  • 21. Interpolation 1차 Linear Interpolate(a, b, x) return a*(1-x) + b*x 21
  • 22. Interpolation 2차 Cosine Interpolate(a, b, x) ft = x * 3.1415927 f = (1 - cos(ft)) * .5 return a*(1-f) + b*f 22
  • 23. Interpolation 2차 Cosine Interpolate(a, b, x) ft = x * 3.1415927 f = (1 - cos(ft)) * .5 return a*(1-f) + b*f 23
  • 24. Interpolation 3차 Hermite interpolation v = lerp(v0, v1, x^2(3-2x)) 24
  • 25. Interpolation Cubic Interpolate(v0, v1, v2, v3,x) v0 = the point before a P = (v3 - v2) - (v0 - v1) v1 = the point a Q = (v0 - v1) - P v2 = the point b R = v2 - v0 S = v1 v3 = the point after b return Px3 + Qx2 + Rx + S 25
  • 26. Interpolation Smooth Noise 26
  • 27. Lattice Noises 절차적 텍스처 애플리케이션을 위한 노이즈의 가장 인기있는 구현 단순하고 효율적이며 우수한 결과 노이즈의 필요한 로우패스필터링은 PRN 사이에 smooth interpolation 하여 수행 27
  • 28. Lattice Noises Lattice Noise + Smooth interpolation 28
  • 30. Value Noise lattice 포인트에 -1 그리고 1 사이에 정해진 PRN , 노이 즈 함수는 이러한 임의의 값 사이에서 보간에 의해 계산 보간방법이 중요, 선형보간에 서 큐빅보간까지 다양한 방법에 범위에 사용 선형보간은 노이즈를 부드럽게 보기에는 부족(셀 아티팩트), 파생된 두번째 유도체가 모두 연속일수록 큐빅 보간방법을 사용 30
  • 31. Value Noise Catmull-Rom spline interpolation 이 스플라인은 64 Control Point를 가지며 아주 비싼 보간을 함, 최적 화 된 스플라인함수를 사용하는 것이 유용 31
  • 32. Value Noise Quadratic interpolation Cubic B-Spline interpolation 자주 쓰이는 방식들, 그 외에 wiener (Lewis) 보간 등이 있음 32
  • 33. Value Noise graph of a 1D sample 2D slice of the function Power spectrum 33
  • 34. Gradient Noise The function that launched a thousand textures. 34
  • 35. Gradient Noise Perlin Noise 다양한 주파수와 진폭을 가진 부드러운 함수들을 많이 가지고 있다면, 그 함수들을 모두 더함으로써 노이즈 함수를 만들수 있음 35
  • 36. Gradient Noise Creating the Perlin Noise Function : 1 Dimension 36
  • 37. Gradient Noise Creating the Perlin Noise Function : 2 Dimension 37
  • 38. Gradient Noise 표준 삼차원 Perlin Noise. 4 옥타브, 지속성 0.25 와 0.5 낮은 지속성. 결과에 함수를 적용해 Perlin Noise에 날카로운 경계를 생성 높은 지속성의 함수의 줄무늬 / 낮은 지속성의 얼룩 [3차원 Perlin Noise] 38
  • 39. Gradient Noise Perlin 함수를 코사인 함수에 대한 Offset texture = cosine( x + perlin(x,y,z) ) g = perlin(x,y,z) * 20 grain = g - int(g) bumps = perlin(x*50, y*50, z*20) if bumps < .5 then bumps = 0 else bumps = 1t [3차원 Perlin Noise] 39
  • 40. Gradient Noise • Controlling virtual beings: 1차원 • Drawing sketched lines • Landscapes: 2차원 • Clouds • Generating Textures • 3D Clouds 3차원 • Animated Clouds • Solid Textures 4차원 • Animated 3D Textures and Clouds: Perlin Noise의 응용분야 40
  • 41. Gradient Noise pseudorandom gradient vector를 생성하고 확률적 함수를 생 성하는 Gradient를 사용하는 것 gradient noise의 값은 정수 Lattice Point 의 모든 값에서 0, p seudorandom gradients는 Lattice Point 사이의 동작을 결정 하나의 lattice cell의 8 Conner에서 gradients를 기반한 보간 41
  • 42. Gradient Noise Pseudorandom Gradient 벡터의 테이블을 초 기화하기 위해 다음과 같은 루틴을 사용 표 ix, iy, 그리고 iz와 함께 하나의 정수 Lattice Point에 대해 Gradient Noise의 Value를 생성 42
  • 43. Gradient Noise 선형 보간은 입력 좌표의 소수 부분의 smoothstep 같은 함수에 의해 제어 43
  • 44. Gradient Noise graph of a 1D sample 2D slice of the function Power spectrum 44
  • 45. Value Gradient Noise Gradient noise 는 정수 lattice point 모두 value = 0(zero) Z ero 들의일반적인 패턴은 눈에 띄는 Grid 패턴을 만듬 gradiant noise 장점을 유지하면서 이 문제를 피하기 위해 Value method 와 Gradient method 를 혼합 Value noise 와 Gradient Noise 와의 Weig hted sum(가중치 합) 만으로 구현 45
  • 46. Value Gradient Noise graph of a 1D sample 2D slice of the function Power spectrum [Catmull-Rom vnoise 와 gradient gnoise 의 weighed sum] 46
  • 47. Value Gradient Noise graph of a 1D sample 2D slice of the function Power spectrum [Cubic Hermite Interpolation] 47
  • 48. Value-Gradient Noise Hermite interpolation Hermite spline 은 Spline value 와 Spline value 각각의 End point 에서의 Tangent 에 의해 결정하며 Gradient 값을 spline tangent 로 사용 48
  • 49. Lattice Convolution Noise Lattice noise 의 한가지 단점은 “axis-aligned 아티팩트” l attice PRN을 Blend 할때 보간의 비등방성(anisotrophic) 특성때문 불연속 Convolution technique을 사용해서 비등방성을 피하는 것 Lattice point에서 PRN들은 Random value 들이 impulse인 것으로 다루고, 방사형 구조로 대칭적인 filter 와 convolve Catmull-Rom Filter 를 사용, Input-Point로부터의 거리계산된 것의 합에서 사 용되는 계산 비용을 줄일 수 있음 49
  • 50. Lattice Convolution Noise catrom2 함수가 호출 squared distance function 으로 Catmull-Rom filter 값들이 있는 table 을 참조하여 계산 이 table 로 부터 look-up value 를 호출 50
  • 51. Lattice Convolution Noise graph of a 1D sample 2D slice of the function Power spectrum 51
  • 52. Sparse Convolution Noise random 하게 분포되어있는 random 값의 collection 으로 구 성된 filter function 을 convolve White Noise 의 Low-pass Filtering 은 Filter Function 에 의해 수행 되기 때문에 Filter 를 modify 함으로써 제어할 수 있음 PRN값들이 각각의 lattice cell내에 pseudorandom point 들로 자리잡고 있다는 점이 다름 52
  • 53. Sparse Convolution Noise 3개의 랜덤값이 생성되어 각각의 lattice cell에 위치 125개의 lattice cell들 주변에 위치한 cell들은 각각의 cell들이 noise function 이라고 간주 계산 비용이 비쌈 53
  • 54. Sparse Convolution Noise graph of a 1D sample 2D slice of the function Power spectrum 54
  • 55. Explicit Noise Algorithms Implicit procedural texture 합성을 할때 Noise를 생성하는 방법과 랜덤 Fractal을 그렇게 편리하지 않음 Explicit 방식은 Noise 값들을 한번에 모두 하나의 큰 Batch로 생성 랜더링 하는 동안 implicit procedural texture안에서 사 용하기 위해서는, noise value 들은 렌더링 하기 전에 generate 해서 table이나 texture image 로 저장되여야함 55
  • 56. Explicit Noise Algorithms Midpoint displacement method (Fournier, Fussell, Carpenter 1982) 56
  • 57. Fourier Spectral Synthesis 주어진 frequency 에서, 원하는 noise 에 근접하게 맞는 power 상태에 서 불연속 유사랜덤 frequency 스펙트럼을 생성 지정된 frequency 범위내에서 해당 frequency에 대응되는 noi se 값을 얻기 위해, 푸리에 역변환을 수행 cloud texture 를 만들기 위해 사용된 손수 집어낸 많은 "random" 계수 (coefficient)들을 보여줌 57
  • 59. Fourier Spectral Synthesis  discrete 푸리에 역변환을 구현하기 위해 specturm 합을 사용해서, 지정된 random frequency 범위 내에서 해당 frequency에 대응되는 function 값을 generation  FFT(푸리에 변환) 보다는 덜 효율적이지만, implicit procedural texture 에서 한번에 한 point 값을 구 할 수 있는 장점  Gardner 의 texture 가 불규칙하고 복잡해 보이는 것도 noise처럼 보이는 확률함수로 위장  noise 를 그대로 푸리에 합성하면 lattice noise 보다 너무 느리고, procedural texture 합성의 실용성 을 잃게 될 것임  Lattice convolution 과 sparse convolution 방법들은 noise 의 spectrum 을 보다 섬세하게 제어할 수 있음이 보장되는 방법 59
  • 60. Reference • http://www.siggraph.org/education/materials/HyperGraph/mapping/r_wolfe/r_wolfe_mapping_6.htm • http://blog.naver.com/sorkelf/40156271551 • http://blog.daum.net/rockeracer/7 • http://freespace.virgin.net/hugo.elias/models/m_perlin.htm • http://mrl.nyu.edu/~perlin/ • http://www.redwiki.net/wiki/wiki.php/Perlin%20Noise#s-11.1 • http://www.dreamincode.net/forums/topic/66480-perlin-noise/ • http://www.csee.umbc.edu/~ebert/691/Au00/Notes/procedural.html • http://developer.nvidia.com/node/106 • http://www.scratchapixel.com/lessons/3d-advanced-lessons/noise-part-1/introduction/ • http://physbam.stanford.edu/cs448x/old/Procedural_Noise%282f%29Categories.html#LatticeGradientNoises • http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter26.html 60
  • 61. Q&A