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.
Didn't we just see this here a couple of days ago?
I'm an American. I love this country and the freedoms that we used to have.
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
You know, Cg may seem attractive, but game developers who really know their stuff will probably stick to assembly. Or, alternatively, use Cg in parts a a game but use assembly where it counts.
The ability to monopolize an industry is insignificant, next to the power of the source.
timothy should have his post deleted and his account banned for repeated double-posting. It's like he's spamming us!
...that cygwin goes under just in time for cgwin to come out? Conspiracy or coincidence - you decide!
Yeah, why Microsoft would have anything to do with those patent infringers, I don't know.
I have been pwned because my
"...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.
It's not a disincentive to non-MS-based game developers.
Do you even lift?
These aren't the 'roids you're looking for.
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.
Is this a new "language" or is is a library. What does this do that GL or DirectX cannot? I personally don't see a need for this when we have OpenGL and to a lesser respect DirectX (cause there isn't a *nix implementation).
I want my rights back. I was actually using them when our government stole them after 9/11.
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.
> I was going to mod people about but I decided to get out the clue stick instead.
Why don't you give yourself a good whack.
Pixel Shaders are an extension to OpenGL and DirectX that allow you to load a small gpu assembly routine into the hw. The point of Cg is to write pixel shaders in a c-like language that gets translated into the ogl/dx gpu assembly routines. This lets the programmers focus on the higher level details, rather than worrying about when which register can be used.
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."
Assembly will always be faster than a compiled language. That's just one of those immutable laws. It's the way the universe is put together.
Many companies, including 3D Studio Max
3D Studio MAX is a product, not a company. Discreet is the name of the company currently making MAX, a subsidiary of Autodesk
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.
Sigh... you guys don't see the irony here, do you?
My life in the land of the rising sun.
You truly rock.
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
If you know so much about pro game developers, you must be one yourself. Oh but wait, you're hanging out on a community site. I'm confused.
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
It's not a disincentive to non-MS-based game developers.
Why not? looks like it is a windows-only technology to me. After all, it uses DirectX. True, it also claims to use OpenGL, but while OpenGL is cross-platform, the compiler in the article is not.
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?
Well, sure, but who chose to use mySQL?
Trees can't go dancing
So do them a big favor
Pretend dancing stinks!
3d Studio Max isnt a company....its a software package developed and distributed by Discreet (www.discreet.com).
Honestly, you'd be better off just hiring saintlupus to bitch about the government and ramble on about nutmeg than to keep going like this. I mean, do you even care? This place is going to end up like Steve Miller; a couple of hits and a lifetime of wasted potential. That's right... I just compred Slashdot to Steve Miller. Sad thing is, I bet that wouldn't even embarass the sloppy taco club. :/
For a successful technology, reality must take precedence over public relations, for nature cannot be fooled - R Feynman
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!
No, 'g' is for Graphics, 'C' is for C.
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.
C for graphics, eh?!?!? That's the dumbest thing I ever heard. Want fast graphics? Code that shit in tight assembly, utilizing all kinds of special processor tricks earned through many years of hard-core determination in squeezing every last cycle out of the hardware, and then some. I don't care if it takes a year to implement something that could be implemented in a day using this Cg or Gc or whatever it's called. The market is a piece of shit, don't pay attention to it. I don't care that people want shit now. Management is irrelevant. Customers are irrelevant. Do it right. Do it in assembly. And when it comes time to port that shit to another platform, you'll have to write it all over again, because assembly language is as portable as a coal mine. (Ever tried to move one?) And that's the way Real Programmers (tm) do it, like Mel, not wimps like you. C is for wimps.
"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.)
Thats what the CPU is for. Until recently we havent been able to have better AI or physics because the CPU was busy with The lighting and transform.
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!
Milalwi is right... Cg gets compiled into GPU assembly code along with the necessary C-language OpenGL (NVIDIA's compiler) and Direct3D (Microsoft's generic compiler) to download the shaders to the GPU. It is so easy to download and read about what Cg will really do (and not do). I will never understand why people don't do that first before running at the mouth.