11æåæ¬ã«ãç§ã¯115åã®ç¬ç«ã²ãŒã éçºè
ã³ã³ãã¹ãïŒIGDCïŒã³ãã¥ããã£ã³ã³ãã¹ãã«åå ããŸããããã®ã³ã³ãã¹ãã§ã¯ãé±115ãããã€ãã®ã¢ãŒã±ãŒãã·ã¥ãŒãã£ã³ã°ã²ãŒã ã®éçºã«çŠç¹ãåœãŠãŸããã ã«ããã®äžã§ã¯ãOpenGL + Free Pascalã§ã²ãŒã ãéçºããã¹ããŒãªãŒãLZOãè©ŠããuFMODã®
FPCã³ã³ãã€ã©ãŒã®ãã°ããã€ãã¹ããããã¯ã¹ãã£ãŒã®æãç°¡åãªçæãNVidiaã°ã©ãã£ãã¯ã«ãŒãã®è¿·æãªãã°ããã¹ãŠãå°ç¡ãã«ããŸããã
ãããªãWindowsçšãã€ããªãããã³ãœãŒã¹ã³ãŒããå«ãŸããŠããŸã-èšäºã®æåŸãã芧ãã ããã
åæ
çãªçŽ¹ä»
ã²ãŒã éçºã¯ç§ã®äž»ãªãæ°ã«å
¥ãã§ãããéåžžã«å€ã趣å³ã§ãã ç§ã¯ã¢ããã¥ã¢ã®ã²ãŒã éçºäŒç€Ÿã§ã¹ãã³ãç¶ããŠãããçŽ10幎éã倧ããªæåãç¥å床ã®é«ããªãªãŒã¹ãå·šé¡ã®é·æçãªå»ºèšã¯ãããŸããã§ããã é ã«æµ®ãã¶å€ãã®åçµãããžã§ã¯ãããããŸã-ãŠãããã ããæç¹ã§ãç§ããã¯äœãåŸãããªãããšã«çµ¶æããŸããã ãããŠãæçµçµæã ãã§ãªããã²ãŒã éçºããã»ã¹èªäœãæ°ã«å
¥ã£ãŠããããšã«æ°ä»ããŸããã ãã®ç¬éãããç掻ã¯èœã¡çããŸãããããã€ãèªåãå§åããããçš®ã®ãããžã§ã¯ããåæ¥ã¬ãã«ã«åŒãäžãããšããèããææŸããŸããã
ããæç¹ã§ãç¹å®ã®ãããã¯ã«é¢ããã²ãŒã ãéçºããããã®çãïŒæ°æ¥ãã3é±éïŒã³ã³ãã¹ããäž»å¬ãã
IGDCã³ãã¥ããã£
ã«åºäŒããŸããã æž©ãã¿ã®ããã©ã³ãã³ã³ãã¹ãã¯ãè³ã§ã¯ãªãåå ãäž»ãªãã®ã§ãã ããŒã±ãã£ã³ã°ãåçåã§ã¯ãªããåŸãããçµéšãšä»äºã®åã³ã
æè¿ã§ã¯ãgamedevã«å
¥ãããã®ãããå€ã倧å¹
ã«äœäžããççŽã«å€±æããã²ãŒã ã®ã¹ããªãŒã ãã¢ãã€ã«ãã©ãããã©ãŒã ã«æ®ºå°ããŠããŸãããã®èè
ã¯ããããé³¥ã®ããã«å¥ã®å¿«é©ãªç掻ãéãããšã倢èŠãŠããŸã...
ãã¡ããã匷åãª
Ludum DareããããŸããããããŸã§ã®ãšãã圌ã®ããŒãã³ã¢ãªèšèã¯ç§ã®å®¶æç掻ã«åããŠããŸãã
éå§ãã
ãããã£ãŠã2014幎11æ7æ¥ã«ã次ã®ã³ã³ãã¹ããã³ãã¥ããã£ã®Webãµã€ãã§çºè¡šãããŸãã æ¡ä»¶ïŒ
- ãPyshch-pyshchkããšæµ-ãããã¯ã³ã³ãã¹ãã®ãªãŒããŒãã¢ãŒã±ãŒãã·ã¥ãŒãã£ã³ã°ã²ãŒã ã説æããèšèã§ã
- ãµã€ãº-競åã¯é£ç¶115äœã§ãããããå³å¯ã«æ倧115ãããã€ã
- æé-é±
ãããã®æ¡ä»¶ã«ã¯æ°žç¶çãªåææ¡ä»¶ãè¿œå ãããŠããŸãããªãã©ã€ã³ã§åäœãããµãŒãããŒãã£ã®ããã±ãŒãžãåé
åžå¯èœããã±ãŒãžãã€ã³ã¹ããŒã«ããå¿
èŠã¯ãããŸããã ã²ãŒã ãå®è¡ããããã«å¿
èŠã§ãã·ã¹ãã ã«ä»å±ããŠããªããã®ã¯ãã¹ãŠããªãªãŒã¹ãšãšãã«æäŸãããåã115ãããã€ãã«åãŸãå¿
èŠããããŸãã
å¶éã¯ãçã®ãã¢ã·ãŒã³ïŒ4kã32k ...ïŒã«ã¯ããŸã倧ãããããŸããããé©åã«ãå€æ
ãããã«ã¯ååã§ãã éçºããŒã«ããã°ããåæãããšããããã®èŠä»¶ã«é©åãããã®ã®ããªãå°è±¡çãªãªã¹ããåŸãããŸãã
- ãã©ãã·ã¥
- html5 + js
- CãC ++ãCïŒ
- DelphiãFreePascal
- ...
ãªãŒããŒããŒãã¯ãUnityãCry EngineãUnreal EngineãJVMããŒã¹ã®èšèªïŒããªã€ã³ã¹ããŒã«ãããjreãå¿
èŠïŒãããã³ã»ãšãã©ã®ã²ãŒã ãã¶ã€ããŒã§ãã
ãã©ãã·ã¥ã«ã€ããŠFlashã«ã¯ã€ã³ã¹ããŒã«ãããAdobe Flash Playerãå¿
èŠã§ãããšããäºå®ã«ãããããããäŸå€ãšããŠã®äœ¿çšã¯åŒãç¶ãèš±å¯ãããŠããŸãïŒAdobe Flash PlayerãäŸç¶ãšããŠå€§åãå ããŠãããšèããããŠããŸãïŒã ããã¯æŽå²çã«èµ·ãããŸããã
ç§ã®ç掻ã®äžã§ãç§ã¯å€ãã®èšèªãšæè¡ãè©Šãããšãã§ããŸããããããŠãäžèšã®ãªã¹ãã®ã»ãšãã©ã¯çŽæ¥ç§ã«ããç¥ãããŠããŸãã ããããè¬èãªäœ¿çšäººã¯ãæãç°¡åãªãªãã·ã§ã³ã§ããFree PascalãéžæããŸããã§ããã ãªãæãç°¡åã§ã¯ãªãã®ã§ããïŒ
ãŸãã2014幎ã«ã¯ãDelphiã®ãããªFree Pascalã¯æµè¡é
ããšèŠãªãããŠããŸãããã®çµæãFPCã³ã³ãã€ã©ã«ã¯ããªãŒãã³ãœãŒã¹ãšã¯ãã¹ãã©ãããã©ãŒã ã«ããããããããŠãŒã¶ãŒãå°ãªããå€ãã®ãã°ããããŸãã 第äºã«ãLazarus IDE + FPCãã³ãã«çšã«ã³ã³ãã€ã«ãããexeã®ãµã€ãºã¯
ãwikiã®å¥ã®ããŒãžã®æ©äŒã§ãã 第äžã«ãä»ã®å€ãã®èšèªãæè¡ã絶ãã䜿çšããŠããå Žåãããã¯éåžžã«å°ãªãæ§æç³è¡£ã§ãã
ãã¡ããããã©ã¹ããããŸãïŒ
- æ£ããæºåãããexeã¯èªçµŠèªè¶³ã§ãããéçCRTãªã³ã¯ãæã€C / C ++ã®exeãšæ¯èŒã§ããŸã
- ããã©ã«ãèšå®ã§ã¯ãC / C ++ã®ããã«èªåã§è¶³ãæã€ããšã¯ã§ããŸãã
- é©åãªèšå®ã§ãäž¡æ¹ã®èãæã¡èœãšããŸã
- ããªãå¶ç¶ã« ãç§ã¯ãã§ã«Free Pascal + OpenGLã®ãããã¬ãŒã ã¯ãŒã¯ãæã£ãŠããŸã
ãããŠãç§ã¯ãã§ã«æçéžè¹ã®ç¡æãªã¡ã€ã¯ãããŸãã è¡ããïŒ
ãŸããå°æ¥ã®ã²ãŒã ã®ã³ã³ã»ããã決å®ããŸãã-ãã¬ã€ã€ãŒããã¿ã³ã¯ããå¶åŸ¡ããããããæ¹æ³ã§æµã®çŸ€è¡ãæã€ããããã¥ãŒãæã€ã¢ãŒã±ãŒã2Dã·ã¥ãŒãã£ã³ã°ã²ãŒã ãããããã«æ¥œããæµã®ã·ã¥ãŒãã£ã³ã°ã®ããã®ããŒãã¹ããããŸãã ãã¯ããªã¢ã¯ãæ»ãããªããå身ãææŸããŸã§ç¶ããŸãã æãè¿ãã¢ããã°ã¯
Crimsonlandã§ãã
ãã³ãã¬ãŒããéåžžã®åãã§ã³ã³ãã€ã«ããŠãæåã®åé¡ãèªåã§äœæããŸãã-ã³ã³ãã€ã©ãŒã®ãã¹ãŠã®ããªãããŒãªãªãã·ã§ã³ãèæ
®ããŠããã¬ãŒã ã¯ãŒã¯ã§ã³ã³ãã€ã«ãããexeã¯120ãããã€ãããããŸããã ãã¡ããããã¬ãŒã ã¯ãŒã¯ãã§ãããšããäºå®ãèãããšïŒããã¯ãŸã FPCã§ããããšã念é ã«çœ®ããŠïŒ-ããã¯ææã§ãããããŸãã ããããããã¯ç§ãã¡ã«ã¯ãŸã£ããåããªãã®ã§ã
UPXã䜿çšããŠç¡æ
æ²ã«exeãã«ããããŸãã-48ãããã€ãã ãã§ã«ããã§äœæ¥ã§ããŸãã
ãã¡ãããããã§ãã¬ãŒã ã¯ãŒã¯ã®æ©èœãæãå¿
èŠãªãã®ã«ã«ããããã°ãæ°ãããã€ããåã€ããšãã§ããŸãã æéããªãããããããæåŠããŸãããåŸã§å€æããŸããããç¡é§ã§ã¯ãããŸããã ãã®çµæã115ãããã€ããšããå¶éã§ååè¶
éããŸããã
LZOã玹ä»ããŸã
ãŸããªã²ãŒã ã¯ãããã¹ããŸãã¯æ°å€æ
å ±ã衚瀺ããã«å®è¡ã§ããŸãã æåã¯ç§ã®èãã§ã¯ããã®ãããªã²ãŒã ãäœæããããšã§ããããèå³æ·±ãå®è£
ãèãåºãããšã¯ããŸããããŸããã§ããã
ãããã£ãŠãã¿ã¹ã¯ã¯OpenGLã䜿çšããŠç»é¢ã«ããã¹ãã衚瀺ããããšã§ãã ãã¯ã¿ãŒããã¹ãã衚瀺ããå€é¢šãªæ¹æ³ã«é Œããã«ããããããããã©ã³ãã䜿çšããå¿
èŠããããŸãã ç§ã®ãã¬ãŒã ã¯ãŒã¯ã¯ãäºåã«çæãããæ
éã«ãçŒãä»ããããããããããããã©ã³ãã䜿çšããããã¹ãåºåãæ¢ã«ãµããŒãããŠããŸããã åé¡ã¯è§£æ±ºããŸãããïŒ
ç°¡åã«å®è£
ã«ã€ããŠç¬èªã®èªè»¢è»ãŠãŒãã£ãªãã£ããããå¿
èŠãªãã£ã©ã¯ã¿ãŒãæ¯èŒçã³ã³ãã¯ãã«ããã¯ãããããbmpãã¡ã€ã«ã«ãçŒãä»ãããŸããæåŸã«ããã£ã©ã¯ã¿ãŒã®ã¡ããªãã¯ïŒåº§æšããµã€ãºãå
ã®ãµã€ãºãªã©ïŒã«é¢ãããµãŒãã¹æ
å ±ã容赊ãªãè¿œå ãããŸãã ã°ã©ãã£ãã¯ãšãã£ã¿ã¯ãã£ãããèªèããããã¡ã€ã«ãéåžžã«æ£ããéããŸãã ããã§ãããããã®åããšãã£ã¿ãŒã«ãä¿åæã«ãã¡ã€ã«å
šäœãäžæžãããªãããã«æãããšããã®ãããªãã©ã³ãã«ãã¹ããšãã§ã¯ãã課ãããšãå¯èœã«ãªããŸã...
ããããã¿ã¹ã¯ã¯è€éã«ãªã£ãŠããŸãã ãã®ããã«ããŠãã·ã¢èªãšã©ãã³æåïŒããã³ç¹æ®æåãšæ°åïŒã§ååŸãããã¡ã€ã«ã¯ã135ãããã€ããå ããŠããŸããã ãã·ã¢èªã®æåãåé€ãããã©ã³ãèªäœã®ç©çãµã€ãºãçž®å°ããŸããç»åã¯ããããã®ãµã€ãºã§ååã«ãªããããã«å¿ããŠãµã€ãºãååã«ãªããŸã-67ãããã€ãã ããããã空ã®ããããžã§ã¯ãã§ã¯åèšã§115ãããã€ãã«ãªããããããã¯ãŸã è¯ããããŸããã
ãã³ããŒïŒããŒã¹ããã³ãŒãã¯åçŽãªã®ã§ãæãæ£ç¢ºã§ã·ã³ãã«ãªæé ã¯ãèµ·åæã«ã·ã¹ãã ãã©ã³ããããã©ã³ããååŸããŠçæããããšã§ãã ããã«ã以åã®ãã¬ãŒã ã¯ãŒã¯ã§ã¯ãããããã©ã³ãã®çææ¹æ³ã§ãã-ã·ã¹ãã ãã©ã³ããŸãã¯otf / ttfãã¡ã€ã«ããã®ãã©ã³ã¿ã€ã ãã§ã
ããããéã¯ããã³ã¹ããããŠ5çªç®ã®ãã€ã³ã-èŠçãæãã§ããŸããã ãããŠãç§ã¯2010幎ã«åå¿
XProgerãMiniLZOã©ã€ãã©ãªã«å¯ŸããŠ
æŽåè¡çºãè¡ãããã®ãã³ããã€ã³ã¯ããç°¡åãªasmåœä»€ã§ã©ããã³ã°ããããšãæãåºããŸããã æœåºã®å Žåã次ã®ããã«ãªããŸãã
function lzo_decompress(const CData; CSize: LongInt; var Data; var Size: LongInt): LongInt; cdecl; asm DB $51 DD $458B5653,$C558B08,$F08BD003,$33FC5589,$144D8BD2,$68A1189,$3C10558B,$331C7611,$83C88AC9 DD $8346EFC1,$820F04F9,$1C9,$8846068A,$75494202,$3366EBF7,$460E8AC9,$F10F983,$8D83,$75C98500,$8107EB18 DD $FFC1,$3E804600,$33F47400,$83068AC0,$C8030FC0,$83068B46,$28904C6,$4904C283,$F9832F74,$8B217204,$83028906 DD $C68304C2,$4E98304,$7304F983,$76C985EE,$46068A14,$49420288,$9EBF775,$8846068A,$75494202,$8AC933F7 DD $F983460E,$C12B7310,$828D02E9,$FFFFF7FF,$C933C12B,$C1460E8A,$C12B02E1,$8840088A,$88A420A,$420A8840 DD $288008A,$113E942,$F9830000,$8B207240,$FF428DD9,$8302EBC1,$C32B07E3,$1E8ADB33,$3E3C146,$2B05E9C1 DD $D9E949C3,$83000000,$2F7220F9,$851FE183,$EB1875C9,$FFC18107,$46000000,$74003E80,$8AC033F4,$1FC08306 DD $F46C803,$FBC11EB7,$FF428D02,$C683C32B,$8369EB02,$457210F9,$D98BC28B,$C108E383,$C32B0BE3,$8507E183 DD $EB1875C9,$FFC18107,$46000000,$74003E80,$8ADB33F4,$7C3831E,$F46CB03,$FBC11EB7,$83C32B02,$D03B02C6 DD $9A840F,$2D0000,$EB000040,$2E9C11F,$2BFF428D,$8AC933C1,$E1C1460E,$8AC12B02,$A884008,$88008A42 DD $51EB4202,$7206F983,$2BDA8B37,$4FB83D8,$188B2E7C,$8904C083,$4C2831A,$8B02E983,$831A8918,$C08304C2 DD $4E98304,$7304F983,$76C985EE,$40188A20,$49421A88,$15EBF775,$8840188A,$188A421A,$421A8840,$8840188A DD $7549421A,$8AC933F7,$E183FE4E,$FC98503,$FFFE4284,$46068AFF,$49420288,$C933F775,$E9460E8A,$FFFFFECA DD $8B10552B,$10891445,$75FC753B,$EBC03304,$FFF8B80D,$753BFFFF,$830372FC,$5B5E04C0,$90C35D59 end;
...ããã³å§çž®èªäœã®ããã®åæ§ã®éè¡ã ããã¯æ£åžžã«æ©èœããŸããïŒããã«å
¥æããããšã¯ã§ããŸããã§ãããïŒãå®åã³ãŒãã«ã¯ãå§ãããŸããã ãããã°ãããšãã¯å°ãäžäŸ¿ã§ã...
ãã©ã³ããå§çž®ãããšã67ã§ã¯ãªã17ãããã€ãã«ãªããŸãã
ãŸããçæããã®å Žã§å®è£
ããå Žåã¯ã2ã3ãããã€ãã§ããã ã
uFMODã䜿çšããŠé³å£°ãåºåãã
é³ããå°ãªããšãé³æ¥œãªãã§ã²ãŒã ããã¬ã€ããã人ã¯ããŸããã ãã®ã³ã³ãã¹ãã®åã«ãç§ã¯äœé³ã©ã€ãã©ãªã䜿ã£ãçµéšããããŸãããããããè¹å€ã«æ®ããªããã°ãªããŸããã§ãããå¿
èŠãªdllã¯97ãããã€ããæ¶è²»ããŠããŸããã ã³ã³ãã¹ãã®ã¬ããŒããããã¯ã§ãã¢ã»ã³ãã©ãŒã§èšè¿°ãããxmé³æ¥œãåºåããããã®ãããã¥ã¢ã©ã€ãã©ãªã§ãã
uFMODã«ã€ããŠèšåããŸããã ä»åŸããããžã§ã¯ãã§ã®ãã®å®è£
ã¯ãexeãã¡ã€ã«ã®ãµã€ãºã«å®è³ªçã«åœ±é¿ãäžããªããšèšããŸãã
ãããã1ã€ã®å°ããªãã¥ã¢ã³ã¹ããããŸããã FPCã³ã³ãã€ã©ã®ææ°ããŒãžã§ã³ïŒ2.2.x以äžïŒã§ã¯ããã®ã©ã€ãã©ãªã¯æ©èœããŸããã§ããã ãããŠåé¡ã¯
ããªã³ã«ã®
ãããŸããªåäœã«ãããŸãã ãã®åé¡ã®æè¡çãªåŽé¢ãå¯èœãªéãæ£ç¢ºã«èª¬æã§ãããã©ãããã€ãŸããããããŒãã¡ã€ã«ã§å®£èšãããå€éšé¢æ°ããããã«æ¥ç¶ãããŠãããªããžã§ã¯ããã¡ã€ã«ã«è¡šç€ºãããªãçç±ã説æã§ããŸããã ãã®åäœã¯ãã³ã³ãã€ã©éçºè
ã«æ®ã£ãŠããŸãã é¢æ°ã®1ã€ã«å¯Ÿãããã®åäœã®ãåé¿çãã®äŸã瀺ããŸãã
次ã®ãããªãã®ã§ããã
function waveOutClose(hwo:Pointer):LongWord; stdcall; external 'winmm.dll';
ãããŠããã®ããã«ã©ããããªããã°ãªããŸããã§ããïŒ
function my_waveOutClose(hwo:Pointer):LongWord; stdcall; external 'winmm.dll' name 'waveOutClose'; function _waveOutClose(hwo:Pointer):LongWord; stdcall; public name 'waveOutClose'; begin Result := my_waveOutClose(hwo); end;
ãããŠãã©ã€ãã©ãªãå¿
èŠãšããæ°åã®é¢æ°ã«å¯ŸããŠã uFMODã®å®è£
ã¯ãæã軜éã§äœ¿ãããããã®ãšããŠwinmmã䜿çšããããšãæ確ã«ããŸãã ã·ã³ãã«ãã®ãã€ãã¹ãã-äžåºŠã«1ã€ã®ã¹ããªãŒã ããåçã§ããŸããã§ããã ãããã£ãŠãé³æ¥œã¯ç§ã®ã²ãŒã ã«ç»å ŽããŸããããé³ãæŸæ£ããªããã°ãªããŸããã§ããã
å®éã«ã¯ãxm-trackèªäœã
ããã«åã蟌ãŸ
ã ããã®åŸuFMODã®ãŠãŒãã£ãªãã£ãããã
ãŸãã«ãã®ãã㪠pasãã¡ã€ã«ã«å€ããŠãããŸããã
ãã¯ã¹ãã£çæ
ã¯ã©ã·ãã¯ãèšãæãããšããã¯ã¹ãã£çæãªãã§ã©ã®ãã¢ã·ãŒã³ãããžã§ã¯ããå®è¡ãããŸããïŒ æåã¯ããã®ãããã¯ãçç¥ãããã£ãã®ã§ããããã¯éåžžã«åçŽã§ããé¡ã«å
¥ããŠãåäžã®ïŒïŒïŒãã¯ã¹ãã£ãçæããŸããã ããããããããæ°åè
ã®äžã«ã¯ãã®ã¢ãããŒãã圹ç«ã€ãšæã人ãããã§ãããã
ã²ãŒã å
ã®ã»ãŒãã¹ãŠã®ã¹ãã©ã€ãã¯åããã¯ã¹ãã£ã䜿çšããŸãã
審çŸæ§ãé«ããããã«ããããŒããŒããä»ããçžæš¡æ§ã®ãã¯ã¹ãã£ã§ãã è²åãïŒã€ãŸãããã®ãããªãã¯ã¹ãã£ã§ç®çã®è²ããä¹ç®ãããïŒãäžãããããšãä»»æã®è²ã®ã¹ãã©ã€ããã¯ã¹ãã£ãåŸãããŸãã
ç§ã¯çµ¶å¯Ÿã«çæã³ãŒãã奜ãã§ã¯ãããŸãããæããã«ããæé©ã«èšè¿°ã§ããŸãã ããã«ãå¢çç·ã誀ã£ãŠæç»ãããŠãããšããæ°žç¶çãªæèŠããããŸãã
function TGame.GenerateTexture(aWidth, aHeight, aBorderSize: Integer): TglrTexture; var m, m_origin: PByte; i, j: Integer; value: Byte; begin m := GetMemory(aWidth * aHeight * 3); m_origin := m; for j := 0 to aHeight - 1 do for i := 0 to aWidth - 1 do begin if (i < aBorderSize) or (j < aBorderSize) or (i > aWidth - aBorderSize - 1) or (j > aHeight - aBorderSize - 1) then value := 196 else if ((i + j) mod 16) >= 8 then value := 255 else value := 196; m^ := value; m+=1; m^ := value; m+=1; m^ := value; m+=1; end; Result := TglrTexture.Create(m_origin, aWidth, aHeight, tfRGB8); end;
å€æŽã®å Žåãæµã®èµ€ã®è²åãã¯ã©ã³ãã ïŒïŒã§ãããã«ç°ãªããŸãã
NVidiaã®è¿·æãªãã°
ã³ã³ãã¹ãã«äœåãæåºããåŸããã¹ãã¯æåºãããäœåããã¢ãŒã«ã€ããåéããå
¬éå±ç€ºããŸãã åå è
ã®ã¿ã¹ã¯ã¯ãèªå以å€ã®äºãã®å ŽæãæŽçããããšã§ãã è©äŸ¡ã®ããã«3æ¥éãäžããããã®ã§ãç·æ¥äœæ¥ã®åŸã¯ãªã©ãã¯ã¹ã§ããŸãã ããããããã«ãããŸããïŒ
ãããã次ã
ãšåºå Žè
ã¯ç§ã®ã²ãŒã ã圌ãã®ããã«æ£ããåäœããªãããšãéäŒããŸã-ãã¬ã€ã€ãŒã®ãã¿ã³ã¯ãã¯ååçã«èŠãããå€ãã®æµæŠè»ã¯èŠããŸãããæã
ç¹æ»
ããŸãã æµã¯ææ°ç®¡ããã®ç
ã«ãã£ãŠã®ã¿èå¥ã§ããŸãã ãã®ãããªåé¡ã¯ãNvidiaãããªã«ãŒãã®ãã¹ãŠã®åºå Žè
ã«çŸããŸãã ããã«ãåå è
ã®1人ã¯ç§ã®æ§æãšåãã§ãããç§ã®ãã°ã¯ãŸã£ããçŸããŸããã 誰ããWindows 95ïŒïŒïŒãšã®äºæã¢ãŒãã§ã®èµ·åãå©ããŸããããã»ãã®å°ããããããŸããã§ããã
ããŸããŸãªãã«ãïŒæ¢ã«ç«¶åã®ã«ãŒã«ã«å°ãåããŠããïŒãã¬ã€ã¢ãŠãããã³ãŒãå
ã®ãã¹ãŠã®çãããå Žæãã¯ãªãŒã³ã¢ããããããŸããŸãªèšå®ãã¢ããã€ã¹ããŸãããããã¹ãŠãç¡é§ã§ããã æåŸã«ãåå è
ã®1人ãæã现å¿ã®æ³šæãæã£ãŠããã圌ã«æè¬ïŒhelloãpelmenkaïŒïŒãçç±ãçºèŠããŸãã-Nvidiaã³ã³ãããŒã«ããã«ã§ã¹ã¬ããæé©åããªãã«ãããšãã²ãŒã ã¯æ£åžžã«åäœããŸãã è¿·æãªã®ã¯ãããã€ãã®ã²ãŒã ã§BSODã®åå ãšãªã£ã倪å€ã®æãããç§ã®èšå®ããªãã«ãªã£ãŠããããšã§ãã
ãã®è²Žéãªæ
å ±ã®ãããã§ãç§ã¯èªå®
ã§ãã°ãåçŸããŠä¿®æ£ããããšãã§ããŸããããã»ãšãã©ã®ç«¶æè
ããã§ã«æ祚ããŠããããšã¯ãã§ã«ããã£ãŠããŸããããäžè¬çã«ãç§ã¯Nvidiaã³ã³ãããŒã«ããã«ã®æšæºèšå®ã§ã²ãŒã ããã§ãã¯ããªãã£ãèªåã«ãšã£ãŠéªæªãªããããªã§ããã
é·ãéãåé¡ã®è§£æ±ºçãèŠã€ããããã»ã¹ã説æããŸããã ç§ã¯ãæ€çŽ¢ããã»ã¹ã§æ¬¡ã®ããšã«æ°ã¥ããã ãã§ãïŒ
- ã¹ããªãŒãã³ã°ã®æé©åã¯ãã¡ãªãããããå€ãã®åé¡ããããããŸãã ãnvidia threading Optimizationããç°¡åã«æ€çŽ¢ãããšãã²ãŒã ãã©ãŒã©ã ãžã®ãªã³ã¯ã衚瀺ãããŸããã²ãŒã ã®ãç¹æ»
ããé¿ããããã«ããã®èšå®ãç¡å¹ã«ããããšã匷ããå§ãããŸãã
- ãã®æé©åããã©ã€ããŒã¬ãã«ã§è¡ãããšã説æããä»æ§ã¯ãããŸããïŒãŸãã¯ãããŸããïŒïŒ
- ã¹ããªãŒãã³ã°æé©åããªã³ã«ãªã£ãŠãããã°ã«ã€ããŠäžæºãèšã£ãŠããã€ã³ãã£ãŒéçºè
ããã®å€ãã®ãããã¯ã ããã ãªãã«ããã仲éã以å€ã®çãã¯ãããŸãã
æåŸã«ããååãä»ããããªããããŒã¹ããªã³ã«ãªã£ãŠãããšãã«glBufferSubDataé¢æ°ã®èª€ã£ãæäœã«ã€ããŠäžå¹³ãèšããããã¯ã«æ³šç®ããŸããã ããã¯ç§ã«æããããäžãããã°ããããŠããïŒãããã°ããã§ãã¯ïŒãåé¡ã®æ¬è³ªãç¹å®ããŸããã
glBufferSubDataé¢æ°ã¯ãé ç¹ãããã¡ãŒã®ããŒã¿ãæŽæ°ããŸãã ãã®é¢æ°ã®äž»ãªç®çã¯ããããã¡ã®ãããŒã¹ããæŽæ°ããããšã§ãããã¡ã¢ãªãå²ãåœãŠãã«ãããã¡å
šäœãæŽæ°ããå¿
èŠãããå Žåã«ã䜿çšããå¿
èŠããããŸãïŒç§ã®å ŽåïŒã
ã¹ããªãŒãã³ã°ã®æé©åããªã³ã«ãªã£ãŠããå ŽåãNVidiaãã©ã€ããŒã¯ïŒåžžã«ïŒïŒã¬ã€ãä»ãå±æ§ã®1ã€ã«åºã¥ããŠããã®é¢æ°ãžã®åŒã³åºããå¥ã®ã¹ããªãŒã ã«å
¥ããããã«å¶åŸ¡ãè¿ããåããããçµæããããããŸãã ãããã¡ã«æç»ãããåã«ãããã¡ã«ããã©ããã£ã³ã°ãããæéãããããŒã¿ã¯äžæã§ãã ãŸããNvidiaã®OpenGLãã©ã€ããŒã¯ããããåé¡ãšèŠãªããŠããŸããã ããªãã®è³ªåã«å
ç«ã¡ãç§ã¯çããŸãïŒãããã転éãããããŒã¿ã®ãµã€ãºã¯ãããããã§ãæ°ãããã€ãïŒç¹ã«ãã¹åž¯åå¹
ãšæ¯èŒããŠïŒãªã®ã§ãåé¡ã¯å€ªãããŒã¿ãšã¯ã»ã©é ãã§ãã
OpenGLä»æ§ã§ã¯ããã®é¢æ°ãå¥ã®ã¹ã¬ããã§å®è¡ã§ãããšã¯èšãããŠããŸããã Nvidiaã®ã¡ã³ããŒããã®å人çãªã€ãã·ã¢ããã§ããïŒ
ãã¬ãŒã ããšã«glBufferSubDataã1å䜿çšããå Žåããã©ã€ããŒã¯ãã®ãããã¡ãŒã«å¯Ÿãããã¹ãŠã®æäœã®å®äºãåŸ
æ©ããåŸïŒããããïŒãã®ãããã¡ãŒã®æç»ãããã£ãã·ã¥ãããŠåŒã³åºããŸãã
ãããŠãç§ã®å Žåã1ã€ã®ãããã¡ãŒããã¬ãŒã ããšã«æ°å䜿çšãããŸãã ããã¯ïŒ
glBindBuffer(GL_ARRAY_BUFFER, BufferId); glBufferSubData(GL_ARRAY_BUFFER, 0, Size, Data); glDrawElements(...); glBindBuffer(GL_ARRAY_BUFFER, 0); ... glBindBuffer(GL_ARRAY_BUFFER, BufferId); glBufferSubData(GL_ARRAY_BUFFER, 0, OtherSize, OtherData); glDrawElements(...); glBindBuffer(GL_ARRAY_BUFFER, 0);
ãããŠãããã§ããªãã¯ãã¹ãŠã®æ å
ã®äžã§ã¹ããªãŒã ã®æé©åãæããã§ãããã æçµçã«ç»é¢ã«è¡šç€ºããããã®ã«ãã£ãŠããã©ã€ã³ãã±ãŒã¹ã決ãŸããŸãã
ããã¯ãŸããŸãã®è§£æ±ºçã§ãããglFinishïŒïŒåŒã³åºãã圹ç«ã¡ãŸãã å人çã«ã¯ããã®ãããªåŸ®åŠãªç¶æ³ãé¿ããããã«ããããã¡ãŒå
ã®ããŒã¿ãæŽæ°ããããã®ããžãã¯ãå°ãå€æŽããŸããã
QïŒããŒã¿ãçµã¿åãããŠäžåºŠã«æç»ããªãã®ã¯ãªãã§ããïŒ
AïŒãããã®åŒã³åºãã®éã«ä»ã®èŠçŽ ã®ã¬ã³ããªã³ã°ããããæç»é åºãå€æŽããããšã¯ã§ããŸããã
QïŒç°ãªããããã¡ãŒã䜿çšããªãã®ã¯ãªãã§ããïŒ
AïŒãããã¡å
ã®ããŒã¿ã¯ãã¬ãŒã ããšã«æŽæ°ããããããããã€ãã®ãããã¡ãä¿æããã®ã¯ãªãœãŒã¹ã®ç¡é§ã§ã
ãŸãšã
ãã®çµæã2äœãŸãã¯3äœãäºãããšã¯ã§ãããããããŸããããç§ã¯4äœã«ãªããŸããã ã€ã©ã€ã©ã¯ãç§ããªãŒããŒã®ãããã€ã«ããéããŠé£ãã ãšããäºå®ã«ãã£ãŠã§ã¯ãªããè¯ãã²ãŒã ãš7æ¥éã®ããããããä»äºããå°ç¡ãã«ããããšããèªèã«ãã£ãŠçããŸããã
çããããªã²ãŒã ãã¬ã€ïŒ
åèšãªãªãŒã¹ãµã€ãºã¯çŽ80ãããã€ãã§ããã 圌ããå«ãŸããŸãïŒ
- 62.0 kb-exe
- 17.3 KB-ãã©ã³ã
- 0.52 kb-ã·ã§ãŒããŒ
-
ãªãªãŒã¹ãããŠã³ããŒãããŸãïŒå¿
èŠãªãã¹ãŠã®ãœãŒã¹ãæ·»ä»ãããŠããŸãïŒã
-githubã®ãœãŒã¹