-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
cg.scroll
64 lines (55 loc) · 2.5 KB
/
cg.scroll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import ../code/conceptPage.scroll
id cg
name Cg
appeared 2003
tags pl
standsFor C for Graphics
fileType text
wordRank 7928
centralPackageRepositoryCount 0
country United States
originCommunity Nvidia
reference https://arxiv.org/pdf/cs/0302013.pdf
lineCommentToken //
hasLineComments true
// A comment
hasComments true
// A comment
hasSemanticIndentation false
wikipedia https://en.wikipedia.org/wiki/Cg_(programming_language)
example
// input vertex
struct VertIn {
float4 pos : POSITION;
float4 color : COLOR0;
};
// output vertex
struct VertOut {
float4 pos : POSITION;
float4 color : COLOR0;
};
// vertex shader main entry
VertOut main(VertIn IN, uniform float4x4 modelViewProj) {
VertOut OUT;
OUT.pos = mul(modelViewProj, IN.pos); // calculate output coords
OUT.color = IN.color; // copy input color to output
OUT.color.z = 1.0f; // blue component of color = 1.0f
return OUT;
}
related c opengl unity-engine
summary Cg (short for C for Graphics) is a high-level shading language developed by Nvidia in close collaboration with Microsoft for programming vertex and pixel shaders. Cg is based on the C programming language and although they share the same syntax, some features of C were modified and new data types were added to make Cg more suitable for programming graphics processing units. This language is only suitable for GPU programming and is not a general programming language. The Cg compiler outputs DirectX or OpenGL shader programs. Since 2012, Cg was deprecated, with no additional development or support available.
pageId 390212
dailyPageViews 189
created 2003
backlinksCount 122
revisionCount 233
appeared 2012
hopl https://hopl.info/showlanguage.prx?exp=6204
tiobe cg
isbndb 5
year|publisher|title|authors|isbn13
2003|Addison-Wesley Professional|The CG Tutorial: The Definitive Guide to Programmable Real-Time Graphics|Fernando, Randima and Kilgard, Mark J.|9780321194961
2006|Springer|Computers and Games: 4th International Conference, CG 2004, Ramat-Gan, Israel, July 5-7, 2004. Revised Papers (Lecture Notes in Computer Science, 3846)||9783540324881
2008|Springer|Computers and Games: 6th International Conference, CG 2008 Beijing, China, September 29 - October 1, 2008. Proceedings (Lecture Notes in Computer Science, 5131)||9783540876076
2011||Cg (programming Language)|Frederic P. Miller|9786135608311
20121212|Taylor & Francis|Essential CG Lighting Techniques with 3ds Max|Darren Brooker|9781136138935