倩æ°ã®åœ±é¿ãæ£ããã·ãã¥ã¬ãŒãããã¿ã¹ã¯ã¯ãã²ãŒã æ¥çã®ãŸãã«èšç«ããã»ãŒäŒžã³ãŠããŸãã 倩æ°ã¯ç§ãã¡ã®ç掻ã®äžå¯æ¬ ãªéšåã§ããã€ãŸãã倩æ°ã®åœ±é¿ã®ãªãã²ãŒã ã¯å®å
šã§ã¯ãããŸããã ããããçããã²ãŒã ãå°ãªããšãéåžžã«åå§çãªå€©æ°ã·ãã¥ã¬ãŒã·ã§ã³ãªãã§è¡ãçç±ã§ãã ã¿ã¹ã¯ã¯éåžžã«å€ããããæããã«å¹çãäœãã«ãããããããçŸåšã䜿çšããç¶ããŠããå€ãã®å€ããœãªã¥ãŒã·ã§ã³ããããŸãã ãããŠãéåžžã®é§ã§ãã¹ãŠãåçŽãªå Žåãéæ°Žéã®å®è£
ã¯ç¹å®ã®å°é£ãåŒãèµ·ãããŸãã
ã§ã¯ãçŸå®ã®äžçã§éšãéªãšã¯äœã§ããïŒ
ãããã¯ãå°çèªäœããé²ãŸã§ã®ç©ºéãã»ãŒåçã«åããæ°åååã®å°ããªç²åã§ãã ç¡å¶éã®ã³ã³ãã¥ãŒãã£ã³ã°ãªãœãŒã¹ãããå Žå-éæ°Žéãã·ãã¥ã¬ãŒãããããã«è¡ãå¿
èŠãããã®ã¯ãå Žæã«åçã«åæ£ããããã®10ååã®ç²åãåŠçããããšã ãã§ãã ããããç§ãã¡ã®èšç®èœåã¯éåžžã«éãããŠãããå°åœ¢ãç©äœããã®ä»ãã¹ãŠãå«ãŸãªãå Žæãéæ°Žã®ã¿ã§æ§æãããå Žåã«éãããªã¢ã«ã¿ã€ã ã§100äžåã®ç²åã§ããèšç®ã§ããŸãã ååã«ã€ããŠäœãšèšããŸããã
ãã®ç¹ã§ãéæ°Žéãå®è£
ããããã»ã¹ã§ã¯ã3ã€ã®åå¥ã®ã¿ã¹ã¯ã«çŽé¢ããŸãã
- ããŒãã£ã¯ã«ã®æ°ã10åãã蚱容å¯èœãª20ã5äžã«æžãããŸãã
- åããŒãã£ã¯ã«ã®èšç®éãæå°éã«æžãããŸãã
- ãã¹ãŠã®ã³ã³ãã¥ãŒãã£ã³ã°ãGPUã«è»¢éããŸãã
ãŸãããããã©ã®ããã«éæããããæ€èšããŠãã ããã
åçŽãªçµè«ã«åºã¥ããŠãããŒãã£ã¯ã«ã®æ°ãæžãããŸãããªãã¶ãŒããŒã¯10ååã®ããŒãã£ã¯ã«å
šäœãèŠãããšã¯ãããŸããã 圌ã¯åœŒã®åŸãã«ãããŸãã«ãã¯ããã«äžäžã«ç²åãèŠãŸããã ããã«ããããã§ã«ããŒãã£ã¯ã«ã®æ°ã3ã4ååæžãããŸãã ãããã2åã¯å€ãããŸãã ããã§ç§ãã¡ã®å©ãã«å°ãã®ããªãã¯ãæ¥ãŸãã å®éã«ã¯ãç²åã¯éåžžã«å°ãããå®éã«ã¯ãã§ã«æ°ã¡ãŒãã«ã®è·é¢ã§åäžãªããŒã«ã«å€ãããŸãã ãããã£ãŠããæ£çŽã«ããçŽ10ã¡ãŒãã«ã®è·é¢ã§èŠ³æž¬è
ã®åã«ããŒãã£ã¯ã«ã®ã¿ãæç»ããå¿
èŠããããŸãã ãããã®æ¡ä»¶äžã§ã®50,000åã®ç²åã¯ãéåžžã«å¯ãªééªã®å€èŠ³ãäœæããã®ã«ååã§ãã çŸå®ã®äžçã§ã¯ãç²åãµã€ãºã¯ããªã¡ãŒãã«åäœã§æž¬å®ãããããšãç解ããããšãéèŠã§ãã ã³ã³ãã¥ãŒã¿ã·ãã¥ã¬ãŒã·ã§ã³ã®å Žåãç²åãµã€ãºãæ°ã»ã³ãã¡ãŒãã«ãŸã§ç°¡åã«å¢ããããšãã§ããŸãã ãªãã¶ãŒããŒã«ã¯ãç²åã調ã¹ããã®ãµã€ãºãåšå²ã®ãªããžã§ã¯ããšæ¯èŒããæ©äŒããããŸããã
以äžã¯ã次ã®èšå®ã®ééªã®ããå Žæã§ãã15ã¡ãŒãã«ä»¥å
ã®ç²åæ°25,000ãç²åãµã€ãº-10ã»ã³ãã¡ãŒãã«ã20ã100ã¡ãŒãã«ã®è·é¢ã§å¯åºŠ80ïŒ
ã®çœãé§ã
éæ°Žãç¡å¹ã«ãªã£ãŠããåãå Žæã次ã«ç€ºããŸãã
ç²åãµã€ãºãäžèªç¶ã«å€§ãããšããäºå®ã«ãããããããããã¯èŠ³å¯è
ã«ãã£ãŠçµ¶å¯Ÿã«æ£åžžã§ãããšèªèãããŸã-çµå±ã®ãšããã圌ã¯ç²åãŸã§ã®è·é¢ãæšå®ããããšãã§ããã倧ããªç²åã¯éåžžã«è¿ããã倧ãããšæãããŸãã çŸå®ã«ã¯ããã§ã¯ãããŸãããã
2çªç®ã®éèŠãªã¿ã¹ã¯ã¯ãåããŒãã£ã¯ã«ã®èšç®ãæå°éã«æããããšã§ãã åãã¬ãŒã å
ã®25,000åã®ããŒãã£ã¯ã«ã§ãããç®ã«èŠããè² è·ã§ãã ãããã£ãŠãå°ãã§ãæé©åãéèŠã§ãã ããã§ãæãåºããŠã¿ãŸãããïŒç§ãã¡ãçŽ çŽã«ããããšããªãã°ãç§ãã¡ã¯ç²åã«å¯ŸããŠã©ããªèšç®ãããå¿
èŠãããã®ãââïŒ
- XYããªã¥ãŒã ã®ã©ã³ãã 座æšã§ã®çºç
- éåå é
- Z空æ°æµæ
- XãY空æ°æµæïŒé¢šïŒ
- ãžãªã¡ããªãšã®äº€å·®ïŒç²åãã芳å¯è
ããã家ã®å±æ ¹ãªã©ã®é害ç©ãééããªãããã«ããããïŒã
ãããã®ãã©ã¡ãŒã¿ã¯ãæ£ç¢ºãªã·ãã¥ã¬ãŒã·ã§ã³ã«åãçµãã§ããå Žåã«éåžžã«éèŠã§ãã ãã ããã²ãŒã ã§ã¯ãèŠèŠçã³ã³ããŒãã³ããéèŠã§ãããç©çã·ãã¥ã¬ãŒã·ã§ã³ã®ç²ŸåºŠã§ã¯ãããŸããã ãªãã¶ãŒããŒã«ã¯ç¹å®ã®ç²åã®æåã远跡ããæ©äŒããªããããã©ã³ãã æ§ãšæ£çŽãªèšç®ãå®å
šã«åãé€ãããšãã§ããŸãã ç²åãå€æŽããã«ãµã€ã¯ã«ãããµã€ã¯ã«ãžåããã¹ãééããŠãããªãã¶ãŒããŒã¯ããã«æ°ä»ããªãã§ãããã å¥ã®24,999åã®ããŒãã£ã¯ã«ããã¹ã«æ²¿ã£ãŠè¿ãã«ç§»åããŸãïŒã«ãŒãããŠããå Žåã§ãïŒã
ãããã£ãŠïŒ
- ç²åã¯åžžã«ãããã¯ã«å¯ŸããŠåã座æšã«è¡šç€ºãããŸãã ãããã®åº§æšã¯ãé ç¹ãããã¡ãŒãä»ããŠéä¿¡ããã座æšã§ãã
- Zã®å éãšæµæã¯ç¡èŠããäºãã«éãªããšèããŸãã ã€ãŸããããŒãã£ã¯ã«ã¯äžå®ã®é床ã§ç§»åããŸãã
- æ£çŽãªèšç®ãç¡èŠããç²åã®åæXY座æšã«é¢šé*æéãè¿œå ããŸãã
- ãã¹ãŠã®éçãžãªã¡ããªãé«ããããã«ãã€ã¯åŠçããç²åã®Zäœçœ®ãšç²åã®é«ããXY座æšã§åçŽã«ãã§ãã¯ããŸãã ãã®æç¹ã§ç²åãé«åºŠãäžåã£ãå Žå-æç»ããŸããã
ãžãªã¡ããªãšã®åçŽåããã亀差ãåžžã«æ©èœãããšã¯éãããå Žåã«ãã£ãŠã¯ã¢ãŒãã£ãã¡ã¯ããäœæãããããšããããŸãã èŠèŠçã«ã¯ããã€ãããã®ç²åã®å€èŠ³ã®ããã«èŠããŸãã
ããŒãã£ã¯ã«ã¯ã家ã®äžã«ãããã€ã³ããAãã§ãã¹ãéå§ãããã€ã³ããBããŸã§äžéããéãããã¹ãŠæ£åžžã§ãã 圌女ã¯å¹ŸäœåŠã®äžã«ããŸãã 圌女ãé«ããBããè¶ãããšããã«ã圌女ã¯èŠããªããªããŸããã å±æ ¹ã®äžã«ãããŸãã ããã¯ããã€ã³ããCããééãããŸã§ç¶ããŸãã 颚ã®åœ±é¿ã«ãããç²åã¯å®¶ã®å€ã«ç§»åãããžãªã¡ããªãããé«ãããšãå€æããŸããããã®çµæãç²åã¯åã³èŠããããã«ãªããŸããã èŠèŠçã«ã¯ã家ã®å£ããç²åããèŠãããããã«èŠããŸãã ããã¯ããªãäžå¿«ãªã¢ãŒãã£ãã¡ã¯ãã§ãããååšããããšã念é ã«çœ®ãå¿
èŠããããŸãã ç²åãã¯ãã«ãšãžãªã¡ããªã®äº€å·®ããæ£çŽã«ãèšç®ããããšãããšãéæ°Žã·ã¹ãã ã®åäœãéåžžã«é
ããªãå±éºããããŸãã ããããããªãåçŽãªãã³ãããããŸãã颚ã«ããç²åã®åå·®ã«åŸã£ãŠé«ãããããå€æŽããŸãã
ãã®ãœãªã¥ãŒã·ã§ã³ã®å¯äžã®æ¬ ç¹ã¯ã颚ãå€ãã£ããšãã«æšé«ããããåæ§ç¯ããå¿
èŠãããããšã§ãã
Igrostroyã¯åžžã«ã¢ãŒãã£ãã¡ã¯ããšé床ã®åŠ¥åç¹ã§ããããã®ã±ãŒã¹ã¯ãã®ãããªåŠ¥åæ¡ã®äžäŸã«ãããŸããã ã¢ãŒãã£ãã¡ã¯ãã¯ã颚éãé«ãã»ã©é¡èã«ãªããŸãã
æé©åã®æåŸã®æ®µéã¯ãã³ã³ãã¥ãŒãã£ã³ã°ã®GPUãžã®ç§»è¡ã§ãã å®éãåã®ã¹ãããã®åŸã«ç¹å¥ãªèšç®ã¯ãããŸããã§ããã
XY座æšã¯ãåç¹ãšé¢šã«ãã£ãŠè¿œå ããããªãã»ããããèšç®ãããŸãã
XY = Start.xy +颚*æé;
Z座æšã¯ãèœäžé床ã®åæ座æšããæéãåŒããŠèšç®ãããŸãã
Z = Start.z-é床*æé
ããŠãæåŸã«-ç²åã®å¯èŠæ§ã¯ããã®ç¹ã§åŸãããZ座æšãšãžãªã¡ããªã®é«ããæ¯èŒããããšã§æ±ºå®ãããŸãã
IsVisible = MapHeightïŒXYïŒ<Z
ããã3ã€ã®æäœã¯ãã¹ãŠãGPUã«ç°¡åã«è»¢éã§ããŸãã 芳å¯è
ããã®è·é¢ãç
§æã®äœ¿çšããã®ä»ã®ããããªããšãèæ
®ããŠãéæ床ã®èšç®ããããŸãã ãããããããã¯ãã§ã«GPUã«é©çšãããŠãããæããã«ã転éäžã«åé¡ã«ãªãããšã¯ãããŸããã
äžèšã®ãã¹ãŠã®ç¹å®ã®å®è£
ã®èª¬æã«é²ãåã«ãå®è£
ã®å¥ã®éèŠãªåŽé¢ã«ã€ããŠè©³ãã説æãã䟡å€ããããŸãã ã€ãŸããäœæããããŒãã£ã¯ã«ã®ãããã¯ãäžçã®ã©ãã«æç»ããããããã³ã©ã®ãããªåœ¢ç¶ã«ãããã決å®ããéã«ã
å®è£
æã«æåã«é ã«æµ®ãã¶ã®ã¯ãåæ±ã®äžéšã§ããã芳å¯è
ã®åº§æšãšéå°ã®é¢ã«æ²¿ã£ãã»ã¯ã·ã§ã³ãäžå¿ãšããŠããŸãã
ããã¯éåžžã«é
åçãªãªãã·ã§ã³ã§ãã çµæãšããŠçããåæ±ã®äžéšå
ã§ã®ã¿ç²åãçæããããã芳å¯è
ãèŠããŸãŒã³ã§ã®ã¿äœæ¥ããããšãã§ããŸãã ã€ãŸããçæããã50,000åã®ããŒãã£ã¯ã«ã®ã»ãŒãã¹ãŠãç»é¢ã«è¡šç€ºãããŸãïŒ ãšãŠãçµæžçã§ãïŒ ãããã芳å¯è
ã«ã«ã¡ã©ãåããããå転ããããããèœåãäžãããšããã¹ãŠãå£ããŸãã ç²åãéå°ã®å
éšã«æ®ãããã«ã¯ã芳枬è
ãšãšãã«åæ±ã移åããå¿
èŠããããŸãã ã€ãŸãã芳å¯è
ãã©ã®ããã«ç§»åããŠå転ãããã«é¢ä¿ãªãã圌ã¯åžžã«åãç²åãèŠãŸãïŒ ããã¯ãã¡ã§ãã ãããã£ãŠãå¥ã®ãªãã·ã§ã³ã«çŠç¹ãåœãŠãŸããéåããç²åããããããããŸãããã«ã¡ã©ã®å転ãšç§»åã¯ç²åã·ã¹ãã ã®ä»äºãå£ããŸãããã«ã¡ã©ã移åããŠå転ããããšãå®éã«ã¯åãç²åã§ãããæ°ããç²åãèŠãŠããããã«æããŸãç²åã
ã¢ã€ãã¢ã¯ããã¥ãŒãã®åœ¢ã®ãŸãŒã³ã§äœæ¥ããŠãããšããããšã§ãã åæåæåäžã«ãç²åã¯ç«æ¹äœã®å¯žæ³ã«åŸã£ãŠXoYå¹³é¢ã«ã©ã³ãã ã«é
眮ãããŸãã
ç²å座æšã¯ããããã¯ã®ãµã€ãºã§äžçã®åç¹ã«ããæ£æ¹åœ¢ã®ããŒã¹ãå¡ãã€ã¶ããŸãã
é»ãç¹ã¯ããã®ãŸãŸç²åã®åº§æšã瀺ããŸãã èµ€ã¯åãç²åã§ããããã¯ã®ãµã€ãºã«ãã£ãŠã®ã¿çžæ®ºãããŸãã ä»çµã¿ïŒèŠ³æž¬è
ã®éå°ããããŸãã ãã¥ãŒããåããéå°ã«å
¥ããŸãã å»å°ã®äž»ãªæ¡ä»¶ã¯3ã€ã§ãã
1ïŒãŠãããã¯å転ããŸããã ç¢æã¯ç§»åããããšã«ãã£ãŠã®ã¿å®è¡ãããŸãã
2ïŒãªãã¶ãŒããŒã®åº§æšã¯ãããã¯ã«å«ãŸããŠããå¿
èŠããããŸãã
3ïŒèŠ³å¯è
ããéå°ã®äž¡é¢ãšãããã¯ã®åŽé¢ã®äº€ç¹ãŸã§ã®è·é¢ã¯ãã§ããã ãçããããå¿
èŠããããŸãã
éå°ã«ãããã¯ãå»ãã åŸã次ã®ãããªçµæãåŸãããŸãã
éå°ã¯ç§ãã¡ã®ãããã¯ãããã¯ããã«å€§ããã§ãããåé¡ã§ã¯ãããŸããã ç²åã¯ã芳枬è
ãããããæ°ã¡ãŒãã«é¢ããŠããå¿
èŠããããŸãã
å
æ¥ãããã¯ã®åº§æšãååŸãããã颚ã®é©çšãèæ
®ããŠãåç²åã®XY座æšãèšç®ããŸãã ç°¡åã«ããããã«ããã®äŸã§ã¯ã颚ããªããããç²åã®åº§æšã¯XY座æšãå€æŽããŠããªããšä»®å®ããŸãã
å
æ¥ãããã¯ã«å
¥ãããã«ãåããŒãã£ã¯ã«ã移åããŸãã ãããè¡ãã«ã¯ãXãšYã®ããŒãã£ã¯ã«ã移åããŸãããã¹ã ãŒãºã§ã¯ãªãããããã¯ã®ãµã€ãºã«çããã¹ãããã§ç§»åããŸãã
ç²åã¯ããããåç¬ã§ã¯ãªãããããã¯åäœã§ç§»åããããšãããããŸãã ããšãã°ããããã¯ã1ãã«å
¥ãç²åã¯ãXã«æ²¿ã£ãŠ2ãµã€ãºãYã«æ²¿ã£ãŠ1ãµã€ãºç§»åããŸãã
ãããã£ãŠããã¹ãŠã®ç²åã¯ãã°ãªããäžã®å€äœã«å¿ããŠãæ圱äžã®ãŸãŒã³å
ã«ãããŸãã
移åãããšããªãã¶ãŒããŒã¯ãŸãŒã³ã移åããããŒãã£ã¯ã«ã¯ããããæ°ããæ圱ã«ç§»åããŸãã
ããšãã°ããªãã¶ãŒããŒãçŸåšã®äœçœ®ããXããå³ã«ç§»åãããšããããã¯ã4ããšã2ããæžå°ããéã«ãããã¯ã3ããšã1ããå¢å ããŸãã å·ŠåŽã®ãŸãŒã³ããèœäžããç²åã¯ãå³åŽã«ãžã£ã³ãããŸãã ãã®çµæã移åãããšã芳枬è
ã¯ãŸããŸãå€ãã®æ°ããç²åãèŠãŸãããå®éã«ã¯ãããã¯ãŸãŒã³ããèœã¡ãå€ãç²åã§ãã å転ã®å Žåãšåãç¶æ³ã§ã芳å¯è
ã®äœçœ®ãå€ãã£ãŠããŸãŒã³ã ãã¯å€ãããŸããããéå°ã®å¢çãå€ããããã§ãã
å®çšçãªå®è£
ãã¹ãŠã®å ç©ç©ç²åã¯1ã€ã®DIPã§æç»ãããŸãã é ç¹ãããã¡ãŒã¯éçã«äžåºŠåæåãããå€æŽãããŸããã åããŒãã£ã¯ã«ã¯1ã€ã®é ç¹ã§è¡šããããããã¯å
ã«ã©ã³ãã ãªXYããããŸãã ãžãªã¡ããªã·ã§ãŒããŒã¯ãäžããããŒãã£ã¯ã«ãäœæããŸãã éªã®äŸã§äœãããŸããã éšã®å Žåã¯ãç圢ã®çæ¿ã§ã¯ãªããåç圢ã®ãã®ã䜿çšããå¿
èŠããããŸãã ãããŠãããã«å¿ããŠãç²åã¯æ£æ¹åœ¢ã§ã¯ãªããé·æ¹åœ¢ã§ãã
ãã¹ãŠã®ç²åã«å¯ŸããŠã°ããŒãã«ã«æ¬¡ã®ããŒã¿ãå¿
èŠã§ãã
mat4 ModelViewProjectionMatrix; -座æšãã¢ãã«ç©ºéããã«ã¡ã©ç©ºéã«å€æããã¹ã¯ãªãŒã³å¹³é¢ã«æ圱ããããã®æ圱ã¢ãã«ãã¥ãŒãããªãã¯ã¹ã
ãããŒãæé; -ç§åäœã®ã°ããŒãã«æéã
ãããŒãé床; -ç²åèœäžç;
ãããŒãããã; -ç²åãèœäžãå§ããé«ã;
ãããŒãåº; -ç²åã®èœäžãæ¢ãŸãé«ãã
float CircleTime; -ç²åãæé«ç¹ããæäœç¹ã«ç§»åããæéã
vec2颚; -颚é;
float TileSize; -ãããã¯ãµã€ãºã
vec2 Border; -ãããã¯åº§æšã ãããã¯ã®å·Šäžé
ã å³äžã¯Border + vec2ïŒTileSizeãTileSizeïŒã§ãã
float ParticleSize; -ç²åãµã€ãº;
sampler2Dãã¯ã¹ãã£ã -ç²åã®ãã¯ã¹ãã£ã
åããŒãã£ã¯ã«ã®å±æ§ïŒ
vec2äœçœ®; -äœçœ®ã ãã®å€ã¯ãããã¯å
ã§ã©ã³ãã ã«èšå®ãããŸãã Z座æšãèšå®ãããŠããªãã®ã¯ã ã·ã§ãŒããŒå
ã§èšç®ãããŸãã
float TimeShift; -0ãåºæºãšããæéã®ããŒãã£ã¯ã«å€äœãå€ã¯CircleTimeå
ã§ã©ã³ãã ã«èšå®ãããŸãã
ãã®å€ãTimeã«è¿œå ãããšãããŒãã£ã¯ã«ã®ã©ã³ãã ãªéå§äœçœ®ãååŸãããŸãã
float SpeedScale; -0.9-1.1ã®ç¯å²ã®ã©ã³ãã ãªå€ã ãã®Speedã®å€ãä¹ç®ãããšãããŒãã£ã¯ã«ããšã«ãããã«ç°ãªãé床ãåŸãããŸãã
é ç¹ã·ã§ãŒããŒïŒ
uniform mat4 ModelViewProjectionMatrix; uniform float Time; uniform float Speed; uniform float Top; uniform float Bottom; uniform float CircleTime; // (Top-Bottom)/Speed uniform vec2 Wind; uniform float TileSize; uniform vec2 Border; in vec2 Position; in float TimeShift; in float SpeedScale; out vec4 Position3D; void main(void) { float ParticleCircleTime = CircleTime / SpeedScale; float CurrentProgress = mod(Time + TimeShift, ParticleCircleTime); vec3 Pos = vec3(Position.xy + Wind*CurrentProgress , Top - Speed*SpeedScale*CurrentProgress); Pos.x = mod(Pos.x, TileSize); Pos.y = mod(Pos.y, TileSize); float c; c = floor(Border.x/TileSize); if (c*TileSize+Pos.x < Border.x) Pos.x = Pos.x + (c+1)*TileSize; else Pos.x = Pos.x + c*TileSize; c = floor(Border.y/TileSize); if (c*TileSize+Pos.y < Border.y) Pos.y = Pos.y + (c+1)*TileSize; else Pos.y = Pos.y + c*TileSize; Position3D = ModelViewProjectionMatrix * vec4(Pos,1.0); }
幟äœåŠçãªã·ã§ãŒããŒïŒ
layout(points) in; layout(triangle_strip, max_vertices=12) out; const vec3 up = vec3(0.0,1.0,0.0); const vec3 right = vec3(1.0,0.0,0.0); uniform vec2 ParticleSize; in vec4 Position3D []; out float TexCoordX; out float TexCoordY; void main(void) { vec3 u = up * vec3(ParticleSize.y); vec3 r = right * vec3(ParticleSize.x); vec3 p = Position3D[0].xyz; float w = Position3D[0].w; gl_Position = vec4 ( p - u - r, w ); TexCoordX = 0.0; TexCoordY = 1.0; EmitVertex (); gl_Position = vec4 ( p - u + r, w ); TexCoordX = 1.0; TexCoordY = 1.0; EmitVertex (); gl_Position = vec4 ( p + u + r, w ); TexCoordX = 1.0; TexCoordY = 0.0; EmitVertex (); EndPrimitive ();
ãã©ã°ã¡ã³ãã·ã§ãŒããŒïŒ
uniform sampler2D Texture; in float TexCoordX; in float TexCoordY; out vec4 color; void main(void) { color = texture(Texture, vec2(TexCoordX, TexCoordY)); }
äžããããã·ã§ãŒããŒãäœããããã詳ããèŠãŠã¿ãŸãããã
ãã¹ãŠã®åºæ¬çãªæäœã¯ãé ç¹ã·ã§ãŒããŒã§å®è¡ãããŸãã ãžãªã¡ããªã·ã§ãŒããŒã¯ãã€ã³ããããªã¥ãŒã ããŒãã£ã¯ã«ã«ã¢ã³ããã¯ããŸããããã©ã°ã¡ã³ãã·ã§ãŒããŒã¯åã«ãã¯ã¹ãã£ãé©çšããŸãã ã³ãŒããåçŽã§ããããããžãªã¡ããªã·ã§ãŒããŒãšãã©ã°ã¡ã³ãã·ã§ãŒããŒã¯èæ
®ãããŸããã
é ç¹ã·ã§ãŒããŒãèããŠã¿ãŸãããïŒ
æåã«è¡ãå¿
èŠãããã®ã¯ãããŒãã£ã¯ã«ãçŸåšã©ã®äœçœ®ã«ãããã調ã¹ãããšã§ãã ç§ãã¡ã®äœçœ®ã¯æéã«çµã³ã€ããŠãããããæéãèšç®ããå¿
èŠããããŸãã ããã¯ã2ã€ã®æäœã§è¡ãããŸãã
float ParticleCircleTime = CircleTime / SpeedScale;
float CurrentProgress = modïŒTime + TimeShiftãParticleCircleTimeïŒ;
æåã®è¡ã¯ãç¹å®ã®ç²åã®ãµã€ã¯ã«ã«åèšãµã€ã¯ã«æéãäžããŸãã ãªããªã ãµã€ã¯ã«ã¯é床ã«äŸåããSpeedScaleã§ã¯é床ãç°ãªããããå¿
èŠãªããšã¯ãåèšãµã€ã¯ã«æéãé床ä¿æ°ã§é€ç®ããããšã ãã§ãã
2è¡ç®ã§ã¯ãçŸåšã®ã°ããŒãã«ããŒãã£ã¯ã«æéãååŸãã1ãµã€ã¯ã«ã®æéã§é€ç®ããCurrentProgressã®é€ç®ã®æ®ããååŸããŸãã ããã¯ãç¹å®ã®ããŒãã£ã¯ã«ã®çŸåšã®ãµã€ã¯ã«ã®éå§ããçµéããæéã§ãã
次ã®ã¹ãããã¯ãçµéæéã«åŸã£ãŠäœçœ®ãèšç®ããããšã§ãã XYãèšç®ããã«ã¯ã颚ããåãåã£ããªãã»ãããéå§äœçœ®ã«è¿œå ããå¿
èŠããããŸãïŒZã®å ŽåïŒ-èœäžé床ã«æéãæããŸãã
vec3 Pos = vec3ïŒPosition.xy + Wind * CurrentProgressãTop-Speed * SpeedScale * CurrentProgressïŒ;
ç²åã¯é¢šã«ãããããã¯ã®å€ãé£ã¶å¯èœæ§ããããããç²åããããã¯ã«æ»ãå¿
èŠããããŸãã
Pos.x = modïŒPos.xãTileSizeïŒ;
Pos.y = modïŒPos.yãTileSizeïŒ;
ãã®çµæããããã¯å
ã®ç²åã®åº§æšãååŸããŸãã
ãã ããåç¹ã§ã¯ãªãã芳枬è
ã®åšå²ã«ããŒãã£ã¯ã«ãå¿
èŠã§ãïŒ ãã®ç¹ã«é¢ããŠãç²åãéå°ã®åšãã§èª¬æãããŸãŒã³ã«ç§»åããŸãã
c = floorïŒBorder.x / TileSizeïŒ;
ifïŒc * TileSize + Pos.x <Border.xïŒ
Pos.x = Pos.x +ïŒc + 1ïŒ* TileSize;
ä»ã«
Pos.x = Pos.x + c * TileSize;
c = floorïŒBorder.y / TileSizeïŒ;
ifïŒc * TileSize + Pos.y <Border.yïŒ
Pos.y = Pos.y +ïŒc + 1ïŒ* TileSize;
ä»ã«
Pos.y = Pos.y + c * TileSize;
æ圱ããã座æšã¯ã¹ã¯ãªãŒã³ã«æ圱ãããŸãïŒPosition3D = ModelViewProjectionMatrix * vec4ïŒPosã1.0ïŒ;
次ã«ããžãªã¡ããªã·ã§ãŒããŒãé ç¹ãããŒãã£ã¯ã«ã«ã¢ã³ããã¯ããŸãã
äžèšã®ã³ãŒãã¯ãsnowã®æãåçŽãªå®è£
ã§ãã ã°ããŒãã«ã©ã€ãã£ã³ã°ãç¹å
æºããžãªã¡ããªãšã®äº€å·®ç¹ã®è¿œå -ã¿ã¹ã¯ã¯éåžžã«ç°¡åã§ãèªåã§åŠçã§ãããšæããŸãã ãŸããç²åã ãã§ã¯ã·ã£ã¯ãŒãééªãäœãåºãã®ã«ååã§ã¯ãªãããšãå¿ããªãã§ãã ããã ç²åã¯ããŸãå€ããããŸããã ãã®ç¶æ³ã§ã¯ãé§ãå©ãã«ãªãããã®å©ããåããŠéªãéšã®èŠããäœãããŸãã
泚ïŒ
ãã®èšäºã¯æ°å¹Žåã«æªåºçã®æ¬ã®äžéšãšããŠæžãããŸããã
ããªã倧èŠæš¡ãªãããžã§ã¯ãã§äœæ¥ãå®äºããåŸãæ¯ãè¿ã£ãŠã¿ããšãé·å¹Žã®éçºã®éã«ãèå³æ·±ã話é¡ã«ãªãå¯èœæ§ã®ããã¿ã¹ã¯ãããããšãããããŸããã ãã®çµæãæ¬ãç»å ŽããŸããã ãã®æ¬ã¯2012幎ã«å·çããã³ç·šéãããŸããããã©ãã«ãåºçãããŠããŸããã 察象èªè
ã¯æ確ã§ã¯ãããŸããã§ããã
ä»æ¥ãç§ã¯ãã®æ¬ã®ããã¹ãã«åºäŒããããããããããããã€ãã®ç« ãHabrã³ãã¥ããã£ã«ãšã£ãŠèå³ããããšæããŸããã
ãã¹ããšããŠã倩æ°å¹æã®å®è£
ã«é¢ããç« ãå
¬éããŸãã ã³ãã¥ããã£ããã®èšäºãæè¿ããŠããå Žåã¯ãããšæ°ç« ãå
¬éããŸãã