Slashdot Mirror


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?"

176 comments

  1. Isn't this by mcspock · · Score: 5, Informative
    --
    -- Patience is a virtue, but impatience is an art.
    1. Re:Isn't this by Anonymous Coward · · Score: 2, Informative

      Yep. Nothing to see here, folks. These aren't the droids you're looking for. Move along.

    2. Re:Isn't this by mobets · · Score: 1, Insightful

      Hmmm. Maybe he meant to post a story about QuakeCon. Registration started last night.

      --

      It was me, I did it, I moved your cheese
    3. Re:Isn't this by RAMMS+EIN · · Score: 1

      Good I'm not the only one who's suffering from :-| :-|

      --
      Please correct me if I got my facts wrong.
  2. Complex assemly language? by bsDaemon · · Score: 0

    then how come I'm always seeing C and C++ bindings for OpenGL and engines, and books about writing games in C or C++? I've never seen "writing spifftactic 3d games in x86 assembler".

    1. Re:Complex assemly language? by Milalwi · · Score: 2

      then how come I'm always seeing C and C++ bindings for OpenGL and engines, and books about writing games in C or C++? I've never seen "writing spifftactic 3d games in x86 assembler".

      Because it's about programming the GPU not the CPU... Pixel shaders, vertex shaders, etc. Until now this was always done in assembler.

      Milalwi
    2. Re:Complex assemly language? by synx · · Score: 2

      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.

    3. Re:Complex assemly language? by SirRichardPumpaloaf · · Score: 2, Informative

      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.

    4. Re:Complex assemly language? by Anonymous Coward · · Score: 0

      This layer isn't needed at all. It's absurd the way Slashdot (and NVIDIA?) is portaying this.

      The only good thing I can see from this is if Windows programmers start using it, it takes Direct3d out of the equation, so ports can be "compiled" to OpenGL.

      I just hope it's documented so that a free UNIX "compiler" can be written.

    5. Re:Complex assemly language? by Anonymous Coward · · Score: 1, Informative

      > 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.

    6. Re:Complex assemly language? by colmore · · Score: 2

      BS.

      --
      In Capitalist America, bank robs you!
    7. Re:Complex assemly language? by 91degrees · · Score: 2, Informative

      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();

    8. Re:Complex assemly language? by Anonymous Coward · · Score: 0

      Mod this fucktwit down. Fucking dumbass.

    9. Re:Complex assemly language? by Anonymous Coward · · Score: 0

      Hehe. You said "give yourself a good whack."

    10. Re:Complex assemly language? by Milalwi · · Score: 3, Interesting

      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?


      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
  3. Yes and No by systemapex · · Score: 5, Funny

    This is the news release that Slashdot actually gets paid for by Nvidia.

  4. deja vu all over again by frovingslosh · · Score: 1, Redundant

    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.
    1. Re:deja vu all over again by flewp · · Score: 1

      I always find it funny when there's people repeating the "didn't we see this already?"

      Kind of ironic, isn't it?

      --
      WWJD.... for a Klondike bar?
    2. Re:deja vu all over again by Anonymous Coward · · Score: 0

      How was it deja vu last time?

    3. Re:deja vu all over again by ComaVN · · Score: 1

      Because repeated stories happen a lot here maybe?

      --
      Be wary of any facts that confirm your opinion.
    4. Re:deja vu all over again by frovingslosh · · Score: 1
      I always find it funny when there's people repeating the "didn't we see this already?"

      Well, to you and the person who moderatd me down, let me explain something that you don't grasp. The original post was a 1:59. I saw it at 2:00. There were no other responses of this nature posted when I looked, and I did. But in the seconds I was typing my short post, previewing it and posting it, several others made similar observations. It happens. Get over it.

      Perhaps the fact that you always find it funny indicates that the problem (duplicated original posts) happens often enough that it indeed should be mentioned.

      --
      I'm an American. I love this country and the freedoms that we used to have.
  5. Slashdot has new programming language - CAgain by cmorriss · · Score: 0, Redundant
    Certain articles are automatically shown again just in case you missed them the first time.

    --
    10 minutes working on a sig. What a waste.
  6. Inefficiencies by Anonymous Coward · · Score: 0

    One of these days, nVidia will ship a GPU whose functionality is a proper superset of that of a traditional CPU and then we can ditch the CPU entirely. Just like MMX, but backwards. This is a a recognized law of engineering. At that point, Cg will have to become a "real" compiler. Let's hope nVidia is up to the task...

    1. Re:Inefficiencies by Toraz+Chryx · · Score: 2

      "Console on a stick"

      Why just offload rendering to custom hardware, offload physics and ai too!

    2. Re:Inefficiencies by LoRdTAW · · Score: 1

      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.

    3. Re:Inefficiencies by Lurks · · Score: 2
      At that point, Cg will have to become a "real" compiler. Let's hope nVidia is up to the task...

      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!

  7. Hey Timothy! by cp4 · · Score: 5, Funny

    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.

    1. Re:Hey Timothy! by lient · · Score: 0

      Hey look on the bright side. At least the polls aren't reposted, right?

    2. Re:Hey Timothy! by Anonymous Coward · · Score: 0

      Timothy always posts the dumbest shit this side of Beijing. I can't believe they PAY that nincompoop to work at /.

  8. Reg piece on the same by Anonymous Coward · · Score: 0

    A decent theregister piece on the same - tho i'm
    not sure i agree that having reserved words such as
    'break' and 'continue' necessarily indicates planned
    future incompatibilities of any kind (i'd reserve
    those words no matter what kind of language it was)
    - check it out at http://www.theregister.co.uk/content/54/25732.html

  9. No news good news. by pinkpineapple · · Score: 2

    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.
    1. Re:No news good news. by JPriest · · Score: 5, Funny
      The girl next door?

      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.
    2. Re:No news good news. by Anonymous Coward · · Score: 0

      I hope to me. =D

    3. Re:No news good news. by larry+bagina · · Score: 0, Troll
      Dear Ms. pink pineapple,

      I just want to let you know that I love pineapples. I could eat a pineapple for hours!

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    4. Re:No news good news. by 0xdeadbeef · · Score: 2, Funny

      Drop me a line sometime...

      A bass player? Pshaw, as if.

    5. Re:No news good news. by Anonymous Coward · · Score: 0

      It's just a guy who posts (moderately well-written) flamebait.

    6. Re:No news good news. by Anonymous Coward · · Score: 0

      Talk about the story, not the site that posts it. Whining about the latter makes you look very stupid and petty.

    7. Re:No news good news. by Night0wl · · Score: 1

      What I want to know is, how can we drop her a line? It's just not fair. We're not even given the opportunity to interact here.

      How about you drop me a line? Pink Fruit Person...

      --
      Computational Madness in a round package.
    8. Re:No news good news. by pinkpineapple · · Score: 3, Funny

      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.
    9. Re:No news good news. by Hektor_Troy · · Score: 2

      Look on the bright side:
      - ...

      damn ... can't think of a bright side. Btw - what the hell is a "pink pine apple"?

      Oh - and if you're looking for a one night stand, I'm not your guy.

      --
      We do not live in the 21st century. We live in the 20 second century.
    10. Re:No news good news. by torpor · · Score: 2

      Oh - and if you're looking for a one night stand, I'm not your guy.


      He might not be, but I am.

      --
      ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
    11. Re:No news good news. by Anonymous Coward · · Score: 0

      > what the hell is a "pink pine apple"?

      Ok - I want you to think about what she does to pay her way through college (just to get you in the right mindset) and then think about a piece of female anatomy.

      (P.S. It doesn't rhyme with 'Deloris' but you'd be pretty warm...)

  10. Another article by purepower · · Score: 3, Informative

    Extreme Tech also has an article about Cg.

  11. redundant story by lingqi · · Score: 0, Redundant

    http://slashdot.org/article.pl?sid=02/06/13/147213 &mode=thread&tid=126

    --

    My life in the land of the rising sun.

    1. Re:redundant story by Anonymous Coward · · Score: 0

      And this, moderators, is a prime example of a redundant comment.

  12. Assembly ain't going anywhere by Captain+Smooth · · Score: 1

    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.
    1. Re:Assembly ain't going anywhere by Anonymous Coward · · Score: 0

      Cg will allow for more portability, I think. The whole reason people want to get away from assembly is that it's very platform/hardware specific. If this is what I think it is, Cg will bring us one step closer to having games that can run on multiple platforms very easily.

    2. Re:Assembly ain't going anywhere by Anonymous Coward · · Score: 0

      Nobody other than driver programmers ever use assembly for game graphics these days... They all use OpenGL and DirectX, etc., which do the dirty work for them.

    3. Re:Assembly ain't going anywhere by Anonymous Coward · · Score: 0

      It looks like some clarification is in order.
      From NVidia's cg site:
      "The NVIDIA Cg Compiler outputs standard Vertex and Pixel Shaders..."
      Cg is not a replacement for C, C++, OpenGL, DirectX or any other programming language or API, it's just an alternative to the assemby style shaders of DirectX 8 and NVidia's own OpenGL extensions.

      Now if you want to get riled up, you should be aware that there is a MUCH more flexable proposal for a shader language as part of the OpenGL 2.0 proposals. Of course, we will not have that for some time yet.

    4. Re:Assembly ain't going anywhere by Anonymous Coward · · Score: 0

      Just like they stuck with assembly over C? Hell, many game developers have moved from assembly all the way past C, to C++ (carmack for example). Compilers are just that good nowadays.

      If I was given the option of using a language that worked on all major graphics hardware, for directx and openGL, on all major platforms, or option of writing several versions of my shader code by hand, for the chance at a slight speed increase, I wouldn't have much trouble choosing.

    5. Re:Assembly ain't going anywhere by LinuxInDallas · · Score: 1

      I'm not an expert in graphics programming but I do some firmware and programmable logic for 8-bit micros. I thought that today it was generally accepted that compilers for intel machines and similar CPUs had advanced to the point where they were able to produce assembly that was more or les on par with hand written assembly. Is this not true?

      Asembly for an 8-bit micro with les than 100 instructions isn't a hard thing to grasp...but more complex CPUs have hundred and hundreds of inctructions. It must be nearly inpossible for someone to always knmow they are using the best instructions/sequence of instructions to perform a given task.

    6. Re:Assembly ain't going anywhere by MisterBlister · · Score: 1

      Not entirely true. There's still a fair bit of assembly lurking in modern high-end games, but its generally NOT standard (x86/PPC/whatever) code, its vector processor code eg. AltiVec, MMX/SSE/SSE2, PS2 VU...

    7. Re:Assembly ain't going anywhere by Charm · · Score: 1
      No people this is about programming the vertex and pixel shaders in assembly not the CPU. Because the shaders are new there is no OpenGL, DirectX way of programming them. So people wrote assembly code for them. Assembly for the pixel shader. Now Nvidia has created a programming language for programming shaders.

      This has nothing to do with writing x86 assembly to make a game go faster.

      --
      -- RTFM:Slackware::Beer:Saturday
  13. Abuse! by Luminair · · Score: 1

    timothy should have his post deleted and his account banned for repeated double-posting. It's like he's spamming us!

  14. already posted by Anonymous Coward · · Score: 0

    yeah this post should be deleted

  15. Microsoft? by YahoKa · · Score: 0

    The part about in collabotation with Microsoft is a bit worrysome :\ Although, i don't really know much about this.

    1. Re:Microsoft? by ObviousGuy · · Score: 1

      Yeah, why Microsoft would have anything to do with those patent infringers, I don't know.

      --
      I have been pwned because my /. password was too easy to guess.
    2. Re:Microsoft? by larry+bagina · · Score: 1
      This would be a good thing for MS, since it ould be easier to develop indows and xbox game. If they have it standardized (ala C# and ECMA/Javascript), it shouldn't orry anyone.

      It's not a disincentive to non-MS-based game developers.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    3. Re:Microsoft? by rifter · · Score: 1, Redundant

      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.

  16. Isn't it interesting... by kenthorvath · · Score: 2

    ...that cygwin goes under just in time for cgwin to come out? Conspiracy or coincidence - you decide!

    1. Re:Isn't it interesting... by Anonymous Coward · · Score: 0

      How can GPL'd code "go under"?

    2. Re:Isn't it interesting... by Anonymous Coward · · Score: 1, Funny

      That means that the developers have moved to Australia! *drumroll*

      Thank you, thank you very much.

    3. Re:Isn't it interesting... by Anonymous Coward · · Score: 0

      When the only people working on it quit and go work on another project?

    4. Re:Isn't it interesting... by Anonymous Coward · · Score: 0

      But the code is still out there for anyone that wants to to hack on.

      Besides... Cygnus is still around! Aren't they?

    5. Re:Isn't it interesting... by istartedi · · Score: 2

      The operative word here is wants to hack on. Sure, there are lots of people who want to use it, but how many are there with the time, the ability, and the desire to maintain it?

      Cygnus, BTW, is now a division of RedHat.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  17. MS Mistrust by feldsteins · · Score: 3, Interesting

    "...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?
    1. Re:MS Mistrust by hackman · · Score: 2

      I'm with you on the mistrust, I'm worried about nVidia using conventional MS practices or being dominated by their "partner" Microsoft. I do like nVidia, and love their graphics cards but this plants a little seed of doubt for the future. Hmm.

      I wish I could tell you that wouldn't happen, but it seems to me that it is somewhat likely down the road.

      or worse getting taken over by Microsoft.

      --
      __ No registration required to read this message. They did it in the Matrix.
    2. Re:MS Mistrust by jpt.d · · Score: 2, Funny

      nVidia doesn't make graphics cards, they make graphics chips. Its like saying Linux is an operating system.

      --
      What we see depends on mainly what we look for. -- John Lubbock Now search for that bug slave!
    3. Re:MS Mistrust by sgtsanity · · Score: 1

      My guess would be that Nvidia originally started looking into this as a tool to help developers use the full power of the Xbox. Being that the Xbox was a partnership with Microsoft, this would be too.

    4. Re:MS Mistrust by Anonymous Coward · · Score: 0

      >My guess would be that Nvidia originally started looking into this as
      >a tool to help developers use the full power of the Xbox. Being that
      >the Xbox was a partnership with Microsoft, this would be too.
      >
      Given that the XBox has pretty much turned out to be a dud, there's
      every reason to expect that this will too. Rather doubt you'll see a
      PS2 or GameCube port of this crap, and that's what really matters.

    5. Re:MS Mistrust by hackman · · Score: 2

      Yes, you are technically correct. What I meant was that I like cards that use nVidia chips. Since it's the core of the graphics system it's more akin to describing a computer as a "Pentium" which isn't correct but is certainly is a common usage.

      And Linux is technically a kernel not an OS, but 95% of the time I hear the word it's referred to as an OS.

      So what is your point?

      --
      __ No registration required to read this message. They did it in the Matrix.
    6. Re:MS Mistrust by njet · · Score: 1

      http://slashdot.org/articles/99/04/09/1516203.shtm l

    7. Re:MS Mistrust by spectecjr · · Score: 0, Troll

      Given that the XBox has pretty much turned out to be a dud, there's every reason to expect that this will too. Rather doubt you'll see a PS2 or GameCube port of this crap, and that's what really matters.

      Awww... whassamatter baby? Jealous because you bought a crappy console and are trying to justify your choice on Slashdot?

      Tell ya what... go buy an XBox. You'll feel better.

      --
      Coming soon - pyrogyra
    8. Re:MS Mistrust by fferreres · · Score: 3, Interesting

      Nvidia = Microsoft since the begining. I can say that because I know them since the NV1 (1995 i think), which I own.

      They where virtually killed by 3Dfx many times yet someone kept pumping money from "somewhere" for them. The only change in focus after their failure this: target for Direct3D.

      They kept pumping money and money and selling at a loss until they bough 3Dfx. Most other players where dead already (rendition and many others) dead by then. Now they control the market with Microsoft by their side. Microsoft was always against 3Dfx, they direct3D was never "friendly" with 3Dfx cards (though it worked fine, features where really targeted for Nvidia cards).

      It's like Nvidia and Microsoft developed direct3D. It's not a coincidence. Microsoft would never enjoy a monopolistic provider in a key market unless they own/control it somehow (and no, you don't need Microsoft puting money directly to own it. There are a thouthand ways to own something in an unnoticed fashion).

      Remark: i know Nvidia cards are the best and excelent ones! This has nothing to do with it :) The 3D market history is full of "black holes" which you just can't understand well without some conspiracy.

      --
      unfinished: (adj.)
    9. Re:MS Mistrust by sbaker · · Score: 1

      You can download the Linux version of Cg now...
      so at least they appear to be telling the truth
      about that. There was also a comment somewhere
      about them OpenSourcing Cg sometime soon.

      This doesn't appear to have the long shadow
      of Microsoft cast over it.

      --
      www.sjbaker.org
    10. Re:MS Mistrust by Anonymous Coward · · Score: 0

      Nvidia might like to get into the Movie rendering business which has gone on to Linux they might want to keep the Linux option open.

    11. Re:MS Mistrust by Charm · · Score: 1

      Linux is an operating system. Just because it has no user interface does not make it not an operating system. It still controls how programs interact with the hardware.

      --
      -- RTFM:Slackware::Beer:Saturday
  18. game developers who really know their stuff... by BlackTriangle · · Score: 0

    Probably consider Assembly language fools gold.

  19. YAWN by Anonymous Coward · · Score: 0

    Slow news day.

    Slashdot, home of historically old news. News for oldies.

  20. Why? by dhaberx · · Score: 2, Insightful

    Why make a new language with it's own compiler for this? Wouldn't it make much more sense to make some libraries?

    1. Re:Why? by Anonymous Coward · · Score: 0

      This supposedly would give a common interface, I guess... If you made libraries (which by the way, already exist: OpenGL, DirectX, etc.), you'd still need to rewrite the interface code for each chipset.

    2. Re:Why? by dhaberx · · Score: 1

      Even this way someone still needs to do that. A library gives a common interface and can support multiple chipsets and be upgraded to support newer chipsets. If they made a library people could implement it in their already existing programs and keep their styles of programming similiar in their newer works. I'd be curious to see some code from cg. I'm just worried that the language and compiler may have limitations.

    3. Re:Why? by dhaberx · · Score: 1

      I guess my worrying isn't that off
      check out this message.

    4. Re:Why? by Anonymous Coward · · Score: 0

      Well, the worrying done by the article linked in that message sure is.

    5. Re:Why? by talonyx · · Score: 1

      I'm sure the Ph.D's at Nvidia thought about that, and disregarded it. Pretty arrogant for a bunch of Slashbots to second-guess the cream of the crop...

  21. Good stuff! by hackman · · Score: 2

    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.
    1. Re:Good stuff! by KewlPC · · Score: 2, Insightful

      ENOUGH!

      This has nothing to do with raw x86 assembly! This isn't doing graphics programming in raw assembly!

      There is an assembly-like language for writing vertex and pixel shaders on nVidia and ATI GPUs. Your entire program could be nothing but high-level calls to DirectX 8 or OpenGL 1.4 in C++, but if you want to take advantage of the ability of the Geforce3, Geforce4 (but not Geforce4 MX), and recent ATI cards, to do custom pixel and vertex shaders, you have to write said pixel and vertex shaders in a small assembly-like language, and use DirextX or OpenGL calls to load them into the GPU. These shaders get used by the card's GPU, and has absolutely nothing to do with the CPU.

      The idea here is that instead of writing your pixel or vertex shaders in something similar to assembly (again, it *ISN'T* assembly), you can write them in something similar to C, and the Cg compiler will compile your shaders into machine code for the GPU (Graphics Processing Unit; it's on the GeForce3, GeForce4 (but not GeForce4 MX), and recent ATI cards), not the CPU!

      Writing shaders in this assembly-like language for the GPU is nothing like trying to do graphics in x86 assembly back in the day, ok?

  22. A contrarian view! by thammoud · · Score: 0
  23. See what some game developers think by magic · · Score: 4, Insightful
  24. What Are You Talking About? by Lethyos · · Score: 3, Insightful

    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.
    1. Re:What Are You Talking About? by Webmonger · · Score: 2

      Sure it's non-standard-- except that it works with ATI cards. Doh!

    2. Re:What Are You Talking About? by Anonymous Coward · · Score: 0

      Why do ignorant comments like this get modded to Insightful? The poster is either a troll or didn't read the article. (Clarification: Cg exists to make writing [efficient] vertex and pixel shaders easier and more portable across graphics cards supporting DX8+ and probably as a stopgap until OpenGL 2.0 as far as the OpenGL world is concerned.)
      Anyone who posts something that bitches about the corporate world gets points on /. regardless of the truth of their statements.

    3. Re:What Are You Talking About? by liquidsin · · Score: 4, Insightful

      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.

      Do you even read articles? How did you get modded insightful? Do moderators read articles?

      --
      do not read this line twice.
    4. Re:What Are You Talking About? by fferreres · · Score: 4, Interesting

      Do you even read articles? How did you get modded insightful? Do moderators read articles?

      Yes, I think they do read them. There's nothing in the article that contradicts what he says. Actually, Nvidia IS IN BED with Microsoft. 3Dfx was not and got killed. 3DLabs was not and suffered.

      If it werent't for Id, i'd say OpenGL will be dead right now and you would not be able to play any 3D games but loading Windows.

      Now, all this can sound unsound, but if you really followed what happened in the 3D world since 1995 you will notice it's not a crazy idea.

      Microsoft needs the games to run under Windows and XBox, and to NOT run on any other plataform. This is as true as the sky is blue. So the original poster does have a valid point with I'd mod as Insightfull any day.

      --
      unfinished: (adj.)
    5. Re:What Are You Talking About? by fferreres · · Score: 2

      My god how naive :( ... I'm not trolling. I'm just suggesting to pay a little more attention to this kind of stuff, so that we can prevent having unstopable monopolies as a result.

      Do you think this Cg will take most out of ATI cards? Do you think ATI likes it or it's a good thing for them? Why did Nvidia developed this thing with Microsoft help? Why wasn't ATI there? Why weren't Matrox and 3Dlabs invited?

      It may be compatible for ATI cards as in beer, not as in freedom. And that beer will probably taste like you don't want a second round.

      This can only hurt 3D card makers and promote Nvidia. Mirosoft ins making sure they can control it at a software level rather than a hardware level. It's the only way they have to lock you and control the market. Just like the control OEM bundling, and everything in the PC industry.

      Don't complain in the future unless you can have some vision of that are the consecuences of some "innovations".

      --
      unfinished: (adj.)
    6. Re:What Are You Talking About? by Anonymous Coward · · Score: 0

      Because this is slashdot, and any slashbot that says something negative about big corporations or Microsoft is instantly modded up.

      It's called group-think, and it's why Slashdot is a joke.

    7. Re:What Are You Talking About? by fferreres · · Score: 2

      Mh, again and again...

      The problem is not against "writing [efficient] vertex and pixel shaders easier and more portable across graphics cards", the problem is about Microsoft and NVidia controlling the "writing [efficient] vertex and pixel shaders easier and more portable across graphics cards" for the good and benefit of all society.

      It doesn't matter how much times you read the articule...this is just obvious. Unless it's a standard with representation, then it's bad for you and me (unless we own certain stock).

      --
      unfinished: (adj.)
    8. Re:What Are You Talking About? by Webmonger · · Score: 2

      The thing is that everything that Nvidia's said sounds like they don't intend to play that game. Most of these comments are the "knee-jerk-haven't read-the-article" level.

      Proprietary standards are not a bad thing when there are no open standards. In fact, many standards bodies look to current practice for examples of standards. If everyone waited for standards, there would be fewer (or worse) standards. And for a proprietary standard, this one seems pretty open.

      I understand that Nvidia has been heavily involved in the creation of the suspiciously-similar OpenGL 2.0. Their release of Cg will give them useful information for refining the standard. It's also a solid pragmatic decision-- since many people are using Direct3D, they can either laugh and point at them or release something similar to OpenGL 2.0 that works with Direct3D. It also gets the tools to people now, rather than when OGL 2 is done.

      The release of Cg could have the benefits I describe, or it could be as bad as you suggest. At this time, I don't think there's enough reason to think either one of them's true.

    9. Re:What Are You Talking About? by Vulture_ · · Score: 1
      The thing is that everything that Nvidia's said sounds like they don't intend to play that game. Most of these comments are the "knee-jerk-haven't read-the-article" level.
      And you actually expect a company like nVidia to stand by their words? That'd be like Bill Gates donating to the EFF. Fat chance, captain.
      --

      The only way the typical /.er can pick up a chick is with a forklift. -- AC

    10. Re:What Are You Talking About? by Vulture_ · · Score: 1
      Maybe I need to clarify:
      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 NVIDIA 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, provided their customizations only work with NVIDIA hardware and do not enable any of the components to work with non-NVIDIA hardware.
      --

      The only way the typical /.er can pick up a chick is with a forklift. -- AC

    11. Re:What Are You Talking About? by boto · · Score: 1

      And I'm still wondering where assembly is required, when using a graphic library/layer such as DirectX or OpenGL. The "hard work" is all done by the library (or by something below the library, by the graphics card, or by processor specific fetures [that the library is already supposed to use]).

  25. This wouldn't happen... by Anonymous Coward · · Score: 0

    if Timothy could search Slashdot for "Cg", but words under four characters are not indexed. This is extremely idiotic, as we can't search *any* 3-letter acronyms or even "red hat". Gee, if CmdrTaco doesn't want people to be searching for "the" "it" "a"... then by all mean block these words but block these words *only*.

    1. Re:This wouldn't happen... by darken9999 · · Score: 0
      Welcome to the world of mySQL. Full-text queries can only be done on four or more letter words. It has nothing to do with Slashcode or CmdrTaco.

      In short it's not Taco's fault. Weird, I know. ;^)

    2. Re:This wouldn't happen... by Cuthalion · · Score: 1

      Well, sure, but who chose to use mySQL?

      --
      Trees can't go dancing
      So do them a big favor
      Pretend dancing stinks!
    3. Re:This wouldn't happen... by Anomolous+Cow+Herd · · Score: 2
      Full-text queries can only be done on four or more letter words.

      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
    4. Re:This wouldn't happen... by johnathan · · Score: 3, Interesting

      Full-text queries can only be done on four or more letter words.

      You're just making that up, jackass. There is no limit to how short the text is that you query for.

      Not so, it turns out. From that very page:
      MySQL uses a very simple parser to split text into words. A ``word'' is any sequence of characters consisting of letters, numbers, `'', and `_'. Any ``word'' that is present in the stopword list or is just too short (3 characters or less) is ignored.
      --
      You don't need a weatherman to know which way the wind blows.
  26. Why it won't work (link) by Space+Coyote · · Score: 4, Interesting
    There's an interesting editorial at The Register pointing out some of the flaws in Cg, and speculating about NVidia's intention for future development of the language as it relates to their core graphics hardware busines.

    From the article:

    • No break, continue, goto, switch, case, default. These are useful features that can be used without penalty on other vector processors.
    • No pointers. This is Cg's most serious omission. Pointers are necessary for storing scene graphs, so this will quickly become a serious omission for vector processors that can store and process the entire scene or even sections of it.
    • No integers. This may be appropriate to NVIDIA, but is not a universal design decision.
    • Arrays use float indices. This is an odd design decision, relevant to DirectX 8 and Nvidia only.

    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.
    1. Re:Why it won't work (link) by be-fan · · Score: 2

      Its interesting the top two grips (no break and no pointers) are totally irrelevent to shaders. We're not talking generic vector processors here, but specifically vertex and pixel shaders. Current shaders don't do conditionals, and they don't process sections of a scene. They get a few floats as input (vertex coordinates and normals) and produce a few numbers as output.

      --
      A deep unwavering belief is a sure sign you're missing something...
    2. Re:Why it won't work (link) by donglekey · · Score: 5, Insightful

      Whomever wrote that article may understand 3D, but doesn't understand where shaders fit in and the history and experience already here. Pixel and Vertex shaders have been around since the inception of commercial 3D in the form of Renderman surface and displacement shaders. They are small and very modular programs which don't need access to a large amount of information at one time. Thus because of the implied modularity, and the isolation of the calculations relative to the rest of the scene there is no need for OO (I know you didn't mention it, but someone in the FIRST story about this did, and its a good question), and no real need for pointers.

      Furthermore because of the very analog nature of what is being descibed, control statements and desicion shortcuts aren't a very big deal. Of course there are if else statements, but they are not used as much as simple and very general algorithms. Hard desicions lead to aliasing, because they rule out a gradual change. Also because of the analog nature of what is being reproduced integers are used very rarely, almost exclusivly for loop counters.

      Using float indices for arrays is a kick ass design descision. It allows for smooth and elegant interpolation between discreet values, and I can't stress what a cool idea that is.

      In short, the register is wrong, and this IS a formula for a widespread language, because it is copying another very mature widespread language, the Renderman shading language. The only thing I am worried about is that it will be geared towards only Nvidia products, thus competing with OpenGL 2.0 (whenever the vapor settles).

      Keep in mind that I am not trying to argue you, but I am trying to argue the register's stance. The designers of Nvidia are very aware of the vast history of Renderman I am sure, and this language looks just fine.

      For anyone who wants to get into writing shaders, the book 'Advanced Renderman: Creating CGI for motion pictures' by Anthony Apodaca and Larry Gritz is your bible. it covers everything you need to know and more, and I highly recommend it.

    3. Re:Why it won't work (link) by KewlPC · · Score: 1

      Cg (and the pixel and vertex shaders written in it) have nothing to do with processing scenes, etc.

      All they're for is to tell the GPU how to draw an object. For example, lets say you wanted to draw a polygon that was supposed to be part of someone's face. You would write your pixel shader to simulate the way light bounces off human skin, use OpenGL calls to load it into the GPU, then tell OpenGL to draw the polygon using the shader you just loaded.

      The advantage that Cg brings is that instead of having to write the mathematics necessary to realistically simulate the way light bounces off human skin (or some other material) in an assembly-like language, you can do it in a C-like language. This would make writing shaders *MUCH* easier.

      And, it will work on ATI cards that support custom pixel and vertex shaders as well, so it really does benefit everybody, since now those who've got a Geforce3, Geforce4 (but not a Geforce4 MX) or a recent ATI card will see more games that support the ability of these cards to do custom shaders.

    4. Re:Why it won't work (link) by ptbrown · · Score: 2

      All loops can be implemented using if/else/goto. Adding while, for, switch, try, etc. help promote structured programming for complicated tasks. But I think it's good to promote KISS here. So include goto because even though it's been vilified it is still a staple; HLLs just try to discourage using it directly. But anything more is just needless bloat.

      Pointers? Obviously, buffer overruns just aren't doing enough damage in protected memory and we have to start corrupting our framebuffers as well.

      Are there any integer-based 3D cards anyway? If there are, they can write their own integer language.

      But I believe that if NVidia were really interested in making shader programming easier and doing it in an open way, they'd write an extension to GCC that lets it compile to their machine code. NVidia's policy of open sourcing "certain components" while keeping critical portions proprietary reminds me so much of Marie Antoinette's "Let them eat cake."

      --
      Any sufficiently advanced civilization is indistinguishable from Gods.
  27. I kan read artical by Enonu · · Score: 5, Informative

    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.

    1. Re:I kan read artical by liquidsin · · Score: 2

      So then, on the contrary, this looks like it could actually help multi-platform game development. Good.

      --
      do not read this line twice.
  28. Language or Library? by AlgUSF · · Score: 1

    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.
    1. Re:Language or Library? by Anonymous Coward · · Score: 0

      It is only for writing pixel and vertex shaders. These are currently (under DirectX and NVidia's OpenGL extensions) written assembly style.

  29. Johnny by Twillerror · · Score: 0, Troll

    Well until John Carmak gives his opinion on it I'm not even going to care. Other then the fact that it could at least improve the quality games.
    Or at least someone that rights engines for a living.

    Just remember too that Microsoft sleeps around a lot. You can be in bed with them one minute and then their off in the bathroom fucking your biggets competitor just to make you get mad and get you to do something stupid.

  30. I wonder what John Carmack thinks of this by levik · · Score: 3, Interesting
    This looks like a very smart move on NVIDIA's part. Remember GLIDE? Everyone loved it, and it arguably contributed a lot to 3Dfx's success in late 90s. The only problem with GLIDE was that it completely didn't work on any other cards.

    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.

    --
    Ñ'
    1. Re:I wonder what John Carmack thinks of this by fferreres · · Score: 2

      ... 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.

      That's what Direct3D was for from the begining. But Glide was there BEFORE direct3D, so 3Dfx was not responsible for their success. May sure also know Voodoo cards where several times faster than the closest competitor...for years.

      After that, companies started selling "promises" like the S3 virge cards, the RIVA crap and the like. They sold a lot. After than, some harm was done. Because everyone had crappy cards which only had Direct3D drivers. The cheapo crap market killed 3Dfx. They could get financing, they lost the edge.

      Good think that Nvidia was MS funded (my guess) so at least we have their damn fine cards. But I fear promoting Cg is not a move towards better competition. It can only see it hurting other vendors, not allowing faster/better games.

      --
      unfinished: (adj.)
  31. id by Anonymous Coward · · Score: 0


    at least id isn't biting. The author calls caramack a "maverick programmer" too :) Funny how id is the only gaming company (that i know of) to actively support linux too....

  32. Let this be a lesson by BitHive · · Score: 3, Funny
    To all of you that complain your submissions never get accepted--just resubmit stories from a few days ago!.

    "Same shit, different day."

  33. I've seen your post a lot by BlackTriangle · · Score: 0

    For me to care, you'll have to include suitable quotes from the linked PDF document. Sorry!

  34. that should be "amateur game developers" by Anonymous Coward · · Score: 0

    Pros really don't hang out too much on community sites.

    1. Re:that should be "amateur game developers" by Anonymous Coward · · Score: 1, Funny

      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.

  35. C'mon by s4f · · Score: 1

    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.

    1. Re:C'mon by Anonymous Coward · · Score: 0

      As always:

      Well written assembly will be faster than a compiled language. It's stupidly easy to have a decent compiler beat out a so-so asm programmer.

    2. Re:C'mon by howlingfrog · · Score: 1

      Assembly will always be faster than a compiled language.

      Not exactly true. Perfectly written assembly will always be faster than a compiled language. If it were easy enough to come up with perfectly written assembly that most programmers could do it, there wouldn't be any need for compilers at all.

      --
      The original Howling Frog is a fictional character and has no UID.
    3. Re:C'mon by Tadghe · · Score: 1

      um, sorry but you have to compile assembly also...

      org 100h
      mov dx,msg
      mov ah,9
      int 21h
      mov ah,4Ch
      int 21h
      msg db 'You still have to compile me!',0Dh,0Ah,'$'

      nasm -f elf compileme.asm
      ld -s -o compileme compileme.o

      --
      Bugs Bunny was right.
    4. Re:C'mon by Anonymous Coward · · Score: 0

      Er, i think assemble is the word you're looking for. The assembler does very little except translate mnemonics directly into machine code (well, it does keep track of memory locations and such as a nicety). Thus assembly is just barely an abstraction of machine code, and hence there is a large difference between assembling and compiling.

    5. Re:C'mon by s4f · · Score: 1

      Agreed... well written anything is generally better than poorly written. My point still stands, take a well written, hand crafted, masterpiece of assembler and it'll be faster. It's why most compiled languages have a way to include in-line assmbly code.

    6. Re:C'mon by Anonymous Coward · · Score: 0

      Actually you don't compile it, you assemble it...

    7. Re:C'mon by Anonymous Coward · · Score: 1, Interesting

      > It's why most compiled languages have a way to include in-line assmbly code.

      That isn't why. In-line assembly was brought into 'C' to access hardware features. Like "bit set and test interlocked", MMX, "INT xx", etc., etc., all which can't be expressed in 'C' and are too "light" to justify a function call's overhead.

      For most "i++" style code, the compiler can do a fine job of getting it right. Not that all do, but their own failures aren't the assumption built into in-line assembly.

    8. Re:C'mon by bsartist · · Score: 2

      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!
    9. Re:C'mon by Vulture_ · · Score: 1

      And the programs usually wind up being faster anyway, because the compiler is a lot better at code optimization than most humans (short of John Carmack, of course). And you get the added bonus of your code being more portable than assembly -- C code can be portable if written with that in mind; assembly code is never portable; and, as a minor digression, it's relatively hard to make Java code that isn't portable.

      --

      The only way the typical /.er can pick up a chick is with a forklift. -- AC

  36. nit picking by dsyu · · Score: 1

    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

  37. This is pretty cool, but... by seldolivaw · · Score: 0, Redundant
    It would be a whole order of magnitude better if they open-sourced it. Why? Because this will set the standard for graphics in future. Conversely, it means that people setting new standards for quality will be unable to use it. If you want to do more realistic/better graphics than Cg can manage, you'll have to go right back to assembly code, and your improvements in technology will be lost. If they open-sourced it, then every time somebody pushed the envelope, they would push it for the language as a whole, not just for their particular game.

    But it'll never happen, because it's unlikely to be in anyone's best financial interests to open-source either all the work NVidia has done on this language, or all the work other people have done on their own engines.

  38. Float for array indices? by revscat · · Score: 2

    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.

    1. Re:Float for array indices? by CaseyB · · Score: 2

      It doesn't make any sense at all. Is it just a hashtable with float keys? Or are floats just the only numerical type, and they're casted to ints for array lookups?

    2. Re:Float for array indices? by psavo · · Score: 2

      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.


      Just guessing, but could it be for automatic interpolating of values between table's elements? register's article mentioned something about this thing bing DX8 specific, so it must be already in use somewhere. Still i can't imagine this but to be something of a cludge.
      It's difficult to see nVidia be involved in something cludgy, must've been something of MS:s work.

      --
      fucktard is a tenderhearted description
    3. Re:Float for array indices? by Cuthalion · · Score: 2, Insightful
      I would assume the last two are related.

      No integers. This may be appropriate to NVIDIA, but is not a universal design decision.

      Arrays use float indices. This is an odd design decision, relevant to DirectX 8 and Nvidia only.
      Without ints what else would you use?

      --
      Trees can't go dancing
      So do them a big favor
      Pretend dancing stinks!
    4. Re:Float for array indices? by WNight · · Score: 3, Interesting

      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.

  39. look a little deeper by lingqi · · Score: 1

    Sigh... you guys don't see the irony here, do you?

    --

    My life in the land of the rising sun.

    1. Re:look a little deeper by Anonymous Coward · · Score: 0

      if you're going to be redundant at least hyperlink it. no one wants to copy and paste a link. html tags aren't that hard...

  40. Break it down by tomblackwell · · Score: 1

    You truly rock.

  41. cgshaders.org and Linux Toolkit by Screaming+Lunatic · · Score: 5, Interesting

    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.

  42. Good Gravy by Drath · · Score: 2

    The shocking part about this story is that Thresh's FiringSquad still exists

  43. Wow! by be-fan · · Score: 5, Informative

    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...
    1. Re:Wow! by Anonymous Coward · · Score: 0

      The length of a response is inversely proportional to the stupidity of its parent post.

  44. my guess by Anonymous Coward · · Score: 0

    Next door to Hugh Hefner.

  45. I dunno, let's ask... by Anonymous Coward · · Score: 0


    Will this replace assembly graphics coding once and for all?

    Let's ask John Carmack what he thinks. He's good at this stuff.

  46. OpenGL 2.0 Shader Language by RoninM · · Score: 5, Interesting
    Cg looked awfully familiar to me (and not just because we had this article, before). You might want to compare it to the OpenGL 2.0 Shader Language defined here (PDF) and implemented here.

    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?
    1. Re:OpenGL 2.0 Shader Language by MisterBlister · · Score: 1
      Because Cg is here now and OpenGL 2.0, if the past is any indication, won't even be fully standardized (let alone implemented) for another couple of years.

      I'm fairly sure NVidia recognizes this as a stop-gap measure since both DX9 and OpenGL 2.0 will have their own high-level shader compilers..But since neither is shipping (outside of the DX9 beta, anyway)...Well, this does the job for now.

    2. Re:OpenGL 2.0 Shader Language by civilizedINTENSITY · · Score: 2

      "This zip file contains the source code and project files necessary to build the OpenGL Shading Language compiler as a standalone executable for Windows platforms. It is 3Dlabs intention to help OpenGL move forward by providing source code to the OpenGL Shading Language parser and intermediate-code generator that we have implemented. We are making this code available in the hopes of encouraging rapid development of OpenGL 2.0 implementations as well as common tools and utilities."

      The cg toolkit is available as a tarball or in rpm. Hmmm...Anybody porting OpenGL Shader Language to linux?

  47. dont you mean discreet? by array_one · · Score: 1

    3d Studio Max isnt a company....its a software package developed and distributed by Discreet (www.discreet.com).

  48. Hello! Anyone have eyes!? by elzahir · · Score: 0, Troll

    Do you people ever read your own website?

    Just what do you all do with your time, anyway? There's about a dozen of you, and you post about a dozen stories a day. Thats all you do. And still after years of doing the same thing everyday, you people keep making the same sophmoric mistakes again and again.

    I'd expect a little content from a buch of slackers whose jobs it is to sit around in their underwear and read email. No, then again, I wouldn't.

    This site could be great if you guys wanted it to be.

    --
    For a successful technology, reality must take precedence over public relations, for nature cannot be fooled - R Feynman
    1. Re:Hello! Anyone have eyes!? by elzahir · · Score: 1

      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
  49. Come ON Guys! by EnglishTim · · Score: 2

    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!

  50. Hmmm by iggie · · Score: 1

    No, 'g' is for Graphics, 'C' is for C.

  51. so basically, by Anonymous Coward · · Score: 0

    so what this means is that our graphics cards will be half as fast as they were? Isnt the reason that assembler was used over C was to improve speed dramatically? Another move by the unholy alliance. Be on the lookout for the next generation card billed as "3x faster" that benchmarks to the same speed as your Gf4

  52. Ok, it's not real assembly by hackman · · Score: 2

    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.
  53. Score 5 Funny by rice_burners_suck · · Score: 1

    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.

  54. Re:What Are They Talking About? by fferreres · · Score: 2

    "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.)
  55. Even after several have said.. by Saulzar · · Score: 0

    That this isn't to replace the language in which you write the GAME/whatever.
    It is to replace the cryptic commands you use to define a method for vertex/pixel shaders (eg. for lighting a polygon, or colouring the vertices of a model) inside that game. So instead of a million and one,
    glBlahBlahBlahNV() ..
    You write/compile your small effect outside of that source code and your game/whatever will command it to be loaded.

  56. BSOD refresh rates by theMightyE · · Score: 4, Funny

    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.

    1. Re:BSOD refresh rates by Anonymous Coward · · Score: 0

      More like with microsoft involved we will get the easiest to program for api. Look at the wonders they did with directx, it revolutionized game creation and eliminated hardware compatibility issues.

      BTW, winxp doesn't have blue screens of death. I haven't actually seen it crash yet.

    2. Re:BSOD refresh rates by Dreamweaver · · Score: 2

      My XP installation has crashed a few times. One of them was a BSOD, the others were just total system hangs.

      --


      "If a man hasn't discovered something he will die for, he isn't fit to live" -- MLK, Jr.
  57. Not everyone agrees with Cg by Lurks · · Score: 2
    Interesting, this gets posted twice but my submission on how not everyone agrees gets rejected.

    I'm not sure I'll ever fully understand Slashdot.

  58. Anyone here actually understand the implications?? by Anonymous Coward · · Score: 0

    Opengl 2.0 is about to come out with its own 'c' language for fragment shaders. This is just NVidia and MS acknowledging that their APIs are about to get blown away by a new all-encompassing graphics API, OpenGL 2.0.
    OpenGL 2.0 will integrate necessary new features in a modular construct to aid the evolution interactive 3D graphics programming.

    Tom West
    Wollongong University

  59. Re:Complex assemly language? (Yes) by GoSpeedRacerGo · · Score: 1

    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.