锘??xml version="1.0" encoding="utf-8" standalone="yes"?> 銆銆浠涔堝彨鍋歍eamwork錛屾垜鏄畬瀹屽叏鍏ㄧ殑浣撲細鍒頒簡銆傜┖鏈塒rogrammer鐨勬兂娉曪紝娌℃湁鏉ヨ嚜緹庡伐綺懼績闆曠悽鐨勫疄楠屾ā鍨嬫槸緇濆涓嶈鐨勩?br /> Continuing our series of occasional interviews with game developers about current and upcoming hardware and game graphics engines, we chat with Marko Kylmamaa, senior graphics programmer for Digital Illusion' Canadian studio. 銆銆鏈湡鐨勯噰璁垮璞℃槸鏉ヨ嚜DICE鐨勯珮綰у浘鍍忕▼搴忓憳Marko Kylmamaa鍏堢敓銆?/p>
聽聽聽 FiringSquad: First, Intel and AMD are pushing dual core processors and within the next year four core processors are due to be released. How will DICE support this kind of tech in the Battlefield 2/2142 engine and will there be any need for special programming to fully support multi core CPUs in PCs? 銆銆鎻愰棶錛氱洰鍓岻ntel涓嶢MD鍔涙帹鍙屾牳CPU錛岀洰鍓嶆槑騫撮兘鍑嗗鎺ㄥ嚭錛旀牳蹇冪殑CPU銆侱ICE鍑嗗濡備綍鍦˙F2寮曟搸涓姞鍏ュ榪欑鎶鏈殑鏀寔錛屽鏋滆繖鏍峰仛闇瑕佷粈涔堢壒孌婄殑緙栫▼鎶鏈箞錛?/p>
聽聽聽 Marko Kylmamaa: While a program geared towards a single-core machine may run fine, with some exceptions, and perhaps even somewhat faster on a multi-core machine, in order to realize the real performance benefits a careful attention has to be paid into structuring the code for the correct granularity in mind, to make it suitable for multi-core execution. With the introduction of the next generation consoles and the PC hardware, the whole industry is in a learning phase for understanding the differences between the traditional multi-threading approaches, and multi-threading for multiple cores. DICE is working closely with hardware vendors in making sure that all of the future titles make the maximum use of the available multi-core architecture. 銆銆鍥炵瓟錛氭湰鏉ュ崟鏍稿績鐨勬満鍣ㄥ氨鍙互榪愯寰楀緢濂斤紝鏈変簺鏃跺欑敋鑷寵蹇簬澶氭牳鏈哄櫒銆傚叾瀹為棶棰樹富瑕佹槸鍦ㄥ鏍稿績鐨勫鐞嗘瘮鍗曟牳蹇冨鏉傦紙綾諱技浜庣棝鑻︾殑澶氱嚎紼嬶級錛岄渶瑕佹紜殑澶勭悊浠g爜鐨勭粨鏋勪笌澶勭悊鍚屾銆傞殢鐫涓嬩竴浠g‖浠剁殑鏅強錛屾暣涓鍩熷紑濮嬪涔犲綰跨▼緙栫▼鎶鏈侱ICE涔熷湪涓嶆柇鍜岀‖浠跺巶鍟嗘繁鍏ュ悎浣滃彂鎸ュ鏍告灦鏋勭殑鎬ц兘銆?/p>
聽聽聽 FiringSquad: The 64-bit CPU has taken longer to really appear in mainstream PCs than some people expected. Do you think 64-bit CPUs will become more popular and how does DICE support it in their Battlefield 2/2142 engine ? 銆銆鎻愰棶錛?4浣岰PU鐨勬櫘鍙婇熷害瓚呰繃浜轟滑鐨勯璁″埌鏉ュ緱濡傛涔嬪揩錛屾偍璁や負錛栵紨浣峜pu浼氭祦琛岃搗鏉ヤ箞錛烡ICE鍦˙F2寮曟搸涓浣曟敮鎸佸畠鍛紵 聽聽聽 Marko Kylmamaa: One of the problems with harnessing the full power of 64-bit CPU鎶?is the lack of adoption of 64-bit operating systems. Due to this it鎶?difficult for the game developers to make full use of the 64-bit execution potential without providing a separate set of executables compiled for the different operating systems. The current Battlefield 2 technology has been thoroughly tested on the 64-bit architecture for guaranteeing a solid performance, and optimizations have been made where possible with such architectures in mind. 銆銆鍥炵瓟錛氱敱浜庣幇鍦?4bit鎿嶄綔緋葷粺瀵?4浣嶏跡錛幫嫉鐨勬敮鎸佷笉鏄潪甯稿ソ錛屾墍浠ヨ繕鏃犳硶瀹屽叏鍙戞尌錛栵紨浣嶏跡錛幫嫉鐨勬ц兘銆傚鏋滀笉鍒嗗埆鐨勪負涓嶅悓騫沖彴緙栧啓紼嬪簭灝辨棤娉曞彂鎸ワ紪錛斾綅鐨勬ц兘錛岃繖鏄釜闅劇偣銆侭F2宸茬粡鍦紪錛斾綅騫沖彴涓婄粡榪囨祴璇曚笌浼樺寲榪囥?/p>
聽聽聽 FiringSquad: Game physics are getting more and more attention as well with more attention being put into destructible objects and better collisions. Where does DICE stand on this kind of support for its engine and what solution is best; having a dedicated card (AGEIA) using a graphics card (ATI/Havok) or using a CPU to handle it? 銆銆鎻愰棶錛氭父鎴忕殑鐗╃悊鐗規ц秺鏉ヨ秺鍙楀埌閲嶈銆侱ICE濡備綍鐪嬪緟瀹冿紵鎮ㄨ涓哄摢縐嶆柟妗堟渶濂藉憿錛熸槸鐙珛鐨凙GEIA鐗╃悊鍗★紝榪樻槸NV/Havok鐨勫浘褰㈠崱錛岃繕鏄敤CPU澶勭悊錛?/p>
聽聽聽 Marko Kylmamaa: Especially with multiplayer games in mind, it is difficult to make use of scaleable physics, since especially from the gameplay perspective all of the players must experience the same end result in simulation regardless of their hardware. This leads to a lot of the scalability of the physics being used for visual effects such as richer particle effects or fluid simulation. The GPU can of course be used for offloading the physics simulation from the CPU, but this will compete with the remaining processing time for graphics. Therefore in most cases it is necessary to strike the right balance between the CPU and GPU usage with the needs of the particular game in mind. The next generation technology at DICE is being built on the bleeding edge and will make use of very comprehensive physical modeling. 銆銆鍥炵瓟錛氬湪澶氫漢娓告垙涓嬌鐢ㄧ墿鐞嗙壒鎬ф槸鐩稿綋闅懼仛鐨勶紝浠庣帺瀹剁殑瑙嗚鏉ヨ錛屾墍鏈夌殑浜や簰瑙掕壊蹇呴』浣撻獙鍒扮浉鍚岀殑鐗╃悊鐗規ц屼笉鍏崇郴浠栦滑璇翠嬌鐢ㄧ殑鏄綍縐嶇‖浠躲傚凡緇忎嬌鐢ㄧ殑鐗╃悊鐗規ф湁姣斿嫻佷綋妯℃嫙綺掑瓙緋葷粺絳夌瓑銆傦姬錛幫嫉鍙互鍒嗘媴涓浜涳跡錛幫嫉鐨勭墿鐞嗘ā鎷熻綆楀伐浣滐紝浣嗘槸榪欐牱灝卞拰鍥懼艦璁$畻浜夋姠浜嗗疂璐電殑璧勬簮銆傝櫧鐒跺姝わ紝鎴戜滑渚濇棫闇瑕佸鉤琛★跡錛幫嫉鍜岋姬錛幫嫉涔嬮棿鐨勮礋杞姐侱ICE灝嗕細鍏呭垎鐨勫埄鐢ㄤ笅涓浠f妧鏈負鐜╁鏋勫緩鏈浼樼鐨勭墿鐞嗕綋楠屻?/p>
聽聽聽 FiringSquad: HDR lighting is also getting a lot of attention in more PC games. How does the Battlefield 2/2142 engine support those features and how will that help the graphics in games that use it? 銆銆鎻愰棶錛欻DR鍏夌収鏁堟灉涔熻瓚婃潵瓚婂鐨勬彁鍙娿侭F2/2142寮曟搸鏄浣曟敮鎸佽繖縐嶇壒鏁堬紝鑰屼笖瀹冨皢濡備綍鎻愬崌娓告垙鐢婚潰鍛紵 聽聽聽 Marko Kylmamaa: HDR lighting can add significantly to the perceived realism in the modern graphics engines. It is becoming an increasingly common feature as the new hardware supports full floating point surfaces and has the required processing power for supporting a multitude of such high end features. 銆銆鍥炵瓟錛欻DR鍏夌収鍙互浣滀負鐜頒唬鍥懼艦寮曟搸鐨勪竴涓壒鎬с傚湪鏂扮‖浠跺畬鍏ㄦ敮鎸佹誕鐐硅綆楃殑鏂瑰紡涓嬶紝瀹冨彲浠ユ彁楂樼敾闈㈣川閲忚瀹冪湅璧鋒潵鏇寸湡瀹烇紝鍚屾椂涔熼渶瑕佺浉褰撶殑璁$畻閲忋傦綀锝勶綊鍦絺锝嗭紥鐗瑰埆姝﹀姏銆涓浣跨敤錛岀敤浜庡瑙嗘晥鏋溿侭F2142娌℃湁澶滃競鍦烘櫙錛屾墍浠ヤ篃灝辨病鏈変嬌鐢ㄨ繖縐嶆妧鏈紙搴旇鏄疕DR錛夛紝涓嶈繃鎴戜滑浣跨敤鍏朵粬鐨勫厜鐓ф晥鏋滄彁楂樼敾闈㈢殑鐪熷疄鎰熴?/p>
聽聽聽 FiringSquad: More and more games are using extensive pixel and vertex shading for visual and art effects. How does the Battlefield 2/2142 engine support these features currently and how will pixel and vertex shaders be used in the future, particularly with Windows Vista and DirectX10 support? 銆銆鎻愰棶錛氳秺鏉ヨ秺榪囩殑娓告垙騫挎硾浣跨敤PS鍙奦S鎶鏈彁楂樼敾闈㈣川閲忋侭F2/2142鐨勫紩鎿庡浣曟敮鎸佽繖浜涚壒鑹詫紝鏈潵PS VS灝嗚濡備綍浣跨敤錛岀壒鍒槸VISTA鍜孌X10鐨勬潵涓達紵 聽聽聽 Marko Kylmamaa: The Battlefield 2 engine has been built on the DirectX9 architecture and is a fully shader based model. This allowed for a great flexibility during the development, and not supporting the older fixed function pipeline model allowed us to concentrate solely on the high end features. Battlefield 2142 is based on the improved Battlefield 2 technology and will be released later this year, so considering that the DirectX10 hardware won鎶?be widely available just yet, it hasn鎶?been beneficial to re-architect the engine into a DirectX10 based model for this release. This allowed the available time to be used for adding a number of new special effects and polishing the overall look of the existing engine. 銆銆鍥炵瓟錛氱洰鍓岯F2寮曟搸瀹屽叏鏋勫緩浜嶥X9鏋舵瀯錛岃繖鏄釜瀹屽叏鍩轟簬Shader鐨勬ā鍨嬨傝繖鎻愰珮浜嗗紑鍙戠殑鍙幾緙╂э紝鎽嗚劚浜咶F綆$嚎妯″瀷璁╂垜浠緱浠ュ疄鐜版渶楂樼駭鐨勭壒鏁堛侭F2142鍩轟簬鏀硅繘鐨凚F2寮曟搸鎶鏈紝涓嶄箙灝嗗彂甯冧簬涓栵紝鎵浠ヨ冭檻鍒癉X10紜歡涓嶄細閭d箞蹇殑鏅強錛屾垜浠皢寮曟搸閲嶆柊鏋勫緩浠ラ傚簲DX10鐨勬ā鍨嬨傝繖鏍鋒垜浠氨鏈夋椂闂村湪浠ュ悗鐨勬棩瀛愰噷緇х畫鍔犲叆鏂扮殑鏁堟灉錛屾嫇灞曠幇鏈夌殑寮曟搸銆?/p>
聽聽聽 FiringSquad: What other advanced hardware and graphical features do you think will be supported in upcoming Battlefield 2/2142 engine games and in future graphics engine? 銆銆鎻愰棶錛氭偍璁や負BF2/2142寮曟搸灝嗕細鏀寔鍝簺楂樼駭鐨勭‖浠跺強鍏跺浘褰㈡妧鏈紝鏈潵鐨勫紩鎿庡憿錛?/p>
聽聽聽 Marko Kylmamaa: Battlefield 2142 will support a large range of high end special effects geared towards creating the desired futuristic look. These involve for example new atmospheric effects for creating a unique look that is quite different from Battlefield 2. 銆銆鍥炵瓟錛欱F2142鏀寔璁稿鐗規晥鐢ㄦ潵鏋勫緩緇氫附鐪熷疄鐨勫浘鍍忋傛瘮濡傦紝鐞冧綋鍏夌収鎶鏈紙Atomospheric Effect錛夋妧鏈氨鍜孊F2涓殑涓嶅悓銆?/p>
聽聽聽 FiringSquad: Finally, Mark Rein from Epic has said that Intel is hurting the PC gaming industry through its use of intergrated graphics in PCs. Is this a real threat and if so what can be done about this from the game developer's side? 銆銆鎻愰棶錛氭渶鍚庯紝Epic錛堜笉瑕佸憡璇夋垜涓嶇煡閬擄紝鍗沖皢鍙戝竷鐨刄T2007錛夌殑Mark Rein璇達紝Intel姝e湪閫氳繃闆嗘垚鍥懼艦紜歡鎹熷PC娓告垙宸ヤ笟銆備粠娓告垙寮鍙戣呯殑瑙掑害鏉ヨ鎮ㄥ浣曠湅寰呰繖涓棶棰橈紵 聽聽聽 Marko Kylmamaa: Intel produces what you could call the ultra-low end graphics cards for a market segment that typically doesn鎶?wish to invest the money into a higher end, gaming geared hardware. Clearly there is a demand for this type of hardware as Intel鎶?graphics cards boast a large user base. However, this does impose challenges for the games industry in our attempts at reaching especially for the casual gamer market. Hardware requirements for the next generation games keep growing faster than what is needed for running general applications, which increases the rift between the casual and hardcore hardware markets. I believe that we as an industry will also have to recognize the different requirements these markets impose. 銆銆鍥炵瓟錛氫拱Intel鐨勬樉鍗$殑浜猴紝灝辨槸閭d簺浣犵О涔嬩負涔頒綆绔揣鐨勯偅浜涗漢錛屼粬浠叾瀹為兘涓嶄細鑺遍挶鏋勫緩涓涓父鎴忓鉤鍙般傝櫧鐒朵簨瀹炲姝わ紝鐢變簬榪欎釜鍘熷洜鐨勫獎鍝嶏紝鎴戜滑榪樻槸涓嶅お瀹規槗寮鎷撹繖鏍風殑涓涓競鍦恒傛父鎴忓紜歡鐨勯渶姹傛繪槸瑕佽繙楂樹簬鍟嗙敤杞歡錛屽叾瀹炶繖涔熸墿澶т簡紜歡甯傚満鐨勫眰嬈″樊璺濄傛垜鐩鎬俊鏁翠釜宸ヤ笟浼氬鐪嬫竻妤氳繖涓棶棰樸備粠涓涓父鎴忓紑鍙戣呯殑瑙掑害鏉ヨ錛岃楂樼娓告垙榪愯鍦ㄤ綆绔鉤鍙頒笂鐫瀹炲洶闅俱傚洜涓鴻鏀寔榪欎簺鎬ц兘涓嶄竴鐨勭‖浠墮渶瑕佹彁楂樺紑鍙戠殑鏃墮棿鍜岃姳璐廣傛洿鏈笂榪樻槸瑕佸紑鍙戣呮牴鎹粬浠墍瑕佸紑鍙戠殑甯傚満榪欎竴瑙掑害榪涜紜歡鐨勫鉤鍙扮殑閫夋嫨銆?/p>
]]>
]]>
銆銆Progressive Mesh宸茬粡涓嶆槸闈炲父鏂扮殑鎶鏈紝鍦℉F2 SOURCE寮曟搸涓緱鍒頒簡搴旂敤銆侫Ti鐨勯偅涓狣EMO錛屽笗鎻愬啘紲炲簷鐨勫疄鏃舵覆鏌撶▼搴忥紝涓嬈¤窇鍒板悓瀛︾殑鑰丄Ti X1600XT涓婃祴璇曚簡涓鎶娿傚掍笉鏄渿鎾間簬浣跨敤鐨勬妧鏈紝鑰屾槸璧炲徆浜庣編宸ュ埗浣滆繖涓緩絳戞ā鍨嬬殑綺劇粏搴︹︹?

