ãã€ãºã®äŸã«ã¯ãæ¬äŒŒä¹±æ°ãžã§ãã¬ãŒã¿ãŒïŒRNGïŒã®æ©èœãå«ãŸããŠããŸããããã¯ãçµæã®ç»åãå®éã«ã©ã³ãã ã«èŠããããã«ããã®ã«ååãªæ¯èŒçè¯ãçµæãçæããŸãã 1次å ã2次å ãããã³3次å ã®ããŒãžã§ã³ãå«ãŸããŸãããã®å Žåã®æž¬å®æ°ã¯ãå ¥åããŒã¿ã®ã»ããã®æ°ã«çãããããã«åºã¥ããŠ1ã€ã®æ¬äŒŒã©ã³ãã åºåå€ã圢æãããŸãã
玹ä»ãšåæ©
å€ãã®ã¢ããªã±ãŒã·ã§ã³ã§ã¯ãããçšåºŠã®ãã©ã³ãã æ§ãããŸãã¯ããæ£ç¢ºã«ã¯ãç䌌ã©ã³ãã æ§ããå¿ èŠã§ãã ç§ãã¡ã¯ãarbitraryæçã§äžå®å®ãªãã€ãŸã人ã«ãšã£ãŠããã€ãºãã«èŠããäžé£ã®æå³ã«ã€ããŠè©±ããŠããŸãã ããã«ãåçŸæ§ã®ç®çã§ãã¢ããªã±ãŒã·ã§ã³ã¯ãåãå ¥åå€ïŒãŸãã¯å€ã®ã»ããïŒãåãåã£ããšãã«ååãªä¿¡é Œæ§ã§ãŸã£ããåãã·ãŒã±ã³ã¹ãçæã§ããä¹±æ°ãžã§ãã¬ãŒã¿ãŒãå¿ èŠãšããããšããããããŸãã
ã»ãšãã©ã®ä¹±æ°çæã¢ã«ãŽãªãºã ã§ã¯ãåçæå€ãåã®çæå€ã«äŸåããã·ãŒã±ã³ã¹ã®æåã®çæå€ãå ¥åå€ããçŽæ¥å°åºããããšããäºå®ã«ããããã®èŠä»¶ãæºããããŸãã ä¹±æ°ãžã§ãã¬ãŒã¿ãŒãžã®ãã®ã¢ãããŒãã¯ãOpenCLãªã©ã®é«ã¬ãã«ã®äžŠåã³ã³ãã¥ãŒãã£ã³ã°ãåããèšèªã§ã¯å°é£ã§ãã å€æ°ã®èšç®ã¹ã¬ããã®ããããã«ä¹±æ°ã®1ã€ã®é 次ãœãŒã¹ãåŸ æ©ããããšã䞊ååŠçãšäžŠååŠçã«åºã¥ãã¢ã«ãŽãªãºã ã®ãã¹ãŠã®å©ç¹ããŒãã«ãªããŸãã
ãã®åé¡ã解決ãã1ã€ã®æ¹æ³ã¯ãäºåã«ã©ã³ãã ãªå€ã®å€§ããªããŒãã«ãèšç®ããããšã§ãã ãã®åŸãå䞊åã¹ã¬ããã¯ãã®ããŒãã«ã«äžæã§ãããå³å¯ã«å®çŸ©ãããã€ã³ããã¯ã¹ãäœæããŸãã ããšãã°ãç»åãåŠçããOpenCLã«ãŒãã«ã¯ãã«ãŒãã«ã«ãã£ãŠåŠçãŸãã¯äœæãããŠãããã¯ã»ã«ã®åº§æšã«åºã¥ããŠã€ã³ããã¯ã¹ãèšç®ããããšã«ãããäºåäœæãããããŒãã«ãããšã³ããªãéžæã§ããŸãã
ãã®ã¢ãããŒãã®æ¬ ç¹ã¯ã䞊åã¢ã«ãŽãªãºã ãéå§ããåã«ä¹±æ°ãäœæããé·ãé 次ããã»ã¹ãå¿ èŠã«ãªãããšã§ããããã«ããã䞊ååäžã®ããã©ãŒãã³ã¹ã®åäžãå¶éãããŸãã ãŸããã®å Žåãäºåã«ïŒäžŠåã¢ã«ãŽãªãºã ãéå§ããåã«ïŒå¿ èŠãªä¹±æ°ã®æ°ãå°ãªããšããããç¥ãå¿ èŠããããŸãã ããã¯ãåã¹ã¬ããã䜿çšããã©ã³ãã å€ã®æ°ãåçã«æ±ºå®ããå¿ èŠããã䞊åã¢ã«ãŽãªãºã ã«ãšã£ãŠã¯å°é£ã§ãã
Noiseãµã³ãã«ã³ãŒãã®OpenCLã«ãŒãã«ã¬ãã«é¢æ°ã¯ãäœæ¥ãOpenCLã§äœ¿çšããã䞊åæäœã«åå²ããã¢ã«ãŽãªãºã ã«ããé©ããã¢ãããŒããæ¡çšããŠããŸãã
OpenCLã®ãã€ãºãšä¹±æ°ãäœæãã
OpenCLã§ã¯ãã°ããŒãã«ã¯ãŒã¯ã¹ããŒã¹ïŒäœæ¥é ç®ã®é åïŒã¯ã1ã2ããŸãã¯3次å ã䜿çšããŠå®çŸ©ãããŸãã ãã®ã°ããŒãã«ã¹ããŒã¹ã®åäœæ¥é ç®ã«ã¯ãã°ããŒãã«ã¹ããŒã¹ã®XãYãZ軞ã«æ²¿ã£ã座æšã«å¯Ÿå¿ããæŽæ°å€ãèå¥ããäžæã®ã»ããããããŸãã
ãã€ãºã®äŸã®Perlinãã€ãºé¢æ°ãšä¹±æ°ãžã§ãã¬ãŒã¿ãŒã¯ãæ倧3ã€ã®å ¥åå€ã«åºã¥ããŠä¹±æ°ïŒãã€ãºïŒãäœæããŸããããã¯åäœæ¥é ç®ã®ã°ããŒãã«èå¥åã«ãªããŸãã å¥ã®ã¢ã«ãŽãªãºã ããããŸããã°ããŒãã«èå¥åãšãã«ãŒãã«ãåä¿¡ãŸãã¯äœæããããŒã¿å€ãçµã¿åãããããšã§ã1ã€ä»¥äžã®å€ãäœæã§ããŸãã
ããšãã°ã次ã®OpenCLã«ãŒãã«ã³ãŒãã¹ããããã¯ã2次å ã®ã°ããŒãã«ãªäœæ¥é ç®èå¥åã«åºã¥ããä¹±æ°ã®äœæã瀺ããŠããŸãã
kernel void genRand() { uint x = get_global_id(0); uint y = get_global_id(1); uint rand_num = ParallelRNG2( x, y ); ...
å³1.ä¹±æ°ã®äœ¿çšäŸïŒ2次å ïŒ
ãã®ã¢ãããŒãã«ãããã¯ãŒã¯ã¢ã€ãã éã§ä¹±æ°ãžã§ãã¬ãŒã¿ãŒãŸãã¯ãã€ãºã®æ©èœã䞊è¡ããŠå®è¡ã§ããŸãããåæã«ãã¯ãŒã¯ã¢ã€ãã éããã³åãã¯ãŒã¯ã¢ã€ãã å ã®ä»ã®å€éã§ã©ã³ãã ã«å€åããå€ã®å埩å¯èœãªã·ãŒã±ã³ã¹ã§çµæãååŸã§ããŸãã è€æ°ã®2次å ã®å€ã»ãããäœæããå¿ èŠãããå Žåã¯ã3次å ã®äœæé¢æ°ã䜿çšã§ããŸãïŒæåã®2ã€ã®å ¥åå€ã¯ã¯ãŒã¯ã¢ã€ãã ã®ã°ããŒãã«èå¥åããååŸããã3çªç®ã®æ¬¡å ã¯å¿ èŠãªè¿œå ã®å€ããšã«åæå€ãé£ç¶çã«å¢å ãããããšã«ãã£ãŠååŸãããŸãã ãã®ã¢ã«ãŽãªãºã ã¯ãPerlinãã€ãºã䜿çšãã次ã®äŸã®ããã«ã3次å ã©ã³ãã å€ãŸãã¯ãã€ãºå€ã®ããã€ãã®ã»ããã§æ©èœããããã«æ¡åŒµã§ããŸãã
kernel void multi2dNoise( float fScale, float offset ) { float fX = fScale * get_global_id(0); float fY = fScale * get_global_id(1); float fZ = offset; float randResult = Noise_3d( fX, fY, fZ ); ...
å³2. Perlinã®ãã€ãºã¢ã«ãŽãªãºã ã®äœ¿çšäŸïŒ3次å ïŒ
å¶éäºé
Noise_2dããã³Noise_3dé¢æ°ã¯åãåºæ¬çãªPerlinãã€ãºã¢ã«ãŽãªãºã ã䜿çšããŸãããPerlinã®æšå¥šäºé ã«åºã¥ããŠå®è£ ãç°ãªããŸãã ïŒåç §ãªã¹ãã®æåã®ãªã³ã¯ãåç §ããŠãã ãããïŒNoiseãµã³ãã«ã§ã¯ãâânoiseãµã³ãã«ã§ã¯Noise_3dã®ã¿ã䜿çšãããNoise_2dãã¹ãã«ãŒãã«ã¯ããã®ãµã³ãã«ãå€æŽããŠè©ŠããŠã¿ããèªè ã®ããã«Noise.clãã¡ã€ã«ã«å«ãŸããŠããŸãã
Noise_2dããã³Noise_3dé¢æ°ã¯ãå ¥åæµ®åå°æ°ç¹å€ã§åŒã³åºãå¿ èŠããããŸãã ã©ã³ãã ãªå€ã®ãããŒãã«ãïŒå³3ãåç §ïŒã®ãµã€ãºãæå®ããã«ã¯ãå€ã¯ïŒ0.0ã128.0ãªã©ïŒäœããã®ç¯å²ãã«ããŒããå¿ èŠããããŸãã èªè ã¯ãã¯ã©ãŠãã®äŸãèŠãŠãPerlinã®ãã€ãºãããŸããŸãªãèªç¶ã«èŠãããç»åã«å€æããæ¹æ³ã確èªããŠãã ããã
ã©ã³ãã ãã¹ãã§äœ¿çšãããããã©ã«ãã®ParallelRNGé¢æ°ã¯ãã©ã³ãã ãªïŒããã³åæ§ã®ïŒçµæãæäŸããŸãããæéã®ä¹±æ°çæã¢ã«ãŽãªãºã ã§ã¯ãããŸããã ãã®é¢æ°ã¯ãå ã¯ä¹±æ°ãžã§ãã¬ãŒã¿ãŒãšããŠäœ¿çšããããšãæå³ããŠããªãããŠã©ã³ããã·ã¥ãã«åºã¥ããŠããŸãã ããã«ãããããããä¹±æ°ãžã§ãã¬ãŒã¿ãŒã®ããã€ãã®äžè¬çãªæ©èœïŒNoise.clãã¡ã€ã«å ã®ã³ã¡ã³ãã¢ãŠããããäŸïŒã¯ãç¹ã«çµæã®äžäœãããã®ãããã§2次å ç»åãåãããšãã«ç®ã«èŠããåçŸæ§ã瀺ããŸããã èªè ã¯ãä¹±æ°ãžã§ãã¬ãŒã¿ãŒã®ä»ã®ïŒããé«éãªïŒé¢æ°ãè©Šãããšãã§ããŸãã
ããã©ã«ãã®ParallelRNGé¢æ°ã¯ãçµæãšããŠ32ãããã®ç¬Šå·ãªãæŽæ°ã®ã¿ãçæããŸãã ïŒ0.0ã1.0ïŒãªã©ã®ç¯å²ã§æµ®åå°æ°ç¹å€ãå¿ èŠãªå Žåãã¢ããªã±ãŒã·ã§ã³ã¯ãã®ç¯å²ã®ãããã³ã°ãé©çšããå¿ èŠããããŸãã ã©ã³ãã ãã¿ãŒã³ã¯ãã©ã³ãã ãªç¬Šå·ãªãæŽæ°ã®çµæãšç¯å²ïŒ0ã255ïŒãç §åããŠãã°ã¬ãŒã¹ã±ãŒã«ãã¯ã»ã«å€ãäœæããŸãã ãããè¡ãã«ã¯ããã€ããªANDæŒç®ãé©çšããŠ8ããããéžæããŸãã
ããã©ã«ãã®ParallelRNGé¢æ°ã¯ãåã«äœæãããå€ã«åºã¥ããŠãé£ç¶ããåŒã³åºãã«å¯ŸããŠ4,294,967,296ïŒ 2,232 ïŒãã¹ãŠã®ç¬Šå·ãªãæŽæ°å€ãçæããŸããã åã ã®åæå€ããšã«ãç䌌ã©ã³ãã ã·ãŒã±ã³ã¹ïŒãµã€ã¯ã«ïŒã®å€ã¯ãåèš7000ã®äžæã®å€ããçŽ20åã®å€ãŸã§ã®ç¯å²ã«ãªããŸãã ParallelRNGé¢æ°ã¯ãçŽ20ã®ç°ãªããµã€ã¯ã«ãäœæããŸãã èè ã¯ãOpenCLã«ãŒãã«ã®ã©ã®äœæ¥èŠçŽ ããæå°ã®ã«ãŒãã§åœ¢æããããããå€ãã®ä¹±æ°ãé£ç¶ããŠçæããå¿ èŠããããšã¯èããŠããŸããã
ãã®é¢æ°ã®2次å ããã³3次å ããŒãžã§ã³ïŒParallelRNG2ããã³ParallelRNG3ïŒã¯ãåã®ParallelRNGåŒã³åºãã®çµæãšãµã€ã¯ã«é·ãå€æŽãã次ã®å ¥åå€ã®éã«ãã€ããªXORæŒç®ãé©çšããããšã«ãããã«ãŒãããã·ã³ã°ã䜿çšããŸãã ããã§ãããã®ãããªå€æŽãããåäœã¯è©³çŽ°ãªåæã®å¯Ÿè±¡ã§ã¯ãªãã£ããããParallelRNGé¢æ°ãã¢ããªã±ãŒã·ã§ã³ã®ããŒãºãæºãããŠããããšã泚ææ·±ã確èªããããšããå§ãããŸãã
ãããžã§ã¯ãæ§é
ãã®ã»ã¯ã·ã§ã³ã§ã¯ããµã³ãã«ã¢ããªã±ãŒã·ã§ã³ã®ãœãŒã¹ã³ãŒãã®åºæ¬èŠçŽ ã®ã¿ããªã¹ãããŸãã
NoiseMain.cppïŒ
ã¡ã€ã³ïŒïŒ
ã¡ã€ã³å ¥åæ©èœã ã³ãã³ãã©ã€ã³ãã©ã¡ãŒã¿ãŒã解æããåŸãOpenCLãåæåããNoise.clãã¡ã€ã«ããOpenCLããã°ã©ã ãã³ã³ãã€ã«ããã«ãŒãã«ã®1ã€ãèµ·åçšã«æºåãã ExecuteNoiseKernelïŒïŒãåŒã³åºããŠããExecuteNoiseReferenceïŒïŒãåŒã³åºããŸãã ãããã®2ã€ã®å®è£ ãåãçµæãäžããããšã確èªããåŸã mainïŒïŒã¯ãããã®åæ©èœã®åäœæéã«é¢ããæ å ±ãæäŸãããããã®äœæ¥ããçããç»åãä¿åããŸãã
ExecuteNoiseKernelïŒïŒ
OpenCLã§éžæãããã€ãºã«ãŒãã«ãæ§æããŠå®è¡ããŸãã
ExecuteNoiseReferenceïŒïŒ
éžæãããã€ãºCåç §ã³ãŒããæ§æããŠå®è¡ããŸãã
Noise.clïŒ
defaut_perm [256]
3次å ã®ããŒãªã³ãã€ãºã®ã³ã¢ã®ã©ã³ãã å€0ã255ã®è¡šã ã©ã³ãã æ§ãããã«é«ããããã«ããã®ããŒãã«ãçæããPerlinãã€ãºã®ã³ã¢ã«éä¿¡ã§ããŸãã
grads2d [16]
16åã®åäžã«ååžããåäœãã¯ãã«ã2次å ã®ããŒãªã³ãã€ãºã®ã³ã¢ã®åŸé ã
grads3d [16]
3次å ã®ããŒãªã³ãã€ãºã®ã³ã¢ã«å¯Ÿãã16ã®ãã¯ãã«ã°ã©ããŒã·ã§ã³ã
ParallelRNGïŒïŒ
æ¬äŒŒä¹±æ°ãžã§ãã¬ãŒã¿ã1ã€ã®å ¥åå€ã«å¯ŸããŠ1ã€ã®ãã¹ã ä¹±æ°ãžã§ãã¬ãŒã¿ãŒã®ä»£æ¿æ©èœã¯ã³ã¡ã³ãåãããŠããŸãããããéãæ©èœãããæªãçµæãããããæ©èœãèªè ããã¹ããããå Žåã«åããŠããã¡ã€ã«ã«è¿œå ãããŸãã
ParallelRNG2ïŒïŒ
2ã€ã®å ¥åå€ã«å¯ŸããŠ2ã€ã®ãã¹ãå®è¡ããä¹±æ°ãžã§ãã¬ãŒã¿ãŒã
ParallelRNG3ïŒïŒ
3ã€ã®å ¥åå€ã«å¯ŸããŠ3ã€ã®ãã¹ãå®è¡ããä¹±æ°ãžã§ãã¬ãŒã¿ãŒã
weight_poly3ïŒïŒãweight_poly5ïŒïŒããã³WEIGHTïŒïŒ
ãããã¯ãåŸé ã®é£ç¶æ§ã確ä¿ããããã«Perlinãã€ãºã¢ã«ãŽãªãºã ã§äœ¿çšããã代æ¿ã®éã¿é¢æ°ã§ãã 2次ïŒåªå ïŒé¢æ°ã¯ã2次å°é¢æ°ã®é£ç¶æ§ãä¿èšŒããŸãã WEIGHTãã¯ãã¯ã䜿çšããæ©èœãéžæããŸãã
NORM256ïŒïŒ
ç¯å²ïŒ0ã255ïŒãïŒ-1.0ã1.0ïŒã«å€æãããã¯ãã
interpïŒïŒ
OpenCLã䜿çšããåç·åœ¢è£éã
hash_grad_dot2ïŒïŒ
åŸé ãéžæããPerlinãã€ãºé¢æ°Noise_2dã®äžéšãšããŠå ¥åXYå€ãæã€ã¹ã«ã©ãŒç©ãèšç®ããŸãã
Noise_2dïŒïŒ
2ã€ã®å ¥åå€ãæã€Perlinãã€ãºãžã§ãã¬ãŒã¿ãŒã
hash_grad_dot3ïŒïŒ
åŸé ãéžæããPerlinãã€ãºé¢æ°Noise_3dã®äžéšãšããŠå ¥åXYZå€ãæã€ã¹ã«ã©ãŒç©ãèšç®ããŸãã
Noise_3dïŒïŒ
3ã€ã®å ¥åå€ãæã€Perlinãã€ãºãžã§ãã¬ãŒã¿ãŒã
ã¯ã©ãŠãïŒïŒ
Noise_3dã䜿çšããŠCloudTestã®åäžãã¯ã»ã«ã®ãã¯ã©ãŠããåºåç»åãäœæããŸãã
map256ïŒïŒ
ããŒãªã³ãã€ãºã®åºåç¯å²ïŒ-1.0ã1.0ïŒãã°ã¬ãŒã¹ã±ãŒã«ãã¯ã»ã«ã®çæã«å¿ èŠãªç¯å²ïŒ0ã255ïŒã«å€æããŸãã
CloudTestïŒïŒ
ã¯ã©ãŠãã€ã¡ãŒãžãã¹ãã ã¹ã©ã€ã¹ãã©ã¡ãŒã¿ãŒã¯ã¯ã©ãŠãé¢æ°ã«æž¡ããããããã·ã¹ãã ã³ãŒãã¯ä»ã®ã¯ã©ãŠãã€ã¡ãŒãžãäœæã§ããŸãã
Noise2dTestïŒïŒ
Noise_2dãã¹ãã¯ããã©ã«ãã§ã¯äœ¿çšãããŸããã
Noise3dTestïŒïŒ
Noise_3dã®ãã¹ã-ããã©ã«ãã§ã®ããŒãªã³ãã€ãºé¢æ°ã map256ã䜿çšããŠãã°ã¬ãŒã¹ã±ãŒã«ç»åã®ãã¯ã»ã«å€ãååŸããŸãã
RandomTestïŒïŒ
ParallelRNG3ãã¹ãã¯ã笊å·ãªãæŽæ°çµæã®æäžäœãã€ãã䜿çšããŠãã°ã¬ãŒã¹ã±ãŒã«ã€ã¡ãŒãžãçæããŸãã
Visual StudioããŒãžã§ã³2012ããã³2013çšã«2ã€ã®Microsoft Visual Studioãœãªã¥ãŒã·ã§ã³ãã¡ã€ã«ãæäŸãããŠããŸãããããã¯Noise_2012.slnãšNoise_2013.slnã§ãã èªè ãVisual Studioã®æ°ããããŒãžã§ã³ã䜿çšããŠããå ŽåãVisual Studioã®ãœãªã¥ãŒã·ã§ã³ãšãããžã§ã¯ãã®æŽæ°æ©èœã䜿çšããŠããããã®ãã¡ã€ã«ã«åºã¥ããŠæ°ãããœãªã¥ãŒã·ã§ã³ãäœæã§ããŸãã
ã©ã¡ãã®ãœãªã¥ãŒã·ã§ã³ãã ã€ã³ãã«Â®OpenCLâ¢ã³ãŒããã«ããŒãã·ã¹ãã ã«ã€ã³ã¹ããŒã«ãããŠããããšãåæãšããŠããŸãã
ãµã³ãã«ç®¡ç
ãã®ãµã³ãã«ã¯ã.exeãã¡ã€ã«ããããã©ã«ããŒã®Microsoft Windows *ã³ãã³ãããã³ããããå®è¡ã§ããŸãã
Noise.exe <>
ãã©ã¡ãŒã¿
-h --help
ã³ãã³ãã©ã€ã³ã«ãã«ãã衚瀺ããŸãã ãã¢ã³ã¹ãã¬ãŒã·ã§ã³ã¯ããªã¬ãŒãããŸããã
-t --type [ all | cpu | gpu | acc | default | < OpenCL>
OpenCLã«ãŒãã«ãå®è¡ãããããã€ã¹ã®ã¿ã€ããéžæããŸãã ããã©ã«ãå€ã¯allã§ãã
CL_DEVICE_TYPE_ALL | CL_DEVICE_TYPE_CPU | CL_DEVICE_TYPE_GPU |
CL_DEVICE_TYPE_ACCELERATOR | CL_DEVICE_TYPE_DEFAULT
<OpenCLããã€ã¹ã¿ã€ãå®æ°>
-p --platform < >
䜿çšãããã©ãããã©ãŒã ã®éžæã ãã¢ãéå§ããããšããã¹ãŠã®ãã©ãããã©ãŒã çªå·ãšååã®ãªã¹ãã衚瀺ãããŸãã [éžææžã¿]ã¯ã䜿çšãããã©ãããã©ãŒã ã®å³åŽã«è¡šç€ºãããŸãã æååã䜿çšããå Žåããã©ãããã©ãŒã åãäžæã«èªèããã®ã«ååãªæåãæå®ããŸãã ããã©ã«ãå€ã¯Intelã§ãã
-d --device < >
OpenCLã³ã¢ãå®è¡ãããããã€ã¹ãçªå·ãŸãã¯ååã§éžæããŸãã ãã¢ã³ã¹ãã¬ãŒã·ã§ã³ãéå§ããããšã䜿çšãããŠãããã©ââãããã©ãŒã äžã®ãã¹ãŠã®çªå·ãšããã€ã¹åã®ãªã¹ãã衚瀺ãããŸãã çŸåšã®ããã€ã¹ã®å³åŽã«ã[éžææžã¿]ã衚瀺ãããŸãã ããã©ã«ãå€ã¯0ã§ãã
-r --run [ random | perlin | clouds ]
å®è¡ããæ©èœãã¢ãéžæããŸãã ä¹±æ°ãžã§ãã¬ãŒã¿ãŒãPerlinãã€ãºã¢ã«ãŽãªãºã ãããã³ã¯ã©ãŠãã€ã¡ãŒãžãžã§ãã¬ãŒã¿ãŒã«ã¯ãã¢ã«ãŒãã«ããããŸãã ããã©ã«ãå€ã¯ã©ã³ãã ã§ãã
-s --seed < >
ã¢ã«ãŽãªãºã ã®çµæãå€åããæŽæ°å ¥åå€ã ããã©ã«ãå€ã¯1ã§ãã
Noise.exeã¯ãOpenCLã³ã¢ã®å®è¡æéãšåçã®åç §Cã³ãŒããããã³äž¡æ¹ã®ã¢ã«ãŽãªãºã ã®åºåãã¡ã€ã«ã®ååã衚瀺ããŸãã æ å ±ã®åºåãå®äºãããšãããã°ã©ã ã¯ãŠãŒã¶ãŒãçµäºããåã«EnterããŒãæŒãããšãæåŸ ããŸãã Cåç §ã³ãŒãã®æ©èœã¯æé©åãããŠããªãããšã«æ³šæããŠãã ãã;ãããã®ç®çã¯ãOpenCLã«ãŒãã«ã³ãŒãã®æ£ç¢ºããæ€èšŒããããšã ãã§ãã
çµæåæ
Noise.exeãå®äºããããäœæ¥ãã©ã«ããŒã®BMPã€ã¡ãŒãžãã¡ã€ã«OutputOpenCL.bmpãšOutputReference.bmpãåç §ããŠãOpenCLãšC ++ã³ãŒãã®çµæãæ¯èŒããŸãã 2ã€ã®ç»åã¯åãã§ããå¿ èŠããããŸãããPerlinãã€ãºã®2ã€ã®ç»åéãŸãã¯é²ã®2ã€ã®ç»åéã«ã¯ããããªéããããå ŽåããããŸãã
ãã€ãºã¢ã«ãŽãªãºã ã®çµæïŒPerlinãã€ãºïŒã¯å³3ã®ããã«ãªããŸãã
å³3. Perlinãã€ãºã¢ã«ãŽãªãºã ã®çµæ
ã©ã³ãã ã¢ã«ãŽãªãºã ïŒä¹±æ°ãžã§ãã¬ãŒã¿ãŒïŒã®çµæã¯ãå³4ã®ããã«ãªããŸãã
å³4.ä¹±æ°ãžã§ãã¬ãŒã¿ãŒã®çµæ
ã¯ã©ãŠãã¢ã«ãŽãªãºã ã®çµæã¯ãå³5ã®ããã«ãªããŸãã
å³5.ã¯ã©ãŠãäœæã¢ã«ãŽãªãºã ã®çµæ
åç §è³æ
- C.ããŒãªã³ãKãããã€ãºæ¹åã
- ã4ãã€ãæŽæ°ã®ããã·ã¥ã
- M.ãªãŒããŒãã³ïŒMAïŒããé«éé«å質䞊åä¹±æ°ãžã§ãã¬ãŒã¿ãŒããDrãWebãµã€ã ããã¹ïŒ2011ïŒ
- ã€ã³ãã«Â®ããžã¿ã«ä¹±æ°ãžã§ãã¬ãŒã¿ãŒïŒDRNGïŒã©ã€ãã©ãªã®å®è£ ãšäœ¿çš
- ã€ã³ãã«ãœãããŠã§ã¢ã©ã€ã»ã³ã¹ã®ãµã³ãã«ã©ã€ã»ã³ã¹å¥çŽ
- ã€ã³ãã«Â®OpenCLâ¢ã³ãŒããã«ããŒ