Shader Support

Just curious how risky it is to use glsl shaders.. thoughts anyone?

(log in to comment)

Comments

Shaders have two risks:
  1. End-user doesn't have hardware with shader support. This is pretty unlikely.
  2. Shader implementations are broken in wildly different ways and there doesn't seem to be any useful resource out there with details (like there is for CSS compatibility in web browsers). Sometimes vendors will explicitly say they don't support certain shader features (eg. certain nvidia chipsets didn't implement random number generation). That doesn't help when you write a nested loop and find that it works on one Mac but not another.
I do not have shaders available on my main computer - might have them on others, but have not tested - good luck though, but I would say it probably is not worth the dev time - unless you know it will gain you awesome points ;)

@richard.. interesting. .admittedly i had hoped that "glsl" would have standardized stuff by now, haven't looked into shader capabilities since 02 or so. It seems like a far more elegant way to make my simple games look awesome.

@RB[0].. yeah, i had to dig to find out my intel gma chipset has *some* available. Points aren't really the goal, i just love the idea that i could make a graphically rich 3d environment without doing much in the way of code tricks (which i think shaders ideally would do)

And really I am just looking for an excuse to get good at shaders so I can attempt to make beautiful 3d environments

I also want to use shaders. I think i will try it any ways - i know most people would not want to run my panda3d game - maybe if i make it look nice enough they will try.
Oh, GLSL is a standard alright, it's just that the chip manufacturers have buggy implementations :(

Shaders are fun. Don't let all this pessimism hold you back from trying!

Also, there's some nice shader wrapping modules in the pyglet SVN experimental directory.

I use Nvidas' Cg (just because it comes with panda3d) it runs well on Nvidia and Ati cards so far and there is some tools to support it. Cg can be compiled for HLSL and GLSL so it cross platform between X and openGL like panda3d itself.
Actually I would disagree with Richard: among the pyglet community (who exclusively develop with OpenGL) there are many hardware configurations with limited or no shader support (by limited, think vertex shading only).

The driver situation is pretty bleak too; I've seen compiler bugs in the latest nvidia drivers running on 8800's that would make you cry. Cg is far more stable.

I, and perhaps others, am running EXTREMELY old hardware (Pentium III laptop, maybe in a few months I will have something better.) Needless to say, my 3D graphical capabilities are less than the Play Station II's, however I see PyWeek as more of a personal challenge to push oneself to create and try new things. I may not be able to run games that use shaders but that seems a little irrelevant. If it's something you want to learn and test out then I don't see why us, with our limited hardware, should stop you. However, it may affect your final score during judging, since fewer people could play it.
i did some shader stuff for cocos2d vector graphics. Then i had to go back to textures, because the only people i could find with support for shaders were the ones using macs.
Yeah i think i should provide a non shader mode though.

GLSL is still rumored to have many bugs in the actual implementations but it probably works fine most of the time. Personally I'll use either Cg or low-level assembly-style syntax. I'm more familiar with the later but compared to a C-style syntax it can be a bit frustrating so I haven't decided which one I'll use for this PyWeek.

I'll have at least a simple compatibility mode for people without shaders. I also would like to mess with the new features only available in Shader Model 4.0, but I think that requires NVidia specific extensions, so only people with GeForce 8xxx or newer would be able to see it. So from a competition point of view, that's not really worth it but coding interesting things is more important.

So I'll have at least 3 configurations:
- fixed pipeline
- basic shaders
- shader model 4.0