A portable, higher level language for programming the GPU was needed, so Cg was created to overcome these problems and make shader development easier. Although using the assembly language gave the programmer complete control over code and flexibility, it was fairly hard to use. In the beginning, vertex and pixel shaders were programmed at a very low level with only the assembly language of the graphics processing unit. To simplify the process, new features were added to graphics cards, including the ability to modify their rendering pipelines using vertex and pixel shaders. DirectX 12 (Shader Model 6.3) introduced ray tracing shaders (ray generation, intersection, bit /closest hit / miss).ĭue to technical advances in graphics hardware, some areas of 3D graphics programming have become quite complex.DirectX 11 (Shader Model 5) introduced compute shaders ( GPGPU) and tessellation shaders (hull and domain).DirectX 10 (Shader Model 4) and Cg 2.0 introduced geometry shaders.The Cg/HLSL language originally only included support for vertex shaders and pixel shaders, but other types of shaders were introduced gradually as well: HLSL shaders can enable many special effects in both 2D and 3D computer graphics. Nvidia's cgc was deprecated in 2012, with no additional development or support available. Two main branches of the Cg/HLSL language exist: the Nvidia Cg compiler (cgc) which outputs DirectX or OpenGL and the Microsoft HLSL which outputs DirectX shaders in bytecode format. Cg/HLSL is based on the C programming language 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 graphics processing units. Cg (short for C for Graphics) and High-Level Shader Language (HLSL) are two names given to a high-level shading language developed by Nvidia and Microsoft for programming shaders.
0 Comments
Leave a Reply. |