Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

GLSlang Draft Approved

chrisd posted more than 11 years ago | from the glbegin-glenable(directxenvy)-glend dept.

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

cancel ×

26 comments

Sorry! There are no comments related to the filter you selected.

GL Slang (2, Funny)

heldlikesound (132717) | more than 11 years ago | (#5394466)

Yo, I feel ya, butter up some pixies and keep da framerizates hizigh... Keep it real, an we be rollin in the rova sittin' on dubs! Damn, fool, foget dubs, Jordans!

Slang? (1)

YE (23647) | more than 11 years ago | (#5394590)

Nah, I'm waiting for glTrashTalk or at least gl13375p34k.

pr0ps t0 all dead penis birds (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5394685)

<(x)
/()\
8=x===>

yep. that's pretty much all i can come
up with at 6am in the morning. too early
to draw a shark with a frickin' laser beam
on it's head in ascii.

Sigh (whining of the highest order (0)

samael (12612) | more than 11 years ago | (#5394751)

I clicked on the story thinking "I wonder if anyone has compared this to DirectX 8/9 so that I can see what the relative merits are."

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 (0, Redundant)

Anonymous Coward | more than 11 years ago | (#5394888)

DirectX: Runs on Windows
OpenGL: Runs on Windows, Linux, MacOS, kick-ass high-end unix scientific visualisation workstations, etc.

Re:Sigh (whining of the highest order (0)

Anonymous Coward | more than 11 years ago | (#5397157)

I think he was looking for something a little more "hardcore" than "OpenGL is cross-platform" (which everyone knows already).

Re:Sigh (whining of the highest order (0)

pyman (610707) | more than 11 years ago | (#5402604)

This sums it up exactly. OpenGL is cross platform. DirectX is not, and probably never will be...

...and remember, Carmack uses OpenGL, so it must be good!

Re:Sigh (whining of the highest order (0)

Anonymous Coward | more than 11 years ago | (#5423111)

(found in metamods)

No, Carmack uses OpenGL because back when he had to pick one DirectX really sucked.

I'm fairly sure he's .planned that DirectX is now just as good.

Plus the Windows implementation of DirectX will usually beat the Windows implementation of OpenGL for almost all apps. Remains to see which on Doom III is.

DX 8 is the wrong comparison (1)

91degrees (207121) | more than 11 years ago | (#5406810)

DX 8 is lower level than OpenGL. It doesn't support a high level shading language. Just a low level assembly like language. This is unlikely to change, although an extra library might be designed to bolt on a higher level shader.

A more logical comparison would be nVidia's Cg vs. GLSlang.

Get a move on (1)

falcon9x (618587) | more than 11 years ago | (#5395013)

They really need to step up the pace on how they go about this stuff. The words "OpenGL 2.0" were floating around a loooonng time ago. In the time that has passed since I believe I've seen a few releases of DirectX. Now I'm all for OpenGL, but if they wish to be a decent alternative to DirectX, then they need to step up the pace, and stop squabbling over shiznit (I think NVIDIA and ATI are that the forefront of that). Honestly though, I can't wait for it to come out. It may the "push" needed to spur more Linux gaming. And that would be awesome.

Why? (4, Informative)

GeckoX (259575) | more than 11 years ago | (#5396096)

Just because MS pumps out version after version of DirectX means that OpenGL must suck because they're only working on their second full version now?
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? (0)

Anonymous Coward | more than 11 years ago | (#5397201)

>Just because MS pumps out version after version of DirectX means that OpenGL must suck because they're only working on their second full version now?

OpenGL kinda went asleep for a few years because SGI was working with Microsoft on the grand uber-replacement for OpenGL and DirectX. Sure, everyone (except SGI) knew that was a crock, but it's a fair point that standards work for OpenGL wasn't really happening until recently.

Re:Why? (3, Interesting)

drinkypoo (153816) | more than 11 years ago | (#5398751)

You're correct on all counts. The sad thing is, Microsoft had a software OpenGL implementation since the dawn of time and really the only reason Direct3D exists is because of GLIDE. If 3dfx had just done MiniGL from the beginning instead of creating their own 3D API then Microsoft would likely have stuck with OpenGL instead of creating their own (Crappy) 3D graphics API.

Re:Why? (1)

GeckoX (259575) | more than 11 years ago | (#5399148)

Good point, amazing how soon we forget.
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? (1)

juhaz (110830) | more than 11 years ago | (#5440223)

Well, with M$:s track record of mutilating standards, it may even be a good thing.

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.

New definition of getting there? (0)

Anonymous Coward | more than 11 years ago | (#5395162)


It's a draft!! It needs to be made a standard and _then_ implemented and then the testing remain! It could take years!! Sigh!

There is no "goto" (3, Informative)

korpiq (8532) | more than 11 years ago | (#5395221)


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" (1)

morcheeba (260908) | more than 11 years ago | (#5399680)

Yeah, there are no goto's, but there is every other kind of structured branch statement: for/while/do-while/continue/break/return. Most C programmers get by with only these (although a do-while-repeat loop would be helpful), and some don't even know that C has a goto.

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" (1)

Autonomous Cow (101221) | more than 11 years ago | (#5402713)

>> Also, for the record, C doesn't have strings, either. The only string support is in libraries; not natively.

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(strcm p(my_str, my_chars) ? "strings supported" : "whats a string anyway");
-- 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" (1)

morcheeba (260908) | more than 11 years ago | (#5403644)

Oops, I forgot that part! I was thinking of the built-in support of BASIC - "ab" + "cd" = "abcd" and its keywords (not library functions) like MID$ and LEN. I was thinking of how C makes no distinction between a pointer to a single character and a pointer to a null-terminated string.

Re:There is no "goto" (1)

Autonomous Cow (101221) | more than 11 years ago | (#5402784)

They left out a couple of useful structured primitives: labeled break, labeled continue, switch.

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.

directx ownz opengl (-1, Redundant)

Anonymous Coward | more than 11 years ago | (#5395515)

and has done so for years.

vec2? (1)

emarkp (67813) | more than 11 years ago | (#5397007)

I'm a bit disappointed that they're reserving keywords like:
vec2 vec3 vec4
bvec2 bvec3 bvec4
ivec2 ivec3 ivec4
mat2 mat3 mat4
without a "gl_" prefix. I have already defined classes vec2 for that purpose--using the template parameter to define the underlying type. It's unfortunate that they're gobbling up those keywords (and there's no way it appears to choose different floating point precisions for vec/mat.

Re:vec2? (1)

Screaming Lunatic (526975) | more than 11 years ago | (#5397555)

They are reserved within vertex and fragment programs, *not* within your application. I'm pretty sure most people wouldn't define their own vec2 type within a fragment program.

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? (1)

spitzak (4019) | more than 11 years ago | (#5401787)

This is in OpenGL shading language, which is probably in a string constant in your C code, so there are no conflicts.Ie the C code is something like gl_set_shader(gl_compile_shader("the source code goes here"));

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

spyderbyte23 (96108) | more than 11 years ago | (#5408481)

Did anyone else think that this was GL bindings for S-Lang? [s-lang.org]

I was thinking to myself, What the hell good is that?

Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?