NVidia announces Cg: "C" for Graphics
mr_sheel writes: "Thresh's FiringSquad has an article about Cg, a new language developed by NVidia in collaboration with Microsoft. 'Up until now,' Brandon Bell writes, 'game developers have had to use complex assembly language to create the lifelike graphics gamers experience in today's latest games.' Cg eases the process of bringing graphics to the screen and compiles for DirectX 8,9 and OpenGL 1.4. Many companies, including 3D Studio Max, Blizzard, and over 100 game developers, have already jumped onto the Cg bandwagon. Will this replace assembly graphics coding once and for all?"
the same as this? http://slashdot.org/article.pl?sid=02/06/13/147213 &mode=nested&tid=126
-- Patience is a virtue, but impatience is an art.
This is the news release that Slashdot actually gets paid for by Nvidia.
Hey Timothy.... go to your preference page and UNBLOCK all CmdrTaco stories.... this way you can see what he posted and not post it yourself.
I know some of his stories suck but it's for the good of all of us.
You can keep Katz stuff blocked.
When slashdot starts picking stories it already scavenged from thereg, linuxtoday, or arstechnica and posted this week already, that means the world is running at slow speed on a sunny Saturday like this one.
PPA, the girl next door
-- I feel better now. Thanks for asking.
Extreme Tech also has an article about Cg.
Because it's about programming the GPU not the CPU... Pixel shaders, vertex shaders, etc. Until now this was always done in assembler.
Milalwi
...that cygwin goes under just in time for cgwin to come out? Conspiracy or coincidence - you decide!
"...in collaboration with Microsoft..."
I just hope that phrase doesn't mean non-DirectX operating systems (Linux, Mac OS X) aren't about to get the short end of the grahics stick. I can visualize features not being implimented for OpenGL, or worse, support for OpenGL discontinued at some strategic point in the future "because our customers strongly prefer DirectX" [says Microsoft].
Ok maybe I'm paranoid. Maybe this is basically nVidia's baby and MS is only involved a little bit. Let's all hope. Can someone reasure me?
You like your Macintosh better than me, don't you Dave? Dave? Can you hear me Dave?
Why make a new language with it's own compiler for this? Wouldn't it make much more sense to make some libraries?
Well if this has been posted before I missed it and am glad I had a chance to read it. Sorry to all you others who are annoyed by the duplication.
The technology seems like a necessary step for the industry. I do graphics programming, although I'm not elite enough to do it in raw assembly.. I have used OpenGL a few times. From the article it does sound like it will be much easier to develop visualization code that is more standard - this would have made working on my Thesis much easier! Oh well, better late than never I guess...
Also the article heavily focused on examples of characters from game environments, it would be nice to see graphics examples of other types of applications besides gaming. For example scientific visualization and similar areas, that is what I'm more interested in that gaming development.
However I am concerned that NVidia won't stay compliant with standards across video cards and things may get ugly in the future. To pull a Microsoft, as it were. I hope not because it sounds like an interesting product that could quickly become dominant if they continue to do things right.
__ No registration required to read this message. They did it in the Matrix.
At flipcode.com
-m
Will this replace assembly graphics coding once and for all?
What on earth are you talking about? This will be a requirement... ALWAYS. You know why? Because nVidia is only one company. Not everyone conforms to their "standards". This is good especially because they are in bed with Microsoft. They are a conduit for MS to control the graphics market as nVidia are up for sale to the highest bidder.
So, what do you do when you want to strengthen control on a market? You introduce a new language that makes it easier for developers to take advantage of one piece of hardware on your platform!
No, this will NOT replace ASM for driver/graphics engine development. It should be disregarded because there's nothing standard about it. Hopefully, the leaders in the industry will always support chipsets other than nVidia's.
Why bother.
From the article:
It may be possible that NVidia is holding back support for such rudimentary language features until such time as they are supported in their own hardware. I don't think this is a formula for a widely-adopted language at all, and smells a little of 3dfx's efforts with Glide.
___
Cogito cogito, ergo cogito sum.
Ok sorry, but if you read the article it clearly states it turns this Cg language into a series of OpenGL or DirectX calls.
Please grab a clue, high performance 3d graphics aren't done in assember. Its done in C with OpenGL calls. The OGL calls are quite high level, nothing as simple as 'put a point at x,y on the screen'. Why do I know? Because I know OpenGL perhaps?
I was going to mod people about but I decided to get out the clue stick instead.
Since Cg is designed specifically for vertex and pixel shader programs, DirectX versions 8 and 9 are supported as well as OpenGL 1.4. The compiler itself is cross platform; in particular programs written for Windows, Linux, Macintosh, and Xbox are supported. And if all that isn't enough, the compiler can create code for all GPUs that support DirectX 8 (or above) and/or OpenGL 1.4, making it very universal. In keeping with Linux tradition, NVIDIA has open-sourced certain components of the compiler, allowing content developers to add their own customizations as well.
It seems pretty clear to me that what you write in Cg is code for the GPU, not the CPU. Perhaps the OpenGL or DirectX calls that are generated are used to download the GPU code into the chip? Then you would use other OpenGL or DirectX calls that you yourself wrote to draw the objects, which are rendered according to the code written in Cg. The article was pretty skimpy on details, but that's the only way it makes any sense to me.
Which was fine while the market was 90% Voodoo, but once other players got more or less established, the benefit of easily developing stuff with GLIDE was overshadowed by the loss of a chunk of your target audience, and the developers moved away from it.
Now imagine, if GLIDE worked on all the competitors' cards, but worked just *slightly* worse than on a Voodoo card. Not enough to be unplayable or anything, but worse nontheless. Then, there's a good chance developers would still use GLIDE, and 3Dfx could claim supperiority on all those products.
However "open" Cg will be, NVIDIA will definitely get the edge on any software written with it, if only because they will have had a head start.
I wonder though if this language is at all similar to GLIDE, which they acquired together with 3Dfx. I also wonder what someone who is very good at low-level graphics programming (like John Carmack) thinks of the idea of this language.
Ñ'
BS.
In Capitalist America, bank robs you!
Ok sorry, but if you read the article it clearly states it turns this Cg language into a series of OpenGL or DirectX calls.
Where?
high performance 3d graphics aren't done in assember. Its done in C with OpenGL calls.
Or DirectX, with calls to handle an assembly language shader. I don't know how OpenGL does it, but under Direct3D, it is quite possible to produce some GPU assembly language programs in ASCII, and get the API to assemble them.
The OGL calls are quite high level, nothing as simple as 'put a point at x,y on the screen'
No, you need to go for this level of complexity:
glBegin(GL_POINTS);
glVertex2f(x, y)
glEnd();
"Same shit, different day."
Arrays use float indices. This is an odd design decision, relevant to DirectX 8 and Nvidia only.
Ummm, what?
I know absolutely nothing about graphics programming. Not ashamed, it's just not my area of specialty. However, I'm intrigued as to why floats would be used for an array index. If anyone can enlighten, I'd be interested to hear.
The official community site is at cgshaders.org. There's a Linux Toolkit out now. There's a interview with CEO David Kirk. Along with articles, a shader repository, and forums for help.
The shocking part about this story is that Thresh's FiringSquad still exists
I'm impressed. This is the second time this has been posted on /., and people are STILL clueless about what Cg is! Incredible!
Cluestick: Cg is not a language like C/C++. It is not an API like OpenGL/DirectX. Instead, it is a simple, high-level replacement for the assembly language traditionally used to program pixel and vertex shader units on graphics cards. These programs are typically a few dozen instructions long and basically map a small set of inputs to a small set of outputs. So you could write a program to rotate a vertex around a point in Cg, but not something like Quake...
A deep unwavering belief is a sure sign you're missing something...
"Console on a stick"
Why just offload rendering to custom hardware, offload physics and ai too!
Perhaps you should look at this before you comment further?
"Writing code for existing Pixel and Vertex Shaders is akin to writing assembly code. Eventually it'll work but it's a laborious, low-level exercise with almost no comprehensibility if someone else works on the code."
Maybe you "know" OpenGL, but have you ever written a pixel or vertex shader?
Milalwi
All of this leaves me a little bit confused. I'm not sure why we need two (or, perhaps, more) C-based shader languages, at least one of which (Cg) is hardware-specific, but API neutral.
If a corporation is a personhood, is owning stock slavery?
It's not like I'm an obsessive reader of /. or anything, but even I noticed that this story has been posted only two days before. Really, you guys are meant to be editors - don't you even read /.? I mean, reposting a story that is a few weeks old is fair enough, but two days? Hell, the old story is still listed on the front page!
Well, thanks for the clarification. It seems like the article might have made that fact more clear, or maybe it was there and I didn't pick out the distinction. So nVidia's Cg is only for the vertex and pixel shaders? I suppose it doesn't provide a high-level api for the rest of the graphics process as I originally thought. Doh.
Too much marketing-speak in the article I guess. Or I'm just dumb.
__ No registration required to read this message. They did it in the Matrix.
You're just making that up, jackass. There is no limit to how short the text is that you query for.
This limitation has little to do with MySQL (besides general poor performance) and everything to do with SlashCode's poorly designed searching facilities.
"I don't know that atheists should be considered citizens, nor should they be considered patriots." - George Bush
You don't need a weatherman to know which way the wind blows.
"In keeping with Linux tradition, NVIDIA has open-sourced certain components of the compiler, allowing content developers to add their own customizations as well."
This is as true as saying:
"In keeping with MS tradition, NVIDIA has closed-sourced certain components of the compiler, but still allowing content developers to add their own customizations as well."
unfinished: (adj.)
With Microsoft involved we will still get the Blue Screen of Death, only now it'll be anti-aliased, vertex shaded, and happen at 400+ fps.
I'm not sure I'll ever fully understand Slashdot.
That is precisely my problem with Cg. It's very limited, aimed specifically at their hardware. Yet graphics hardware is becoming much more generically programmable than this (already was, the PS2 had a more generically programmable pipeline a whole year before Nvidia hit the market with programmable shaders).
All Cg is is the easy bits of C (to make a compiler for) and a bunch of missing stuff with intrinsic functions to do the vector/shader bits. It's just as easily done with a full C/C++ compiler, and already has been by my company.
Surely Cg will be seen for what it is, a short-sighted proprietary system for supporting their hardware from a company with no experience in producing cross-platform high performance vectorizing compilers for game developers.
The game companies that have come out in support of this are all PC/Xbox based obviously. There Cg is basically an easier-to-use authoring tool for the dominating hardware's shader features.
Generic language for computer graphics this is not!
Silicon is cheap. Programmers are not. The point of higher level languages isn't to write faster programs. It's to write programs faster.
Lost: Sig, white with black letters. No collar. Reward if found!