銆銆OoCS(x)鐨勬濇兂鏄紝棰勫厛澶勭悊妯″瀷鏁版嵁錛屼嬌鐢∣ctree鏍戝垎鍓詫紝鐢熸垚LOD鏁版嵁錛屽啓鍒扮鐩樹笂銆傝繍琛屾椂杞藉叆錛屾嫻嬪綋鍓峍iew Frustrum鐨勪綅緗紝搴旂敤LOD緇樺埗鍦烘櫙銆傚鎴戞潵璇寸浉褰撶殑澶嶆潅錛孫ctree榪樻病鏈夋帴瑙﹁繃錛屼笅闈㈣韙忚笍瀹炲疄鐨勫涔犳暟鎹粨鏋勪簡銆?br />
銆銆鐗瑰埆涓鎻愮殑鏄繖涓漢鐨勪釜浜虹綉绔欙紝寰蔣鐮旂┒闄㈢殑Hugues Hoppe錛屾病浠涔堣瘝姹囧艦瀹癸紝寮哄瓧瀹屾瘯銆備及璁irect3D涓紭鍖栫綉鏍煎嚱鏁扮殑綆楁硶浼拌灝辨槸浠栫殑鐮旂┒鎴愭灉錛岀湅浠栫殑PDF鍙互寰堝揩鐨勪簡瑙e師鐞嗐?br />
銆銆澶氳阿LOGOS鍏勭殑鍙嶉棶錛屽師鏂囧繕璁頒簡鍐欎竴浜涜兌姘存枃瀛椼侫Ti鐨勯偅涓狣EMO浣跨敤浜哋OCS鐨勭畻娉曪紝鑰孭rogressive Mesh鍜孫oCSx涓殑涓浜涙濇兂綾諱技錛屾瘮濡傞兘浣跨敤浜哘uadric Matrix鍒ゆ柇欏剁偣銆?img src ="http://m.shnenglu.com/Jedimaster/aggbug/16611.html" width = "1" height = "1" />
]]>
]]>
聽聽聽 Some aspects of the HDR lighting were simulated especially in the Battlefield 2聽聽 Expansion Pack: Special Forces, for adding a degree of realism to the night-time look. The effect is fairly settle and was used mainly for fine tuning the overall look. Battlefield 2142 does not have night-time levels, so the same technology was not applicable to it, however there are a great number of special lighting effects for enhancing the desired futuristic look of the game.
聽聽聽 From the perspective of a developer, it can be difficult or in some cases practically impossible to make the high-end game run on the ultra-low end hardware. Supporting such scalability range in performance could be prohibitive with the required development time and cost in mind. It is ultimately up to each developer to find the correct range of hardware which allows for the desired market penetration.
聽聽聽 鐢誨闊籌細涓嶇煡閬撴垜鐨?200A鎺掑湪浠涔堝湴鏂瑰搱鍝堛?br />
聽聽聽 鍏跺疄涓婂浘鏈夊亸棰囷紝榪欏紶鍥捐妭閫夎嚜Siggraph2004錛岃岀幇鍦ˋTi 1800XT鐨凷IMD鎬ц兘宸茬粡瓚呰繃浜?800濂藉錛屽彲涓嶆槸娓告垙鎬ц兘銆備笉榪囧彲浠ョ湅鍑猴紝姣擟PU鐨勬誕鐐硅繍綆楁ц兘楂樺ソ鍑犲嶆槸涓嶇湡鐨勪簨瀹烇紝鍙槸濡備綍鍒╃敤鍛紵
聽聽聽 鍙紪紼嬬‖浠剁殑鍒版潵涓烘垜浠紑浜嗕竴涓ソ澶達紝涔熻鏈潵璁$畻鏈虹‖浠剁殑鍙戝睍瓚嬪娍灝辨槸錛岄氱敤璁$畻Generic Computing錛圙C錛岃嚜閫犺瘝姹囷紝鍙笉鏄瀮鍦炬敹闆嗭級銆傛樉鍗′竴鐩翠互鏉ラ兘鏄拰Pixel鎵撲氦閬擄紝璇誨彇Texel錛屽鐞哖rimitive錛屽啓鍏rameBuffer錛屼負SIMD鐨勫簲鐢ㄦ墦涓嬩簡鍧氬疄鐨勫熀紜銆傛樉鍗¤姱鐗囦粠寮濮嬪氨鏄茍琛岃璁$殑錛岃繖鏍蜂粠綰圭悊鍗曞厓璇誨彇Texel鏃舵墠鑳藉彂鎸ユ晥鍔涳紝褰撳勾澶у悕榧庨紟鐨凴iva TNT2鐨勬剰鎬濆叾瀹炴槸TwiNs Textures鍙岀汗鐞嗭紝鑰屼笉鏄粍鑹茬偢鑽侴eforce3渚濋潬娣誨姞鐨勫嚑涓槀璐電殑register瀹炵幇浜哣ertex Programming銆侼V鏀惰喘3dfx錛屾帹鍑篘V30緋誨垪鑺墖錛屼即闅忕潃DX8涓篜C鏈哄紩鍏hader錛屽紑鍒汸C鏈哄浘鍍忕敾璐ㄩ璺冪殑鍏堟渤錛屽浠婄儹闂ㄦ父鎴忓ぇ澶氭暟宸茬粡浣跨敤鍙紪紼嬬潃鑹叉妧鏈敤鏉ュ疄鐜頒互寰鍦ㄥ伐浣滅珯涓婃墠鑳藉疄鐜扮殑鏁堟灉錛岃繖灝辨槸涓轟粈涔堝浠婄湅娓告垙瀹炴椂婕旂畻鐨勭敾闈㈤兘姣斿綋騫碨quare鍔ㄧ敤sgi宸ヤ綔绔欓泦緹ゆ覆鏌撳嚭鏉ョ殑FF8鍔ㄧ敾鏁堟灉濂界殑鍘熷洜銆傚叾瀹為珮綰G鍥懼艦鐞嗚鍦?0騫翠唬灝卞凡緇忕浉褰撴垚鐔燂紝姣斿78騫寸殑Shadow mapping錛學hite鐨凴ay-tracing絳夌瓑銆傞偅浜涙妧鏈互鍚庢垜浼氭參鎱㈢粰澶у浠嬬粛錛屽ぇ瀹朵笉濡ㄥ幓NVIDIA涓嬭澆涓涓猄DK鐮旂┒涓涓嬶紝榪樻湁MS DX SDK涔熸槸蹇呴渶鐨勩?br />
聽聽聽 鍏堣鐩墠鍙紪紼嬬‖浠剁敤浣滈氱敤璁$畻鐨勫眬闄愶紝鑰屼笖鍦ㄦ垜鐪嬫潵錛岃繖涓眬闄愬湪Vista涓嶥X10嫻佽鍚庡彲鑳戒緷鏃у緱涓嶅埌瑙e喅錛岄偅灝辨槸API鐨勯棶棰樸傛樉鍗″巶鍟嗘彁渚涚殑椹卞姩錛屾棤涓渚嬪鐨勯兘鏄交搴曚負鏄劇ず鏈嶅姟鐨勶紝鑰屼笉鏄敤鏉ユ爣姒滆嚜宸辨槸GPGPU鐨勩傝櫧鐒惰閮芥湁浜嗚嚜宸辯殑鏈湴緙栬瘧鍣紙涓昏鏄敤浜庣紪璇慓LSL string codes錛孒LSL鍙互棰勫厛緙栬瘧濂斤紝鐒跺悗鍐嶇敱椹卞姩杞藉叆鎵ц錛夛紝鍙槸渚濇棫涓嶆槸涓轟簡璁$畻闈炲浘褰㈡暟鎹湇鍔°備簬鏄壘鍒頒簡Sh銆係h鏄竴涓緢鏈夎叮鐨勪笢瑗匡紝浣跨敤浜唌etaprogramming鎶鏈紝妯℃嫙鍥懼艦璇█鐨勭畻娉曪紝緙栬瘧鐨勬椂鍊欒漿鍖栦負瀵瑰簲鐨勪綆絳夌駭ASM璇彞錛屽緢澶欸raphic Slide閲岄潰榪涜鏍稿績綆楁硶灞曠ず鐨勬椂鍊欓兘鐢ㄧ殑Sh銆傛湁鍏磋叮鍦板彲浠ュ埌榪欓噷鐪嬩竴涓嬨傚己鐑堝緩璁樉鍗″巶鍟嗘帹鍑哄彲浠ョ洿鎺ヨ繘琛岃綆楃殑椹卞姩錛屼笉瑕佸拰FrameBuffer鐗墊秹錛屽彲浠ョ洿鎺ラ氳繃Bus鍐欏叆鍐呭瓨錛屾妧鏈笂騫朵笉闅撅紝涔熻鏄釜鍟嗕笟闂銆傚叧閿椂鍒繪案榪滄槸鍟嗕笟宸﹀彸鎶鏈殑鍙戝睍錛岃屼笉鏄妧鏈漢鍛樼殑涓鍘㈡儏鎰垮氨鍙互宸﹀彸涓栫晫鍙戝睍錛屽浠婂凡緇忎笉鏄伐涓氶潻鍛芥椂浠d簡銆?br />
聽聽聽 緇欏ぇ瀹朵粙緇嶆潵鑷猄tarford University鐨?a >Brook錛堝惉璧鋒潵濂藉儚騫垮憡錛屼笉榪囧湪Shading Language鐣屽彲鏄湁Starford Shading Language寰椾竴甯箣鍦扮殑錛夈侭rook鍙互鐞嗚В涓烘槸涓涓狢緙栬瘧鍣紝鍙笉榪囧畠緙栬瘧鐨勪笉鏄疊in錛岃屾槸C++ string codes錛岃屼笖鏄潃鑹茶綆楄鍙ユ暟緇勩傛瘮濡傛湁榪欐牱涓孌礏rook浠g爜錛岀畝鍗曠殑Alpha娣峰悎錛屼笉瀵癸紝涓嶅儚錛屽弽姝e氨鏄畠浜嗭細
out聽float4聽result<>)聽{
result聽=聽(alpha聽*聽x)聽+聽y;
}
聽聽聽 緙栬瘧鎴愭渶緇堢殑C++浠g爜鍙樻垚錛?br />
"!!FP1.0\n"
"DECLARE聽alpha;\n"
"TEX聽R0,聽f[TEX0].xyxx,聽TEX0,聽RECT;\n"
"TEX聽R1,聽f[TEX1].xyxx,聽TEX1,聽RECT;\n"
"MADR聽o[COLR],聽alpha.x,聽R0,聽R1;\n"
"END聽\n"
"##!!BRCC\n"
"##narg:4\n"
"##c:1:alpha\n"
"##s:4:x\n"
"##s:4:y\n"
"##o:4:result\n"
"##workspace:1024\n"
"##!!multipleOutputInfo:0:1:\n"
"",NULL};
void聽saxpy聽(const聽float聽alpha,const聽::brook::stream&聽x,const聽::brook::stream&聽y,
::brook::stream&聽result)聽{
聽聽聽 static聽const聽void聽*__saxpy_fp[]聽=聽{"fp30",聽__saxpy_fp30,聽"ps20",聽__saxpy_ps20,
聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 "cpu",聽(void聽*)聽__saxpy_cpu,聽NULL,聽NULL聽};
聽聽聽 static聽__BRTKernel聽k(__saxpy_fp);
聽聽聽 k->PushConstant(alpha);
聽聽聽 k->PushStream(x);
聽聽聽 k->PushStream(y);
聽聽聽 k->PushOutput(result);
聽聽聽 k->Map();
}
聽聽聽 榪欎笉灝辨槸綰補鐨凷hading Language涔堛備笉榪囧煎緱娉ㄦ剰鐨勬槸錛孊rook閫氳繃榪愯搴撹繘琛屽皝瑁咃紝鎶奊PU褰撲綔Streaming Processor錛岀敱CPU榪涜鎺у埗錛岃綆楁暟鎹茍杈撳嚭銆傜洰鍓嶄技涔庡彧鑳借繘琛屽浘褰㈢殑璁$畻錛屾瘮濡侳FT錛孯ay-Tracing絳夋紨紺猴紝榪樻病鏈夊埌杈捐兘澶熻綆梡i鐨勭▼搴︺?br />
聽聽聽 鎬濊冧簡涓涓嬨傜簿搴﹂棶棰橀渶瑕佽В鍐籌紝FP16鍒氬垰寮濮嬪箍娉涗嬌鐢紝FP32榪樹笉鑳藉鏀寔紜歡榪囨護銆侳P32浠呬粎鍙槸IEEE754 float鐨勭簿搴﹁屽凡錛屾洿鏈皥涓嶄笂double鐨勭簿搴︼紝鐢ㄥ湪闇瑕佺簿搴﹁緝楂樼殑鍦版柟鍙兘榪樹笉鏄緢閫傚悎銆傚鎴戣鎯抽偅鏍鳳紝榪涜pi鐨勫嚑鐧句竾浣嶇殑璁$畻錛岀洰鍓嶆潵璇翠笉澶彲鑳斤紝棣栧厛錛孲hading Language浠庢潵灝辨病鏈夋彁渚涘湴鍧鐨勬搷浣滐紝涔熷氨鏄棤娉曢夋辰Pixel鐨勪綅緗紝涔熷氨鏄棤娉曞FrameBuffer榪涜鍑嗙‘瀹氫綅銆傚鏋滃彲浠ヨВ鍐寵繖涓棶棰橈紝閭d箞灝卞彲浠ヨ繘琛岀湡姝f剰涔変笂鐨勯氱敤璁$畻錛岄偅涓椂鍊橣rameBuffer鍙槸涓涓殏鏃剁殑緙撳啿瀹瑰櫒鑰屽凡銆?br />
聽聽聽 SIMD鐨勭墿鐞嗚綆楀彲浠ョ浉褰撶殑寮烘倣銆傜墿鐞嗙壒鎬ц綆楅兘鏄己璋冨悓鏃舵х殑錛岃孏PU鍙互鍚屾椂騫惰璁$畻錛屽厖鍒嗗彂鎸ヤ簡鑷繁鐨勪紭鍔匡紝闅炬狽VIDIA瑕佸拰Havok榪涜鍚堜綔銆傝寰椾互鍓嶇湅榪囧崥瀹㈠洯涓竴浣嶅厛鐢熷啓鐨勭墿鐞嗗紩鎿庯紝鐫瀹為渿鎯婏紝鎴戝緩璁粬涓嶅Θ鐮旂┒鐮旂┒榪欎竴鍧椼係tream鐨勬蹇靛皢鍦―X10涓婂緱鍒板交搴曠殑璇犻噴錛屼笉濡ㄧ湅鐪嬫垜浠ュ墠緲昏瘧鐨凞X10鏂囩珷錛屽叾涓璆eometry Shader寰堟湁鎰忔濄?br />
聽聽聽 鎴戞湡寰呬笅涓浠PI鍑虹幇錛屼竴涓喘鏂扮殑杞‖浠剁粍鍚堟柟妗堬紝榪欐牱灝卞彲鑳戒負Display Adapter榪欎釜鍙よ佺殑涓滆タ甯︽潵鐪熸鐨勯潻鍛姐傚煎緱娉ㄦ剰鐨勬槸錛孉MD宸茬粡鏀惰喘浜咥Ti錛岃孖ntel榪樺湪涓?00浜跨編鍏冩敹璐璑V鐨勪環鏍艱瘎浼扮殑鏃跺欙紝涔熻涓嬩竴浠e彉闈╁凡緇忓紑濮嬩簡錛岃鎴戜滑鎷洰浠ュ緟銆?br />
聽聽聽 鎻愬埌鐨勪笢瑗垮彲浠ュ湪榪欓噷鎵懼埌
聽聽聽 Brook http://sourceforge.net/projects/brook
聽聽聽 libSh http://sourceforge.net/projects/libsh
]]>