Knowledge

Cg (programming language)

Source đź“ť

25: 129: 1540:
optimized shader is loaded according to its profile. For instance there might be a profile for a graphics card that supports complex pixel shaders, and another profile for one that supports only minimal pixel shaders. By creating a pixel shader for each of these profiles a supporting program enlarges the number of supported hardware platforms without sacrificing picture quality on powerful systems.'
1539:
To avoid exposing the source code of the shader, and still maintain some of the hardware specific optimizations, the concept of profiles was developed. Shaders can be compiled to suit different graphics hardware platforms (according to profiles). When executing the supporting program, the best/most
353:
In the beginning, vertex and pixel shaders were programmed at a very low level with only the assembly language of the graphics processing unit. Although using the assembly language gave the programmer complete control over code and flexibility, it was fairly hard to use. A portable, higher level
1535:
In addition to being able to compile Cg source to assembly code, the Cg runtime also has the ability to compile shaders during execution of the supporting program. This allows the runtime to compile the shader using the latest optimizations available for hardware that the program is currently
495:
that stand for GPUs with different capabilities. These profiles decide, among others, how many instructions can be in each shader, how many registers are available, and what kind of resources a shader can use. Even if a program is correct, it might be too complex to work on a profile.
349:
Due to technical advances in graphics hardware, some areas of 3D graphics programming have become quite complex. To simplify the process, new features were added to graphics cards, including the ability to modify their rendering pipelines using vertex and pixel shaders.
499:
As the number of profile and shader types cropped up, Microsoft has switched to use the term "Shader Model" to group a set of profiles found in a generation of GPUs. Cg supports some of the newer profiles up to Shader Model 5.0 as well as translation to glsl or hlsl.
1536:
executing on. However, this technique requires that the source code for the shader be available in plain text to the compiler, allowing the user of the program to access the source-code for the shader. Some developers view this as a major drawback of this technique.
1507:
As in C, Cg/HLSL features a set of functions for common tasks in GPU programming. Some of the functions have equivalents in C, like the mathematical functions abs and sin, while others are specialized in GPU programming tasks, like the
419:
Cg also features vector and matrix data types that are based on the basic data types, such as float3 and float4x4. Such data types are quite common when dealing with 3D graphics programming. Cg also has struct and
1570:, their GLSL-to-SPIR_V compiler. Support for SPIR-V means that the shaders can be cross-platform, no longer limiting them to a DirectX stack. This task was previously performed by source-level converters like 1589:
The ReshadeFX shading language is also based on Cg/HLSL. Shaders written in ReshadeFX are compiled to OpenGL, DX, or Vulkan and injected into games to act as post-processing filters.
1551:
Microsoft has released two compilers for HLSL. The original compiler was the closed-source FXC (Effect Compiler), supported until 2015. It was deprecated in favor of the open-source
1555:-based DXC (DirectXShaderCompiler) with support for newer HLSL features. Both compilers generate bytecode: while the older FXC used DXBC, DXC now uses DXIL. DXC can also emit 432:
Cg supports a wide range of operators, including the common arithmetic operators from C, the equivalent arithmetic operators for vector and matrix data types, and the common
137:
of the statue is achieved purely physically, while the texture of the rectangular frame beside it is based on color intensity. The square in the background has been
1520:
Cg programs are merely vertex and pixel shaders, and they need supporting programs that handle the rest of the rendering process. Cg can be used with two graphics
1725: 3164: 3516: 272:
and although they share the same core syntax, some features of C were modified and new data types were added to make Cg/HLSL more suitable for programming
364:
Cg code is portable to a wide range of hardware and platforms, unlike assembly code, which usually depends on hardware and the platforms it's written for.
46: 39: 1532:. Each has its own set of Cg functions to communicate with the Cg program, like setting the current Cg shader, passing parameters, and such tasks. 2601: 1873: 381:
Cg has six basic data types. Some of them are the same as in C, while others are especially added for GPU programming. These types are:
2514: 89: 61: 2580: 197: 3496: 68: 444:
Cg shares the basic control structures with C, like if/else, while, and for. It also has a similar way of defining functions.
354:
language for programming the GPU was needed, so Cg was created to overcome these problems and make shader development easier.
1967: 391: 367:
The Cg compiler can optimize code and do lower level tasks automatically, which are hard to do and error prone in assembly.
2281:"microsoft/DirectXShaderCompiler: This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang" 75: 2030: 2443: 2426: 2262: 108: 57: 3094: 2553: 2244: 2183: 2162: 2087: 3423: 3024: 150: 3329: 3099: 1891: 826: 2519: 2416: 1683: 3064: 3039: 3029: 2326: 1909: 1646: 1583: 3196: 2295:"glslang: Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator" 3506: 3089: 3084: 3079: 3069: 3059: 3034: 2312: 397: 246: 218: 2344: 3104: 3074: 3054: 3049: 3044: 2977: 2759: 2525: 1638: 82: 3501: 273: 269: 214: 2208: 2059: 3302: 3208: 2995: 35: 3383: 3007: 2802: 1877: 1070: 1056: 403: 337: 146: 2012: 3448: 1156: 1142: 138: 279:
Two main branches of the Cg/HLSL language exist: the Nvidia Cg compiler (cgc) which outputs
2710: 2546: 1818: 262: 287:
and the Microsoft HLSL which outputs DirectX shaders in bytecode format. Nvidia's cgc was
8: 2931: 2777: 1797: 1704: 1438: 385: 330: 153:
of the water in the foreground are added by a shader applied finally to the entire scene.
3187: 3152: 2782: 2772: 2767: 2748: 2743: 2738: 2733: 2728: 1738: 1653: 1276: 169: 2390: 2376: 3373: 3253: 2821: 2816: 2811: 2792: 2787: 2691: 2439: 2422: 2280: 1823: 1718: 1631: 409: 299: 2488: 3511: 3433: 3428: 3268: 2953: 2919: 2900: 2872: 2723: 2718: 2701: 2696: 2686: 2681: 2659: 2654: 2465: 1548:
The Cg dialect has only ever had one compiler, in the form of Nvidia's Cg toolkit.
433: 361:
High level code is easier to learn, program, read, and maintain than assembly code.
250: 162: 3243: 3225: 2971: 2539: 2362: 1711: 1606: 1509: 1060: 421: 315: 295: 3310: 3201: 2965: 1128: 1114: 458: 322: 2308: 3490: 3453: 3287: 3248: 3213: 2959: 2669: 1828: 1804: 1770: 1624: 1617: 1611: 1563: 303: 2507: 3458: 3378: 3368: 3282: 3172: 2983: 2866: 2860: 2673: 2469: 2453: 2411: 1990: 1843: 1669: 1566:
has also written a LLVM-based HLSL compiler, in the form of a frontend for
1100: 1046: 307: 2501: 2294: 1953: 183: 3258: 3138: 2649: 2481: 2449: 2436:
GPU Gems: Programming Techniques, Tips, and Tricks for Real-Time Graphics
1663: 1146: 1132: 1090: 288: 3388: 3177: 3001: 2925: 1080: 134: 3220: 1927: 2634: 2496: 2140:
Shader Model 3.0, Ashu Rege, NVIDIA Developer Technology Group, 2004.
1776: 1731: 1697: 1571: 1118: 1104: 1026: 258: 24: 2629: 2624: 2461: 2458:
Cg: A System for Programming Graphics Hardware in a C-like Language
2230: 2124: 2109: 1994: 1783: 1600: 142: 2152:
The Direct3D 10 System, David Blythe, Microsoft Corporation, 2006.
128: 3438: 3321: 3277: 2575: 2487:
Some essential materials (e.g. the design paper) are gathered in
1853: 1759: 1752: 1690: 1676: 1529: 340:
shaders (ray generation, intersection, bit / closest hit / miss).
280: 1203:
means "32 texture instructions and 64 arithmetic instructions."
310:, but other types of shaders were introduced gradually as well: 3147: 2989: 2562: 1848: 1790: 1556: 1525: 1036: 284: 265: 254: 1195:— GCN 1+, Kepler+, Skylake+, DirectX 12 (11_0+) with WDDM 2.7. 1189:— GCN 1+, Kepler+, Skylake+, DirectX 12 (11_0+) with WDDM 2.6. 291:
in 2012, with no additional development or support available.
3443: 3418: 3292: 2936: 2911: 2905: 1765: 1592: 326: 302:. The Cg/HLSL language originally only included support for 3413: 2895: 2125:"ATI Radeon X800 Pro and XT Platinum Edition: R420 Arrives" 1838: 1833: 1745: 1552: 1016: 230: 2520:
Documentation for the Cg Shader standard used by emulators
2615: 2610: 2531: 2431: 2419:: The Definitive Guide to Programmable Real-Time Graphics 2407: 1521: 461:
directives and its macro expansion system. It implements
424:, which work in a similar way to their C equivalents. 133:
A scene containing several different 2D HLSL shaders.
2088:"Microsoft DirectX High Level Shader Language (HLSL)" 1183:— GCN 1+, Kepler+, DirectX 12 (11_0+) with WDDM 2.5. 1177:— GCN 1+, Kepler+, DirectX 12 (11_0+) with WDDM 2.4. 1171:— GCN 1+, Kepler+, DirectX 12 (11_0+) with WDDM 2.3. 1165:— GCN 1+, Kepler+, DirectX 12 (11_0+) with WDDM 2.1. 357:
Some of the benefits of using Cg over assembly are:
1874:"Fusion Industries :: Cg and HLSL FAQ ::" 439: 333:(hull and domain). The latter is present in Cg 3.1. 314:DirectX 10 (Shader Model 4) and Cg 2.0 introduced 3488: 2484:- Mirror for nvidia's open source compiler, 2002 2031:"Shader Models vs Shader Profiles - Win32 apps" 1910:"Writing HLSL Shaders in Direct3D 9 (Windows)" 2843: 2547: 3517:Microsoft application programming interfaces 249:(HLSL) are two names given to a high-level 1892:"The Cg Tutorial - Chapter 1. Introduction" 1574:, but the resulting code is often bloated. 1159:, Fermi+, DirectX 12 (11_0+) with WDDM 2.0. 2600: 2574: 2554: 2540: 1593:Applications and games that use Cg or HLSL 2224: 2222: 1543: 1515: 336:DirectX 12 (Shader Model 6.3) introduced 109:Learn how and when to remove this message 2203: 2201: 2199: 2197: 2148: 2146: 2054: 2052: 2050: 2048: 2046: 2044: 1502: 321:DirectX 11 (Shader Model 5) introduced 3489: 2448:William R. Mark, R. Steven Glanville, 2327:"PlayStation Shading Language for PS4" 2219: 2178: 2176: 2136: 2134: 2116: 2085: 2081: 2079: 2077: 2075: 2073: 486: 415:sampler* - represents a texture object 204:Cg, HLSL, Playstation Shading Language 45:Please improve this article by adding 3350: 3125: 2842: 2573: 2535: 2489:these course notes from Siggraph 2005 2324: 2297:. The Khronos Group. 21 October 2020. 2231:"NVIDIA Introduces GeForce FX (NV30)" 2194: 2155: 2143: 2110:"NVIDIA Introduces GeForce FX (NV30)" 2041: 2007: 2005: 2508:Language Reference and Documentation 2377:"LightWave - 11.6 Features Overview" 1986: 1984: 1954:"Cg Toolkit | NVIDIA Developer" 1577: 491:Cg programs are built for different 18: 2173: 2131: 2070: 13: 3126: 2401: 2228: 2122: 2107: 2002: 1207:Comparison of HLSL Vertex shaders 14: 3528: 2475: 2391:"Unity - Manual: Writing Shaders" 1981: 906:Face register (2-sided lighting) 504:Comparison of HLSL pixel shaders 1876:. 24 August 2012. Archived from 1426: 1423: 1420: 1383: 1380: 468: 440:Functions and control structures 127: 23: 2438:, Addison-Wesley Professional, 2421:, Addison-Wesley Professional, 2383: 2369: 2363:"Maya Cg Plug-in | NVIDIA" 2355: 2337: 2318: 2301: 2287: 2273: 2255: 2237: 2101: 1256:Max # of instructions executed 1083:-optimized model, DirectX 9.0a. 462: 452: 394:- a 16bit floating point number 388:- a 32bit floating point number 3004:(framebuffer in system memory) 2526:Cross Platform Shaders in 2014 2515:NeHe Cg vertex shader tutorial 2245:"Registers - vs_4_1 (Windows)" 2184:"Registers - ps_5_0 (Windows)" 2163:"Registers - ps_4_1 (Windows)" 2023: 1960: 1946: 1920: 1902: 1884: 1866: 481: 58:"Cg" programming language 1: 3497:C programming language family 2345:"ReShade FX shading language" 2325:Stenson, Richard; Ho, Chris. 2283:. Microsoft. 21 October 2020. 1859: 376: 344: 294:HLSL shaders can enable many 47:secondary or tertiary sources 2086:Peeper, Craig (2004-03-15). 1896:developer.download.nvidia.cn 1684:Garshasp: The Monster Slayer 1586:(PSSL) is based on Cg/HLSL. 447: 427: 406:- a 12bit fixed point number 7: 3351: 2209:"Vertex Shader Differences" 1812: 1647:Enemy Territory: Quake Wars 1584:PlayStation Shader Language 1512:functions tex1D and tex2D. 1378:Dynamic flow control depth 1093:shader model, DirectX 9.0b. 371: 10: 3533: 2561: 2060:"Pixel Shader Differences" 2013:"Cg Profile Documentation" 1834:High level shader language 1071:Radeon 9500-9800/X300-X600 565:Texture instruction limit 268:. Cg/HLSL is based on the 247:High-Level Shader Language 219:RenderMan Shading Language 3406: 3361: 3357: 3346: 3319: 3301: 3267: 3236: 3209:RSX 'Reality Synthesizer' 3186: 3163: 3136: 3132: 3121: 3017: 2946: 2882: 2853: 2849: 2844:Software and technologies 2838: 2801: 2757: 2709: 2668: 2593: 2589: 2569: 2493:Nvidia-hosted materials: 2263:"Porting from FXC to DXC" 1039:Wildcat VP, DirectX 8.0a. 274:graphics processing units 229: 224: 213: 208: 203: 196: 178: 168: 158: 126: 1829:Vertex and pixel shaders 1660:EON Professional™/Ultra™ 721:Instruction predication 539:Dependent texture limit 2996:Scalable Link Interface 2962:(variable refresh rate) 2854:Multimedia acceleration 1839:OpenGL shading language 1277:Instruction predication 1236:# of instruction slots 695:Interpolated registers 3018:GPU microarchitectures 3010:(live video upscaling) 3008:Video Super Resolution 2928:(ray tracing platform) 2758:Unified shaders & 2470:10.1145/1201775.882362 2097:. pp. 5–8, 24–25. 1968:"Cg 2.0 Release Notes" 1726:Lightfeather 3D Engine 1639:Earth's Special Forces 1544:Compilers and dialects 1516:The Cg runtime library 1418:# of texture samplers 1212:Vertex shader version 854:Gradient instructions 747:Index input registers 643:Executed instructions 270:C programming language 34:relies excessively on 3449:Mellanox Technologies 1398:Vertex texture fetch 1358:Dynamic flow control 1318:# constant registers 1201:Executed Instructions 932:Dynamic flow control 669:Texture indirections 509:Pixel shader version 2594:Fixed pixel pipeline 2524:Aras PranckeviÄŤius, 1819:Computer programming 1503:The standard library 1338:Static flow control 880:Loop count register 412:- a Boolean variable 331:tessellation shaders 2932:Nvidia System Tools 2351:. 15 February 2022. 2229:Shimpi, Anand Lal. 2108:Shimpi, Anand Lal. 1705:Hitman: Blood Money 1439:Geometry instancing 1208: 1019:Rampage, DirectX 8. 799:Constant registers 505: 487:Compilation targets 457:Cg implements many 123: 2939:(video decode API) 2892:(shading language) 2805:& tensor cores 2249:msdn.microsoft.com 2213:msdn.microsoft.com 2188:msdn.microsoft.com 2167:msdn.microsoft.com 2064:msdn.microsoft.com 2035:docs.microsoft.com 1932:NVIDIA DesignWorks 1914:msdn.microsoft.com 1880:on 24 August 2012. 1654:Doom 3 BFG Edition 1461:Bitwise operators 1206: 958:Bitwise Operators 617:Instruction slots 591:Position register 503: 298:in both 2D and 3D 121: 3507:Shading languages 3484: 3483: 3480: 3479: 3476: 3475: 3374:Chris Malachowsky 3342: 3341: 3338: 3337: 3254:Shield Android TV 3117: 3116: 3113: 3112: 2908:(ray tracing API) 2834: 2833: 2830: 2829: 2644: 2643: 2584: 2460:, Proceedings of 2251:. 23 August 2019. 2190:. 23 August 2019. 2169:. 23 August 2019. 1824:Computer graphics 1798:Unity game engine 1719:League of Legends 1642:- A Half-Life Mod 1578:Derived languages 1500: 1499: 1087:Shader Model 2.0b 1077:Shader Model 2.0a 1009: 1008: 434:logical operators 400:- a 32bit integer 300:computer graphics 236: 235: 174:nVIDIA, Microsoft 119: 118: 111: 93: 3524: 3434:Cumulus Networks 3429:Bright Computing 3414:3dfx Interactive 3359: 3358: 3348: 3347: 3229: 3217: 3205: 3134: 3133: 3123: 3122: 2954:Nvidia 3D Vision 2920:Nvidia Omniverse 2901:Nvidia GameWorks 2875:(video decoding) 2869:(video decoding) 2863:(video encoding) 2851: 2850: 2840: 2839: 2598: 2597: 2591: 2590: 2578: 2571: 2570: 2556: 2549: 2542: 2533: 2532: 2432:Randima Fernando 2408:Randima Fernando 2395: 2394: 2387: 2381: 2380: 2373: 2367: 2366: 2359: 2353: 2352: 2341: 2335: 2334: 2322: 2316: 2305: 2299: 2298: 2291: 2285: 2284: 2277: 2271: 2270: 2259: 2253: 2252: 2241: 2235: 2234: 2226: 2217: 2216: 2205: 2192: 2191: 2180: 2171: 2170: 2159: 2153: 2150: 2141: 2138: 2129: 2128: 2120: 2114: 2113: 2105: 2099: 2098: 2092: 2083: 2068: 2067: 2056: 2039: 2038: 2027: 2021: 2020: 2017:Nvidia developer 2009: 2000: 1988: 1979: 1978: 1972: 1964: 1958: 1957: 1950: 1944: 1943: 1941: 1939: 1924: 1918: 1917: 1906: 1900: 1899: 1888: 1882: 1881: 1870: 1632:Dolphinity Racer 1481:Native integers 1209: 1205: 1193:Shader Model 6.5 1187:Shader Model 6.4 1181:Shader Model 6.3 1175:Shader Model 6.2 1169:Shader Model 6.1 1163:Shader Model 6.0 1153:Shader Model 5.1 1139:Shader Model 5.0 1125:Shader Model 4.1 1111:Shader Model 4.0 1097:Shader Model 3.0 1091:Radeon X700-X850 1067:Shader Model 2.0 1057:Radeon 8500-9250 984:Native Integers 506: 502: 464: 422:array data types 316:geometry shaders 251:shading language 192: 189: 187: 185: 163:shading language 131: 124: 120: 114: 107: 103: 100: 94: 92: 51: 27: 19: 16:Shading language 3532: 3531: 3527: 3526: 3525: 3523: 3522: 3521: 3502:Nvidia software 3487: 3486: 3485: 3472: 3402: 3396:Ranga Jayaraman 3393:Debora Shoquist 3353: 3334: 3315: 3297: 3263: 3244:Shield Portable 3232: 3226:Nintendo Switch 3223: 3211: 3199: 3182: 3159: 3128: 3109: 3013: 2986:(module/socket) 2980:(module/socket) 2974:(multi-monitor) 2972:Nvidia Surround 2968:(GPU switching) 2942: 2878: 2845: 2826: 2797: 2753: 2711:Unified shaders 2705: 2664: 2640: 2639: 2620: 2585: 2565: 2560: 2478: 2454:Mark J. Kilgard 2417:The Cg Tutorial 2412:Mark J. Kilgard 2404: 2402:Further reading 2399: 2398: 2389: 2388: 2384: 2375: 2374: 2370: 2361: 2360: 2356: 2343: 2342: 2338: 2331:GDC Europe 2013 2323: 2319: 2306: 2302: 2293: 2292: 2288: 2279: 2278: 2274: 2261: 2260: 2256: 2243: 2242: 2238: 2227: 2220: 2207: 2206: 2195: 2182: 2181: 2174: 2161: 2160: 2156: 2151: 2144: 2139: 2132: 2123:Wilson, Derek. 2121: 2117: 2106: 2102: 2090: 2084: 2071: 2058: 2057: 2042: 2037:. 30 June 2021. 2029: 2028: 2024: 2011: 2010: 2003: 1996:Cg in Two Pages 1991:Mark J. Kilgard 1989: 1982: 1977:. January 2008. 1970: 1966: 1965: 1961: 1956:. 8 March 2011. 1952: 1951: 1947: 1937: 1935: 1926: 1925: 1921: 1908: 1907: 1903: 1890: 1889: 1885: 1872: 1871: 1867: 1862: 1815: 1810: 1712:Irrlicht Engine 1607:Adobe Photoshop 1595: 1580: 1546: 1518: 1510:texture mapping 1505: 1298:Temp registers 1230: 1228: 1135:, DirectX 10.1. 1107:, DirectX 9.0c. 1061:Matrox Parhelia 1049:, DirectX 8.0a. 773:Temp registers 533: 531: 493:shader profiles 489: 484: 471: 455: 450: 442: 430: 379: 374: 347: 323:compute shaders 296:special effects 182: 154: 115: 104: 98: 95: 52: 50: 44: 40:primary sources 28: 17: 12: 11: 5: 3530: 3520: 3519: 3514: 3509: 3504: 3499: 3482: 3481: 3478: 3477: 3474: 3473: 3471: 3470: 3467: 3464: 3461: 3456: 3451: 3446: 3441: 3436: 3431: 3426: 3421: 3416: 3410: 3408: 3404: 3403: 3401: 3400: 3399:Jonah M. Alben 3397: 3394: 3391: 3386: 3381: 3376: 3371: 3369:Jen-Hsun Huang 3365: 3363: 3355: 3354: 3344: 3343: 3340: 3339: 3336: 3335: 3333: 3332: 3326: 3324: 3317: 3316: 3314: 3313: 3311:Project Denver 3307: 3305: 3299: 3298: 3296: 3295: 3290: 3285: 3280: 3274: 3272: 3265: 3264: 3262: 3261: 3256: 3251: 3246: 3240: 3238: 3234: 3233: 3231: 3230: 3218: 3206: 3193: 3191: 3184: 3183: 3181: 3180: 3175: 3169: 3167: 3161: 3160: 3158: 3157: 3156: 3155: 3144: 3142: 3130: 3129: 3127:Other products 3119: 3118: 3115: 3114: 3111: 3110: 3108: 3107: 3102: 3097: 3092: 3087: 3082: 3077: 3072: 3067: 3062: 3057: 3052: 3047: 3042: 3037: 3032: 3027: 3021: 3019: 3015: 3014: 3012: 3011: 3005: 2999: 2993: 2987: 2981: 2975: 2969: 2966:Nvidia Optimus 2963: 2957: 2950: 2948: 2944: 2943: 2941: 2940: 2934: 2929: 2923: 2917: 2916: 2915: 2909: 2898: 2893: 2886: 2884: 2880: 2879: 2877: 2876: 2870: 2864: 2857: 2855: 2847: 2846: 2836: 2835: 2832: 2831: 2828: 2827: 2825: 2824: 2819: 2814: 2808: 2806: 2799: 2798: 2796: 2795: 2790: 2785: 2780: 2775: 2770: 2764: 2762: 2755: 2754: 2752: 2751: 2746: 2741: 2736: 2731: 2726: 2721: 2715: 2713: 2707: 2706: 2704: 2699: 2694: 2689: 2684: 2679: 2677: 2666: 2665: 2663: 2662: 2657: 2652: 2645: 2642: 2641: 2638: 2637: 2632: 2627: 2621: 2619: 2618: 2613: 2607: 2606: 2604: 2595: 2587: 2586: 2567: 2566: 2559: 2558: 2551: 2544: 2536: 2530: 2529: 2522: 2517: 2512: 2511: 2510: 2504: 2499: 2491: 2485: 2477: 2476:External links 2474: 2473: 2472: 2446: 2429: 2403: 2400: 2397: 2396: 2382: 2368: 2354: 2336: 2317: 2300: 2286: 2272: 2254: 2236: 2218: 2193: 2172: 2154: 2142: 2130: 2115: 2100: 2069: 2040: 2022: 2001: 1980: 1959: 1945: 1934:. 8 March 2011 1919: 1916:. 24 May 2021. 1901: 1883: 1864: 1863: 1861: 1858: 1857: 1856: 1851: 1846: 1841: 1836: 1831: 1826: 1821: 1814: 1811: 1809: 1808: 1801: 1794: 1787: 1780: 1773: 1768: 1763: 1756: 1749: 1742: 1735: 1729: 1722: 1715: 1708: 1701: 1694: 1687: 1680: 1673: 1666: 1657: 1650: 1643: 1635: 1628: 1621: 1614: 1609: 1604: 1601:3DVIA Virtools 1596: 1594: 1591: 1579: 1576: 1545: 1542: 1517: 1514: 1504: 1501: 1498: 1497: 1494: 1491: 1488: 1485: 1482: 1478: 1477: 1474: 1471: 1468: 1465: 1462: 1458: 1457: 1454: 1451: 1448: 1445: 1442: 1435: 1434: 1431: 1428: 1425: 1422: 1419: 1415: 1414: 1411: 1408: 1405: 1402: 1399: 1395: 1394: 1391: 1388: 1385: 1382: 1379: 1375: 1374: 1371: 1368: 1365: 1362: 1359: 1355: 1354: 1351: 1348: 1345: 1342: 1339: 1335: 1334: 1331: 1328: 1325: 1322: 1319: 1315: 1314: 1311: 1308: 1305: 1302: 1299: 1295: 1294: 1291: 1288: 1285: 1282: 1279: 1273: 1272: 1269: 1266: 1263: 1260: 1257: 1253: 1252: 1249: 1246: 1243: 1240: 1237: 1233: 1232: 1225: 1222: 1219: 1216: 1213: 1199:"32 + 64" for 1197: 1196: 1190: 1184: 1178: 1172: 1166: 1160: 1150: 1143:Radeon HD 5000 1136: 1129:Radeon HD 3000 1122: 1115:Radeon HD 2000 1108: 1094: 1084: 1081:GeForce FX/PCX 1074: 1064: 1063:, DirectX 8.1. 1050: 1040: 1030: 1020: 1007: 1006: 1003: 1000: 997: 994: 991: 988: 985: 981: 980: 977: 974: 971: 968: 965: 962: 959: 955: 954: 951: 948: 945: 942: 939: 936: 933: 929: 928: 925: 922: 919: 916: 913: 910: 907: 903: 902: 899: 896: 893: 890: 887: 884: 881: 877: 876: 873: 870: 867: 864: 861: 858: 855: 851: 850: 847: 844: 841: 838: 835: 832: 829: 822: 821: 818: 815: 812: 809: 806: 803: 800: 796: 795: 792: 789: 786: 783: 780: 777: 774: 770: 769: 766: 763: 760: 757: 754: 751: 748: 744: 743: 740: 737: 734: 731: 728: 725: 722: 718: 717: 714: 711: 708: 705: 702: 699: 696: 692: 691: 688: 685: 682: 679: 676: 673: 670: 666: 665: 662: 659: 656: 653: 650: 647: 644: 640: 639: 636: 633: 630: 627: 624: 621: 618: 614: 613: 610: 607: 604: 601: 598: 595: 592: 588: 587: 584: 581: 578: 575: 572: 569: 566: 562: 561: 558: 555: 552: 549: 546: 543: 540: 536: 535: 528: 525: 522: 519: 516: 513: 510: 488: 485: 483: 480: 479: 478: 475: 470: 467: 459:C preprocessor 454: 451: 449: 446: 441: 438: 429: 426: 417: 416: 413: 407: 401: 395: 389: 378: 375: 373: 370: 369: 368: 365: 362: 346: 343: 342: 341: 334: 319: 304:vertex shaders 243:C for Graphics 234: 233: 227: 226: 222: 221: 211: 210: 206: 205: 201: 200: 194: 193: 180: 176: 175: 172: 166: 165: 160: 156: 155: 145:. The partial 132: 117: 116: 31: 29: 22: 15: 9: 6: 4: 3: 2: 3529: 3518: 3515: 3513: 3510: 3508: 3505: 3503: 3500: 3498: 3495: 3494: 3492: 3468: 3465: 3462: 3460: 3457: 3455: 3454:Mental Images 3452: 3450: 3447: 3445: 3442: 3440: 3437: 3435: 3432: 3430: 3427: 3425: 3422: 3420: 3417: 3415: 3412: 3411: 3409: 3405: 3398: 3395: 3392: 3390: 3387: 3385: 3382: 3380: 3377: 3375: 3372: 3370: 3367: 3366: 3364: 3360: 3356: 3349: 3345: 3331: 3328: 3327: 3325: 3323: 3318: 3312: 3309: 3308: 3306: 3304: 3300: 3294: 3291: 3289: 3286: 3284: 3281: 3279: 3276: 3275: 3273: 3270: 3266: 3260: 3257: 3255: 3252: 3250: 3249:Shield Tablet 3247: 3245: 3242: 3241: 3239: 3237:Nvidia Shield 3235: 3227: 3222: 3219: 3215: 3214:PlayStation 3 3210: 3207: 3203: 3198: 3195: 3194: 3192: 3189: 3185: 3179: 3176: 3174: 3171: 3170: 3168: 3166: 3162: 3154: 3151: 3150: 3149: 3148:Nvidia Quadro 3146: 3145: 3143: 3140: 3135: 3131: 3124: 3120: 3106: 3103: 3101: 3098: 3096: 3093: 3091: 3088: 3086: 3083: 3081: 3078: 3076: 3073: 3071: 3068: 3066: 3063: 3061: 3058: 3056: 3053: 3051: 3048: 3046: 3043: 3041: 3038: 3036: 3033: 3031: 3028: 3026: 3023: 3022: 3020: 3016: 3009: 3006: 3003: 3000: 2997: 2994: 2991: 2988: 2985: 2982: 2979: 2976: 2973: 2970: 2967: 2964: 2961: 2960:Nvidia G-Sync 2958: 2955: 2952: 2951: 2949: 2945: 2938: 2935: 2933: 2930: 2927: 2924: 2922:(3D graphics) 2921: 2918: 2914:(physics SDK) 2913: 2910: 2907: 2904: 2903: 2902: 2899: 2897: 2894: 2891: 2888: 2887: 2885: 2881: 2874: 2871: 2868: 2865: 2862: 2859: 2858: 2856: 2852: 2848: 2841: 2837: 2823: 2820: 2818: 2815: 2813: 2810: 2809: 2807: 2804: 2800: 2794: 2791: 2789: 2786: 2784: 2781: 2779: 2776: 2774: 2771: 2769: 2766: 2765: 2763: 2761: 2756: 2750: 2747: 2745: 2742: 2740: 2737: 2735: 2732: 2730: 2727: 2725: 2722: 2720: 2717: 2716: 2714: 2712: 2708: 2703: 2700: 2698: 2695: 2693: 2690: 2688: 2685: 2683: 2680: 2678: 2675: 2671: 2667: 2661: 2658: 2656: 2653: 2651: 2647: 2646: 2636: 2633: 2631: 2628: 2626: 2623: 2622: 2617: 2614: 2612: 2609: 2608: 2605: 2603: 2599: 2596: 2592: 2588: 2582: 2577: 2572: 2568: 2564: 2557: 2552: 2550: 2545: 2543: 2538: 2537: 2534: 2527: 2523: 2521: 2518: 2516: 2513: 2509: 2505: 2503: 2500: 2498: 2495: 2494: 2492: 2490: 2486: 2483: 2480: 2479: 2471: 2467: 2463: 2459: 2455: 2451: 2447: 2445: 2444:0-321-22832-4 2441: 2437: 2433: 2430: 2428: 2427:0-321-19496-9 2424: 2420: 2418: 2413: 2409: 2406: 2405: 2392: 2386: 2378: 2372: 2364: 2358: 2350: 2346: 2340: 2332: 2328: 2321: 2314: 2310: 2307:Matt Turner. 2304: 2296: 2290: 2282: 2276: 2268: 2264: 2258: 2250: 2246: 2240: 2232: 2225: 2223: 2215:. 2011-02-08. 2214: 2210: 2204: 2202: 2200: 2198: 2189: 2185: 2179: 2177: 2168: 2164: 2158: 2149: 2147: 2137: 2135: 2126: 2119: 2111: 2104: 2096: 2095:microsoft.com 2089: 2082: 2080: 2078: 2076: 2074: 2066:. 2011-02-08. 2065: 2061: 2055: 2053: 2051: 2049: 2047: 2045: 2036: 2032: 2026: 2018: 2014: 2008: 2006: 1998: 1997: 1992: 1987: 1985: 1976: 1969: 1963: 1955: 1949: 1933: 1929: 1923: 1915: 1911: 1905: 1897: 1893: 1887: 1879: 1875: 1869: 1865: 1855: 1852: 1850: 1847: 1845: 1842: 1840: 1837: 1835: 1832: 1830: 1827: 1825: 1822: 1820: 1817: 1816: 1807: 1806: 1805:Unreal Engine 1802: 1800: 1799: 1795: 1793: 1792: 1788: 1786: 1785: 1781: 1779: 1778: 1774: 1772: 1771:PlayStation 3 1769: 1767: 1764: 1762: 1761: 1757: 1755: 1754: 1750: 1748: 1747: 1743: 1741: 1740: 1736: 1733: 1730: 1728: 1727: 1723: 1721: 1720: 1716: 1714: 1713: 1709: 1707: 1706: 1702: 1700: 1699: 1695: 1693: 1692: 1688: 1686: 1685: 1681: 1679: 1678: 1674: 1672: 1671: 1667: 1665: 1661: 1658: 1656: 1655: 1651: 1649: 1648: 1644: 1641: 1640: 1636: 1634: 1633: 1629: 1627: 1626: 1625:Crystal Space 1622: 1620: 1619: 1618:Battlefield 2 1615: 1613: 1610: 1608: 1605: 1603: 1602: 1598: 1597: 1590: 1587: 1585: 1575: 1573: 1569: 1565: 1564:Khronos Group 1560: 1558: 1554: 1549: 1541: 1537: 1533: 1531: 1527: 1523: 1513: 1511: 1495: 1492: 1489: 1486: 1483: 1480: 1479: 1475: 1472: 1469: 1466: 1463: 1460: 1459: 1455: 1452: 1449: 1446: 1443: 1440: 1437: 1436: 1432: 1429: 1417: 1416: 1412: 1409: 1406: 1403: 1400: 1397: 1396: 1392: 1389: 1386: 1377: 1376: 1372: 1369: 1366: 1363: 1360: 1357: 1356: 1352: 1349: 1346: 1343: 1340: 1337: 1336: 1332: 1329: 1326: 1323: 1320: 1317: 1316: 1312: 1309: 1306: 1303: 1300: 1297: 1296: 1292: 1289: 1286: 1283: 1280: 1278: 1275: 1274: 1270: 1267: 1264: 1261: 1258: 1255: 1254: 1250: 1247: 1244: 1241: 1238: 1235: 1234: 1226: 1223: 1220: 1217: 1214: 1211: 1210: 1204: 1202: 1194: 1191: 1188: 1185: 1182: 1179: 1176: 1173: 1170: 1167: 1164: 1161: 1158: 1154: 1151: 1149:, DirectX 11. 1148: 1144: 1140: 1137: 1134: 1130: 1126: 1123: 1121:, DirectX 10. 1120: 1116: 1112: 1109: 1106: 1102: 1098: 1095: 1092: 1088: 1085: 1082: 1078: 1075: 1072: 1068: 1065: 1062: 1058: 1054: 1051: 1048: 1044: 1041: 1038: 1034: 1031: 1028: 1024: 1021: 1018: 1015:— Unreleased 1014: 1011: 1010: 1004: 1001: 998: 995: 992: 989: 986: 983: 982: 978: 975: 972: 969: 966: 963: 960: 957: 956: 952: 949: 946: 943: 940: 937: 934: 931: 930: 926: 923: 920: 917: 914: 911: 908: 905: 904: 900: 897: 894: 891: 888: 885: 882: 879: 878: 874: 871: 868: 865: 862: 859: 856: 853: 852: 848: 845: 842: 839: 836: 833: 830: 828: 824: 823: 819: 816: 813: 810: 807: 804: 801: 798: 797: 793: 790: 787: 784: 781: 778: 775: 772: 771: 767: 764: 761: 758: 755: 752: 749: 746: 745: 741: 738: 735: 732: 729: 726: 723: 720: 719: 715: 712: 709: 706: 703: 700: 697: 694: 693: 689: 686: 683: 680: 677: 674: 671: 668: 667: 663: 660: 657: 654: 651: 648: 645: 642: 641: 637: 634: 631: 628: 625: 622: 619: 616: 615: 611: 608: 605: 602: 599: 596: 593: 590: 589: 585: 582: 579: 576: 573: 570: 567: 564: 563: 559: 556: 553: 550: 547: 544: 541: 538: 537: 529: 526: 523: 520: 517: 514: 511: 508: 507: 501: 497: 494: 476: 473: 472: 469:HLSL features 466: 460: 445: 437: 435: 425: 423: 414: 411: 408: 405: 402: 399: 396: 393: 390: 387: 384: 383: 382: 366: 363: 360: 359: 358: 355: 351: 339: 335: 332: 328: 324: 320: 317: 313: 312: 311: 309: 308:pixel shaders 305: 301: 297: 292: 290: 286: 282: 277: 275: 271: 267: 264: 260: 256: 253:developed by 252: 248: 244: 240: 232: 228: 223: 220: 216: 212: 209:Influenced by 207: 202: 199: 195: 191: 181: 177: 173: 171: 167: 164: 161: 157: 152: 148: 144: 140: 136: 130: 125: 113: 110: 102: 91: 88: 84: 81: 77: 74: 70: 67: 63: 60: â€“  59: 55: 54:Find sources: 48: 42: 41: 37: 32:This article 30: 26: 21: 20: 3459:PortalPlayer 3407:Acquisitions 3379:Curtis Priem 3271:and embedded 3221:Tegra NX-SoC 3173:Nvidia Tesla 3095:Ada Lovelace 2947:Technologies 2889: 2581:List of GPUs 2457: 2435: 2415: 2385: 2371: 2357: 2348: 2339: 2330: 2320: 2303: 2289: 2275: 2266: 2257: 2248: 2239: 2212: 2187: 2166: 2157: 2118: 2103: 2094: 2063: 2034: 2025: 2016: 1995: 1974: 1962: 1948: 1936:. Retrieved 1931: 1922: 1913: 1904: 1895: 1886: 1878:the original 1868: 1844:Shader Model 1803: 1796: 1789: 1782: 1775: 1758: 1751: 1744: 1739:muvee Reveal 1737: 1724: 1717: 1710: 1703: 1696: 1689: 1682: 1675: 1670:eyeon Fusion 1668: 1659: 1652: 1645: 1637: 1630: 1623: 1616: 1599: 1588: 1581: 1567: 1561: 1550: 1547: 1538: 1534: 1519: 1506: 1200: 1198: 1192: 1186: 1180: 1174: 1168: 1162: 1152: 1138: 1124: 1110: 1101:Radeon X1000 1096: 1086: 1076: 1073:, DirectX 9. 1066: 1052: 1047:GeForce 4 Ti 1042: 1032: 1029:, DirectX 8. 1022: 1012: 498: 492: 490: 456: 453:Preprocessor 443: 431: 418: 380: 356: 352: 348: 293: 278: 242: 238: 237: 147:transparency 105: 96: 86: 79: 72: 65: 53: 33: 3259:GeForce Now 3153:Quadro Plex 3139:Workstation 2998:(multi-GPU) 2956:(stereo 3D) 2803:Ray tracing 2768:GeForce 600 2650:GeForce 256 2602:Pre-GeForce 2482:cgc-opensrc 2450:Kurt Akeley 1664:EON Reality 1147:GeForce 400 1133:GeForce 200 512:1.0 to 1.3 482:Environment 338:ray tracing 263:programming 241:(short for 190:/cg-toolkit 139:transformed 3491:Categories 3389:Bill Dally 3384:David Kirk 3362:Key people 3190:components 3025:Fahrenheit 3002:TurboCache 2992:(protocol) 2926:Nvidia RTX 2812:GeForce 20 2502:Cg Toolkit 1975:nvidia.com 1860:References 1559:bytecode. 1271:Unlimited 825:Arbitrary 690:Unlimited 664:Unlimited 586:Unlimited 560:Unlimited 477:Annotation 377:Data types 345:Background 289:deprecated 225:Influenced 151:reflection 135:Distortion 69:newspapers 36:references 3320:Computer 3137:Graphics 3100:Blackwell 2873:PureVideo 2719:GeForce 8 2682:GeForce 3 1777:RetroArch 1732:LightWave 1698:Gun Metal 1572:HLSL2GLSL 1119:GeForce 8 1105:GeForce 6 1027:GeForce 3 953:Yes (64) 827:swizzling 687:Unlimited 681:Unlimited 583:Unlimited 580:Unlimited 577:Unlimited 557:Unlimited 551:Unlimited 532:4.1 530:4.0 474:Namespace 448:Semantics 428:Operators 259:Microsoft 184:developer 170:Developer 3322:chipsets 2883:Software 2630:RIVA TNT 2625:RIVA 128 2462:SIGGRAPH 1928:"Cg FAQ" 1813:See also 1784:R.U.S.E. 1441:support 1333:16Ă—4096 1251:≥ 65536 950:Yes (24) 820:16Ă—4096 782:12 to 32 638:≥ 65536 463:#include 372:Language 198:Dialects 99:May 2024 3512:DirectX 3439:DeepMap 3352:Company 3278:GoForce 3188:Console 3065:Maxwell 3040:Rankine 3030:Celsius 2676:shaders 2576:GeForce 2313:YouTube 1999:, 2003. 1854:DirectX 1760:Panda3D 1753:OpenEmu 1691:GLScene 1677:Far Cry 1568:glslang 1530:DirectX 1231:VS 5.0 1229:VS 4.1 1227:VS 4.0 1221:VS 2.0a 1215:VS 1.1 652:32 + 64 649:6*2+8*2 626:32 + 64 281:DirectX 266:shaders 186:.nvidia 179:Website 143:rotated 122:Cg/HLSL 83:scholar 3469:Stexar 3466:MediaQ 3463:Exluna 3330:nForce 3288:Jetson 3090:Hopper 3085:Ampere 3080:Turing 3070:Pascal 3060:Kepler 3035:Kelvin 2990:NVLink 2670:Vertex 2648:  2563:Nvidia 2497:Cg FAQ 2464:2003, 2442:  2425:  2349:GitHub 2267:GitHub 1938:25 May 1849:OpenGL 1791:Snes9x 1557:SPIR-V 1526:OpenGL 1224:VS 3.0 1218:VS 2.0 1157:GCN 1+ 1053:PS 1.4 1043:PS 1.3 1037:3Dlabs 1033:PS 1.2 1023:PS 1.1 1013:PS 1.0 329:) and 285:OpenGL 255:Nvidia 245:) and 159:Family 85:  78:  71:  64:  56:  3444:Icera 3419:Ageia 3293:Tegra 3283:Drive 3165:GPGPU 3141:cards 3105:Rubin 3075:Volta 3055:Fermi 3050:Tesla 3045:Curie 2937:VDPAU 2912:PhysX 2906:OptiX 2867:NVDEC 2861:NVENC 2674:pixel 2309:Video 2091:(PPT) 1971:(PDF) 1766:PCSX2 1330:≥ 256 1324:≥ 256 1313:4096 1268:65536 1265:65536 1248:≥ 512 794:4096 710:2 + 8 707:2 + 8 704:2 + 8 701:2 + 6 698:2 + 4 661:65536 635:≥ 512 404:fixed 386:float 327:GPGPU 90:JSTOR 76:books 3303:CPUs 3269:SoCs 3202:Xbox 3197:NV2A 2896:CUDA 2778:800M 2760:NUMA 2687:4 Ti 2672:and 2660:4 MX 2635:TNT2 2440:ISBN 2423:ISBN 1940:2017 1746:OGRE 1734:11.6 1612:Maya 1582:The 1562:The 1553:LLVM 1522:APIs 1496:Yes 1476:Yes 1456:Yes 1433:128 1413:Yes 1373:Yes 1353:Yes 1321:≥ 96 1293:Yes 1262:1024 1145:and 1131:and 1117:and 1103:and 1017:3dfx 1005:Yes 979:Yes 927:Yes 901:Yes 875:Yes 849:Yes 768:Yes 612:Yes 534:5.0 524:2.0b 521:2.0a 410:bool 392:half 306:and 261:for 257:and 231:GLSL 188:.com 149:and 141:and 62:news 3424:ULi 3178:DGX 2984:SXM 2978:MXM 2783:900 2773:700 2749:500 2744:400 2739:300 2734:200 2729:100 2616:NV2 2611:NV1 2506:Cg 2466:doi 2311:on 1662:of 1528:or 1453:Yes 1410:Yes 1393:64 1370:Yes 1367:Yes 1350:Yes 1347:Yes 1344:Yes 1327:256 1290:Yes 1287:Yes 1259:128 1245:256 1242:256 1239:128 924:Yes 921:Yes 898:Yes 872:Yes 866:Yes 846:Yes 840:Yes 817:224 765:Yes 742:No 739:Yes 733:Yes 716:32 658:512 655:512 646:8+4 632:512 629:512 623:8+4 620:8+4 609:Yes 571:6*2 527:3.0 518:2.0 515:1.4 398:int 283:or 38:to 3493:: 2890:Cg 2822:40 2817:30 2793:16 2788:10 2692:FX 2456:, 2452:, 2434:, 2414:, 2410:, 2347:. 2329:. 2265:. 2247:. 2221:^ 2211:. 2196:^ 2186:. 2175:^ 2165:. 2145:^ 2133:^ 2093:. 2072:^ 2062:. 2043:^ 2033:. 2015:. 2004:^ 1993:, 1983:^ 1973:. 1930:. 1912:. 1894:. 1524:: 1493:No 1490:No 1487:No 1484:No 1473:No 1470:No 1467:No 1464:No 1450:No 1447:No 1444:No 1407:No 1404:No 1401:No 1390:24 1387:24 1364:No 1361:No 1341:No 1310:32 1307:16 1304:12 1301:12 1284:No 1281:No 1155:— 1141:— 1127:— 1113:— 1099:— 1089:— 1079:— 1069:— 1059:, 1055:— 1045:— 1035:— 1025:— 1002:No 999:No 996:No 993:No 990:No 987:No 976:No 973:No 970:No 967:No 964:No 961:No 947:No 944:No 941:No 938:No 935:No 918:No 915:No 912:No 909:No 895:No 892:No 889:No 886:No 883:No 869:No 863:No 860:No 857:No 843:No 837:No 834:No 831:No 814:32 811:32 808:32 791:32 788:32 785:22 762:No 759:No 756:No 753:No 750:No 736:No 730:No 727:No 724:No 713:10 606:No 603:No 600:No 597:No 594:No 574:32 465:. 436:. 276:. 239:Cg 217:, 49:. 3228:) 3224:( 3216:) 3212:( 3204:) 3200:( 2724:9 2702:7 2697:6 2655:2 2583:) 2579:( 2555:e 2548:t 2541:v 2528:. 2468:: 2393:. 2379:. 2365:. 2333:. 2315:. 2269:. 2233:. 2127:. 2112:. 2019:. 1942:. 1898:. 1430:4 1427:— 1424:— 1421:— 1384:— 1381:— 805:8 802:8 779:6 776:2 684:4 678:4 675:4 672:4 568:4 554:8 548:8 545:6 542:4 325:( 318:. 215:C 112:) 106:( 101:) 97:( 87:· 80:· 73:· 66:· 43:.

Index


references
primary sources
secondary or tertiary sources
"Cg" programming language
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message

Distortion
transformed
rotated
transparency
reflection
shading language
Developer
developer.nvidia.com/cg-toolkit
Dialects
C
RenderMan Shading Language
GLSL
High-Level Shader Language
shading language
Nvidia
Microsoft
programming
shaders

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