View Full Version : graphical programming

11 November 2003, 01:08 AM
hey guys, i came here looking for some advice...

i am a fairly proficient cg artist, and a user of alias's maya. I've experimented with everything, and found that my greatest interest is in particles and dynamic effects in general.

I used to do a little programming with visual basic many years ago, and I really love it.

So now I want to start to learn more about programming, but specifically graphical programming, so I can use to to help with creating effects or shaders, etc. (i hear things about people writing their own shaders, how is this done? is it with c++ or some other language?)

I've worked with MEL a little bit, and it seems like a very powerful tool for users of maya, but I think I might want to start learning c++.

now if i'm right, there are kind of 2 graphical mediums of using c++, directx and opengl. I've heard that directx is more modern and probably the wave to the I think i'd like to start learing that as well.. or am i completely wrong about that whole idea.?

i'm just kindof rambling on about who-knows-what...but basically I really love 3d computer graphics but also really want to start programming, and am looking for how to start to inter-mix the two.

should i just buy visual c++ and start learning that? (by the way, i'm seeing 2 versions, vc++ v.40 embedded, and vc++ v.60? which is newer or are they 2 different things?

I really just don't know where to start, so maybe someone could point me to some info on the web, or if anyone feels compelled to lay down some words of advice, please do so, and if you've made it through my post thanks .

11 November 2003, 09:30 AM
DirectX is windows only. OpenGL runs on just about any platform and has bindings for every language you can name.

DirectX is on version 9 now and has already gone through many many many interface-breaking changes. OpenGL is on version 1.4 and a program written for OpenGL 1.0 will still work now. OpenGL 2.0 is on the horizon and promises to be absolutely lovely.

Despite what Windows zealots will tell you, there is no speed difference between DX and OpenGL.

As you can tell, I'm a bit biased towards OpenGL, but then it's a better API:)

I think your choice is this: if you want to program windows games, learn DirectX first. If you want to do anything else, learn OpenGL first and you'll never want to bother with DirectX.

Oh and if you want to do 3D graphics programming, stay far, far away from anything to do with .NET, "managed" code, visual basic, "embedded" or in fact anything to do with Microsoft.

Having said that, Visual C++ has a very nice debugger. I'd get VC++ 6.0.

The way I got started learning 3D graphics, and the way I'd advise anyone to do it is to follow NeHe's OpenGL tutorials at

11 November 2003, 02:54 PM
Man, the only thing I could add to playmesumch00ns reply is read it again. Its like I wrote it under his log in. Well OK there is one more thing to add starting in OGL takes just a few minutes and is very easy to understand. For the beginning programmer DirectX will make you think twice as to whether you really want to program or not. Sure you may be able to mimick what DirectX tells you to do but understanding it without a ton of programming background would be like creating a new universe with no matter nor energy.

11 November 2003, 10:29 PM
remember that open gl is only graphics, not sound... for sound you have to resort to Direct X or it's like on other systems.

11 November 2003, 11:47 PM
You now have other choices for sound other then DirectSound such as OpenAL, Orb Vorbis theres a couple others available as well. I have to admit though if you are doing a game DirectInput makes things pretty nice but again some of the can be handled with OGL or your own code. OpenML also has promise as a straight multimedia API but its still is in major development at the moment.

11 November 2003, 12:38 AM
wow guys, thanks for all the imput.

what i'm going to do now is look into starting some c++ programming just to get familiar with it, then look into opengl.

i went the the visual c++ website, and there are so many different versions. i know you said to stay away from embedded and .net, but could anyone explain what the differences between these things are?

also confusing: you say to stay away from microsoft products, but then to get vc++ 6.0? isn't that made by microsoft?

11 November 2003, 06:43 AM
.NET is for web applications, embedded is for... well... embedded devices (phone software, mp3 players, etc.). Visual C++ is what you want for programming any traditional PC based OpenGL stuff.

