Fixed Functionality GLSL shader?

Axiom-Crux's icon

I was about to start working on a shader implementing fixed functionality with perpixel lighting, but I realized someone must have already done this and wanted to ask if anyone has one or if there's one hidden away in the distro (I couldn't seem to find one with fog and the like..)

hopefully it would be one that takes all the values from opengl so you don't have to use params to control anything, but I can always modify that.

Is there one in the orange book? I saw some info in it about making one but I dont own it so cant check...

Wesley Smith's icon

A good place to start would be mat.phong.glsl.jxs in the shaders folder. You can replace the Kd, Ks etc. params with gl_Material variables.

wes

Axiom-Crux's icon

funny coincidense, I ended up going through all the shaders in the built in lib and that was the one I thought seemed closest and was planning on pushing further.. At the mooment though Im working on a crazy vertex displacement shader (my first from scratch designed shader yay!) heres a little test clip http://vimeo.com/4143254

Joshua Kit Clayton's icon

As a starting point, you might check out the old 3DLabs GLSL ShaderGen (acquired by some firm, and no longer keeping this stuff up). This program would let you choose which portions of the fixed functionality pipeline you were interested in and generate the appropriate shader code. A quick Google on GLSL ShaderGen turned up this web site which has archived versions of the program (windows only), and source code.

Hope this helps.

- Joshua

p.s. The striping in your vimeo video posted above is the result of polygon render ordering and the default blend mode. When using alpha blending in this way, I'd recommend an additive blend mode like "6 1", which avoids these sort of artifacts. In the next major release of Jitter, we'll be making this blend mode stuff a little less cryptic than the current mystical numerology.

Axiom-Crux's icon

oh for sure, Ive actually heard of this shaderGen before, but I also had heard it was only for PC. I do have windows on my macbok pro but for some strange reason when I go over into the windows boot it will not let me use openGL, only directX. I tried to figure out how to install opengl in windows in case that was indeed the solution, and I couldn't for the life of me figure out how to install it. I scoured the web and tried everything I found but still no opengl.. but I suppose I could just generate the shader text files and take them onto the mac partition. I might try it out. Have you tried it? Im hoping to replicate the same thing the jitter fixed function is capable of, but with per pixel. I really just wanted it for the ability to use it as a starting point to build off of rather then a means to an end.

The striping in the vid was entirely intentional, I had tried out many blend modes with it, especially 6 1 and 6 7. I made the shader push the normals and vertexes in different ways so it would do strange things to the lighting and form. I think its pretty interesting. Ive made some really crazy effects with it so far. I love vertex displacement! Next I want to make some of my favorite noise functions from the BFG into vertex displacement shaders without the need for the jit.BFG

Thanks Josh, keep up the great work!

Axiom-Crux's icon

actually I think this clip may have been in 6 1... is that not possible?

Joshua Kit Clayton's icon

Sure. It would look like this if depth_enable is on. Typically with transparency, one would want to turn this off to avoid the artifacts, but in your case it sounds like that's what you're going for.

Not sure why you're having OpenGL issues if you're booting Windows via BootCamp on a MacBook, as it should work fine. If you're using one of the virtualization technologies, there might be issues with OpenGL. You could perhaps spend an evening with a friend's PC to make your shader with ShaderGen.

-Joshua

Wesley Smith's icon

I've tried opengl with virtualization on VMWare and Parallels and it simply doesn't work. Using OpenGL through bootcamp should work no problem.

wes

Axiom-Crux's icon

yeah im using bootcamp, I dont know whats up its really confusing me. I am getting a new computer soon though so hopefully that one will work.

I made a few totally insane shaders last night. I have been experimenting with causing glitches in the gpu, its amazing! Ive been achieving incredibly complex imagery with just a small bit of code by just doing things that dont really make sense. Heres a vimeo clip: