Sign in to follow this  

Learning a shading language, worth it?

This topic is 4107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I am currently working as lead artist on a next-gen game demo, and we are addressing the issue of shaders. I must confess I've done very little actual programming, and a little bit of scripting, but programming in general is new to me. That said, I have a pretty sound understanding of the technical processes behind the tools I use and rendering technologies. Is it worth it for me, as an artist, to learn HLSL (most likely) or another shading language? I do have an interest, but how much do games benefit from an artist writing the shaders as opposed to a programmer (who must approximate what the artist wants, and especially with no artistic training that could be difficult)? Is HLSL very difficult to learn? What's the time frame for writing something like a Normal Map + Specular shader? Is it worth it to learn (consider I do have alot to do regardless but I haven't learned anything new in a while and I am getting wanderlust I guess)? Just would like some opinions, and obviously, I'll ask my team as well. Thanks.

Share this post


Link to post
Share on other sites
I'm not qualified to answer this question directly, so I won't. What I will say, though, is that you saw my catapult. That's a coders attempt at 3d art. I got a reasonable result, in my eyes at least, but I took a hell of a long time do do it. The fact that I knew exactly how shadows would be cast from it, and probably had a more realistic view of performance issues (I know my game is fillrate bound anyway) didn't really help much. Knowing how my semi per pixel lighting worked actually did help, but I could have explained that to any artist worth their salt anyway.

So whatever your artistic training, I kind of doubt you'll be better at writing shaders than a programmer. That's not to say it's not worth learning though, if you'll be in a position to guide people doing it. You could maybe convince a programmer to write a "playground" shader which lets you experiment with things. It'd basicly be an unoptimised shader with all the inputs possible in the engine (within reason) so you could concentrate on the interesting bit. Once you get what you want with that, it shouldn't be too hard to strip it down and optimise. It may or may not be better than just explaining what you want.

If you do end up just explaining things, then here's a tip: Try to be really precise. If you can express things in mathematical or physical terms then that helps a lot. For example, say you wanted a glowing orb thing, you could say "The whole orb should have full blue. Red and green should be proportional to the difference in angle between the view and the normal of the orb, such that it appears deep blue in the centre and white around the edges."

The programmer should come up with something like this pretty quickly (pseudo code):
colour.b = 1.0
colour.r = colour.g = dot(N, V)
At which point you could tell them why it doesn't do what you want.

Share this post


Link to post
Share on other sites
Actually I've seen artists generate shaders using tools like RTShader and NVidia FX Composer. Programmers then take those shaders and optimize them, debug them, make them work, etc. But yea, artists are usually not involved with manually writing shader code because it's very heavy on math and physics.

Share this post


Link to post
Share on other sites
Righty-o then. Perhaps after this project is done I'll investigate it, but I will definately investigate those tools (things like Rendermonkey always seemed very confusing as well which is why I figured maybe I'll just learn HLSL). Thanks for all the advice guys.

Share this post


Link to post
Share on other sites
Quote:
Original post by Professor420
(things like Rendermonkey always seemed very confusing as well which is why I figured maybe I'll just learn HLSL). Thanks for all the advice guys.

RenderMonkey and FX Composer both use HLSL/Cg (the former can also use GLSL)... all they do is provide a nice interface for creating a basic scene and applying shaders to it, as well as some sliders for editing parameters. There's really no "easier" way to work with HLSL as these basics are required to get any sort of picture.

To address your original question, some of the best artists I know understand the tech very well. The more you can understand and do yourself, the more useful you are (this may seem pretty obvious). However, at some point one has to judge whether your time is better spent on other things. Eventually shading will be 99% artist-controlled, but the interface probably isn't there yet (something like 3dsmax or Maya's material stuff is what we need to get to; it isn't far off). For now - unless you have a fairly strong background in math - it may be best to deal with the inevitable back-and-forth and miscommunication involved with effectvely coauthoring the shader with a programmer.

That said, if you're interested in shading and/or shading languages, by all means at least mess around in RenderMonkey/FX Composer!

Share this post


Link to post
Share on other sites

This topic is 4107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this