GLSlang Draft Approved 26
Screaming Lunatic writes "The OpenGL2 working group has approved the draft version of The OpenGL Shading Language (glslang). It looks like OpenGL2.0 is getting there."
As the trials of life continue to take their toll, remember that there is always a future in Computer Maintenance. -- National Lampoon, "Deteriorata"
GL Slang (Score:3, Funny)
Slang? (Score:1)
Sigh (whining of the highest order (Score:1)
I find two comments. One of them's pretty funny, right enough, but where are the hardcore geeks??
Re:Sigh (whining of the highest order (Score:1)
DX 8 is the wrong comparison (Score:1)
A more logical comparison would be nVidia's Cg vs. GLSlang.
Get a move on (Score:1)
Why? (Score:4, Informative)
That argument just doesn't hold water.
Just so you know, OpenGL 1.x has been around for a very long time now, and it still happens to be totally viable. Why? Because it was a very well designed and fully featured graphics language when it first appeared. DirectX has been playing catch-up ever since.
It's just in the last year or so that DirectX has actually added newer features that OpenGL 1.x doesn't handle. If you look at the specs for OpenGL 2.0, you will see that once it comes out, DirectX will have probably another 5-6 releases to go before it catches up again. Oh, and it runs on just about every platform out there.
Ever heard of a real-time medical imaging package that uses DirectX? Yeah, thought not. And you never will. DirectX is really for games only, and not only that, MS platforms only on PC and XBox.
I could go into all the fundamental differences between OpenGL and DirectX, but is there really any point? The last one I will point out is this: DirectX is really a direct mapping to hardware, it's not really a Graphics Language per-se in that it's focus is on the actual implementation of the graphics and not on the graphics themselves. OpenGL on the other hand is ALL about the graphics, with the actual implementation totally left up to the environment it runs in.
Re:Why? (Score:4, Interesting)
Re:Why? (Score:1)
I was some ticked at 3dfx back in the day for forcing glide upon us and diluting the market at the time just because they had clout. (Fat lot of good it did them).
But I had never really correlated that with MS's decision to create Direct3D, again, good point!
Re:Why? (Score:1)
At least this way they didn't get their hands on OpenGL and create some half-assed noncompatible variant of it like they've done with just about every technology on the planet.
There is no "goto" (Score:3, Informative)
And wait, there's more:
No '*' or '&' unary ops. Pointers are not supported.
Suddenly you begin to feel enlighted. But where were these guys when all the previous derivatives of c hit us?!
I feel soo nice reading about a language that has no strings. Literally.
Re:There is no "goto" (Score:2)
Pointers aren't supported (just like in java and Fortran), and I suspect the reason for that is that pointer aliasing can only be detected at runtime, so a lot of very useful compiler optimizations can't be done. In fact, that's why a lot of super-computer applications still use fortran (besides the large existing math library base). Graphics rendering is speed-oriented, and in a special-purpose language like this, it's a good tradeoff.
For comparison, (and for the same reasons) nvidia's cg doesn't have goto's or pointers, either. [theregister.co.uk]
GLSlang has a lot of functions built-in (like texture lookups, vectors, and matricies) for things you may want to use pointers for. The benefit of supporting them natively is that they can be hardware-optimized extremely well. One cool thing that Cg [nvidia.com] does (and it appears that GLSlang does, too) is allow floating point indicies into texture-maps -- the inbetween position is automatically interpolated.
Also, for the record, C doesn't have strings, either. The only string support is in libraries; not natively.
Re:There is no "goto" (Score:1)
Almost correct.
The C compiler knows about literal strings, that is why this:
-- code --
const char my_str[] = "something";
const char my_chars[] = {'s','o','m','e','t','h','i','n','g'};
puts(strc
-- code --
should print "strings supported", because my_str does not equal my_chars
For fun try this:
-- code --
printf("length of char array: %d", strlen(my_chars));
-- code --
with the above. It might not crash.
By the way, sometimes goto can be very handy. Unless the language supports labeled break and continue statements?
Re:There is no "goto" (Score:1)
Re:There is no "goto" (Score:1)
The labeled break and continue are very handy for getting out of multiply-nested loops. A goto is useful to simulate those constructs on languages that don't have them (like C).
Switch (can be implemented with if-else-if-else...) can make things a lot more readable. Oh well, maybe someone could write a preprocessor to add the things the language designers left out.
vec2? (Score:2)
Re:vec2? (Score:2)
and there's no way it appears to choose different floating point precisions for vec/mat.
They're working on it. Look at Issue#33.
Re:vec2? (Score:2)
If you want to cut & paste the code so the same algorithim can be used by both your C program and shaders you can use macros. Ie "#define gl_vec2 vec2" can be inserted into the shader language fragment and then you can use gl_vec2 the way you want.
oh, great, 3-d controls for slrn (Score:2)
I was thinking to myself, What the hell good is that?