While Playme's post might seem a little confused there are a lot of people (and some university courses, mine included) that wouldn't normally touch VC++ with a supernaturally long pole but find that it's paradoxically the best dev kit for programming in OpenGL for Windows as you can take some OpenGL and GLUT code from, say, Linux, drop it in VC++ and it'll compile without a hitch (keeping in mind that I haven't programmed anything complex yet).

For some bizarre reason the Borland C/C++ compiler makes OpenGL programming such an overly complex task it's just not worth bothering with.

Now if you can manage to slot in a few other cross-platform APIs ther (a bit of SDL, or maybe some GTK+, maybe a bit of crystal audio libs) and you can kiss your cross-platform blues goodbye... erm, I've hijacked the subject here a bit...

Anyway, unless you want to get in to game programming in a major way (just an inkling but I'm guessing not as you're here and not in game development) don't even look at Direct3D.

hth, Paul

11 November 2003, 10:23 AM
halogenic: Yes it does seem a little confusing, sorry! What I meant was that VC++ has an excellent debugger, which will come in very useful. Personally if I was programming on Windows now I might well choose to use a gcc port (better than VC, and free), but if you're just starting programming it'll probably be painful for you to set up.

With VC++ you have a choice. VC++ 6 is probably a better IDE, becuase it works painlessly, has a great debugger and doesn't try and force .NET down your throat like VC.NET does (try doing a default install of .NET and watch it swamp you HD with gigabytes of crap).

On the other hand, VC.NET's compiler is much MUCH better than the 6's... but then it's still not as good as gcc.

I'd go for VC++ 6, and with the money you should save make sure to buy Visual Assist by whole tomato software. I cannot describe how much easier that program makes programming. Only trouble is you get to rely on it. Switching over to nedit/gcc I found myself pressing tab every few seconds....

11 November 2003, 11:19 AM
Just to add, if you want sound but don't want DirectX have a look at OpenAL ( which is also cross platform.
If you need some 2D stuff and window management across platforms, you can't much go wrong with SDL (

But I'd say stay with OpenGL. It's a hell of a lot quicker to develop in that DirectX and easier to learn (for me anyhows).

And for some coding specific sites:

and there's plenty more to be found on Google (

11 November 2003, 01:35 PM
Originally posted by odubtaig
.NET is for web applications

Actually, .NET, in particular the .NET Framework that is often just referred to as "dot net", is not just for web applications and web services. It's the framework upon all future Windows applications will be (have to be) based. Those deeply involved in the .NET Framework all complain that Microsoft made a major marketing mistake when they launched the .NET Framework because it made it look like it's just for web/network applications.

Perhaps the article above will give you a bit more insight into it, particularly how it (can/might) relate to our industry as a whole.
I wrote the blurb last year and I should actually update it in the future to reflect the status of Mono (the CLR/NET effort for Linux).

I'm not a fan of DirectX but I've toyed around a slight bit with Managed DirectX and while there is a 3-4% performance decrease over unmanaged code the actual effort involved in creating DX based apps certainly could be quite interesting to many folks.

11 November 2003, 02:32 PM
yeah... looks like .NET technology is taking over developing pipelines... at least in places i work in contact to.

Has someone worked on it yet? any opinion?

What i like least is the fact that "older" microsoft languages (VJ++, VC++ 6) aren't supported anymore.

p.s. I know that Java is better than J++ but i need to build COM .dll classes :(

11 November 2003, 02:50 PM
Originally posted by Da Krunch
yeah... looks like .NET technology is taking over developing pipelines... at least in places i work in contact to.

That would make perfect sense for places that are Windows-centric. The .NET Framework is an unescapable fact that will be the "new API" for future Windows versions. Looking at new technologies at M$, like Avalon, Longhorn, WinFX, etc. it's clear that not doing .NET would mean lagging behind those that do in the next years to come. Getting an early start on it doesn't pay off immediately but I have no doubt that for Windows-centric development it will in the longer run.

Has someone worked on it yet? any opinion?

Extensively. I have never been a fan of M$, especially when looking at the complete mess that resulted from different product groups doing the different technologies like COM, COM+, MFC, ActiveX, DAO, etc. The .NET Framework consolidates all that in a much cleaner API. That alone is something for which I would give them credit

There is a slight performance hit doing managed code but the benefits tend to outweigh that hit and there's always still the option to do unmanaged C++ code using VC++ 7.x and integrate that with managed code. That makes it not much different than the times when C++ was starting to take over most development and certain parts that required performance were still done in ASM. A similar paradigm shift is taking place now where performance critical code is done in unmanaged code and everything else where performance is of lesser importance in managed code.

I come from a C++ background but have warm fuzzy feelings for C# which in itself holds a lot of beauty in its design. Jumping right in posed no real difficulties other than a few syntax particulars. If I look at the Windows guys here at the office I am seeing them grow to be quite language agnostic... in that it doesn't quite pose much difference whether someone hacks a quick one-shot tool in VB.NET or C#. Once you know the syntax of the different langauges the rest is just all about knowing the "API" (the .NET Framework).

From a managerial point of view I'm quite happy with the .NET Framework for a lot of reasons that cover everything from the technical to the financial. For example, some junior programmers are getting up to speed with their skills a lot faster thanks to the cleaner .NET Framework and C#. The historic threshold of learning, understanding, and being able to oversee a huge API has been lowered, allowing for quicker ROI on staff, development, etc.

11 November 2003, 07:22 PM
And it seems that .NET starts to go cross-platform.

11 November 2003, 11:32 PM
Originally posted by MGernot
And it seems that .NET starts to go cross-platform.

Oh man .... so that academic copy of 2004 may come in useful after all.:applause:

11 November 2003, 05:32 PM
If you want to do shader writing, get a RenderMan-compliant renderer. It is the most common type renderer that supports shader writing. (RenderMan is a standard, not a product. Several renderers conform to the standard.) There are a couple of free versions available:

How to write shaders:


12 December 2003, 03:01 PM
If you want to get into shader development and are a bit afraid of tackling it head on, you may want to download a new program called ShaderWorks... it's currently in alpha and free for download

It's a visual graph-based approach at writing shaders...

have fun

12 December 2003, 05:37 PM
If you want to do shader writing, get a RenderMan-compliant renderer. It is the most common type renderer that supports shader writing. (RenderMan is a standard, not a product. Several renderers conform to the standard.) There are a couple of free versions available:

hey, what about mental ray shaders?
are they just more difficult to write than renderman or not as widely used?

just curious about this subject

12 December 2003, 06:51 PM
Well, ShaderWorks is strickly hardware shader specific. Used to develop real-time HLSL (high level shader language) direct3D shaders. It's the first of it's kind to allow creation of hardware shaders using a graph based approach similar to Maya's HyperGraph.

So unfortunatly it's not used to develop software based shaders.

There is another graph based shader tool for RenderMan called ShaderMan...

12 December 2003, 06:13 PM
I would guess that MentalRay is just not used as much. With Max, Maya, and XSI now all including MentalRay, I'm sure that will change.

12 December 2003, 06:42 PM
Originally posted by henning
I would guess that MentalRay is just not used as much. With Max, Maya, and XSI now all including MentalRay, I'm sure that will change.

I very much doubt that the default inclusion in various products will increase and change anything by a measurable degree. Softimage has offered and included MR throughout their history. Alias had other good reasons for going the MR route because of the limitations of their default renderer. MR has been available in a very limited fashion for MAX in the past three years as well but complete lack of sales and product development stiffled that. So, inclusion by definition would not practically change a lot of how MR is situated, marketwise.

Writing shaders for MR is generally more involved and requires a bit more effort than PRM and when your production pipeline depends on being able to deal with custom shaders the choice for PRM tends to be more prevalent. If you look at it financially then there's a breaking point where the lower cost of MR does not offset itself against being able to develop shaders quicker and more easily with PRM (human resource cost easily outweighs the cost offset of licenses). Add to that the fact that experienced shader writers are hard to come by and that even with that being the case it is still easier to find people with PRM experience and you've got a clear situation where it's not the products that define the direction things have headed but rather the available talent has already defined it.

CGTalk Moderation
01 January 2006, 06:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.