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

65 of 176 comments (clear)

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

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

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

  4. 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 0xdeadbeef · · Score: 2, Funny

      Drop me a line sometime...

      A bass player? Pshaw, as if.

    3. 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.
    4. 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.
    5. 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. --
  5. Another article by purepower · · Score: 3, Informative

    Extreme Tech also has an article about Cg.

  6. 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
  7. 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 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"?
  8. 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 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.
    4. 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. 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?

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

  11. See what some game developers think by magic · · Score: 4, Insightful
  12. 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 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.
    3. 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.)
    4. 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.)
    5. 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.)
    6. 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.

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

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

  17. 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.)
  18. Re:Complex assemly language? by colmore · · Score: 2

    BS.

    --
    In Capitalist America, bank robs you!
  19. 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();

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

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

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

  23. Good Gravy by Drath · · Score: 2

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

  24. 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...
  25. Re:Inefficiencies by Toraz+Chryx · · Score: 2

    "Console on a stick"

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

  26. 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
  27. 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 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?

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

  29. 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.
  30. 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
  31. 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.
  32. 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.)
  33. 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 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.
  34. 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.

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

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