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.
Extreme Tech also has an article about Cg.
User Bio:
Active Open Source bi-geek girl who loves boys with ear-rings and enjoys reading Playboy in the train. I play bass in an all girls band and work in the porn movie industry as an amateur actress to pay for my scholarship. Drop me a line sometime...
Next door to whom exactly?
Saying Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders.
"...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?
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.
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.
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.
Ñ'
"Same shit, different day."
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.
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...
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?
I doubt it's for interpolation. It's easy to average two numbers and pick the midpoint but proper interpolation is a *very* complex subject. To get really good interpolation you need to graph both sides of the data set and extrapolate over the area you're interested in, from both sides. Then where (if) those meet, that's the new value. The farther away you graph from, the smoother the interpolated area.
This is something it might be nice to have a function to do, but if this was done on every array access it's going to be hella-slow.
Not to mention, sometimes you store arrays of things you don't want interpolated. You could interpolate between shades in a pallette, but perhaps you're holding three colors in an array for three effects. Effect one (blood) is red, effect two (slime) is green, etc... If you use floats for integers either you round them to get ints, or you have something that's never exact. So in this case you'd have 1.000003, for instance, and it'd interpolate between the red and green, even though you didn't want that behaviour.
So, for the reason that automatic interpolation between array values is hard to do, and hard to do in a way that you'd want, I don't think they're doing it.
Most likely they're dealing in floats simply because they've got hardware that can deal with floats very quickly, and they trunc or round to get the desired value when using them in an integer context.
You don't need a weatherman to know which way the wind blows.
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.
Geez! You got + karma out for just posting my bio and asking a quest on my sig.
;-))
That's total copyright infrigement.
PPA, the girl next door.
-- I feel better now. Thanks for asking.