GLSL demo pack

Update 1:
FIxed compile time error for ATI graphics card. But terrain and human head still doesn’t render correctly.

Either way, you can do most of what I have here without a single line of code with the new Blender GE from Apricot.

Original:
Due to job requirement, I am doing a lot of GLSL shader stuff in Blender. And I present to you a demo that I created in my spare time as I was learning this cool shading language.

>>Download

Control: W, A, S, D, Mouse Look

This is a demo for the OFFICIAL 2.46 release, it does not work on Apricot branches or many custom ‘optimized’ 2.46 releases.

http://mpan3.homeip.net/content/misc/glsl.jpg

It’s unpolished and i did not comment the shader files, but I just wanted to get this file out there before apricot steals all the thunder :cool:

Downloading… is this a game or something?

Great work!
Thank you for sharing this.

just a demo scene with a first person shooter controlled camera.

So those things could be used in a game? Because animated water/ that awesome land scape are perfect for my game! how do you do it?

it all looks pretty nice. except the head kinda bothers me i cant quite put my finger on it, i think its UV map is a bit off

This looks neat mpan. You are very talented with the GLSL material system.

Ok, here is quick run down of what’s going on in the demo file

Landscape:
There are 3 texture layers, the first one is the color map. The second one is the normal map. The last texture is the specular map. The specular map is responsible for that awesome water puddle in the middle of the landscape.

All 3 textures are combined with the GLSL shader. This particular shader is based off the normalmap demo from blender.org. Except the specular highlight is masked by the specular texture to control which part of the objects gets specular reflection.

Orca Whale:
The shader combines the base color map, and the water caustics map. The caustics map is distorted by and offset from another map (perlin noise).

The whale also has a sin wave applied to every vertex to mimic the swimming motion.

Face:
The shader is similar to the lanadscape shader, the face has a color map(tone of the skin) ,a normal map(pores and wrinkles) and a specular map(lips, sweaty forehead).

The face also has a ramp shader / fresnel shader / rim highlight that accents the edge.

Ocean:
This is a complex shader. I’ll get to it later.

Monkeys:
Spherical Harmonic Lighting is a simple algorithm with a complex theory. But the bottom line is this: a few numbers can be used to describe the diffuse lighting condition of any lighting environment. The coefficients are pre-calculated using HDR lightprobe images.

Yeah this is a shader demo, and I am too lazy to create the proper UV mapping.

Impressive…

I like the landscape and ocean the most, the way the light ‘shimmers’ off the surface of the water parts are very realistic.

Looks like youve put a lot of work into it, and its payed off.
Will these things be able to work in the apricot release of Blender?

i love the landscape demo ^^ good work

There are 3 texture layers, the first one is the color map. The second one is the normal map. The last texture is the specular map. The specular map is responsible for that awesome water puddle in the middle of the landscape.

All 3 textures are combined with the GLSL shader. This particular shader is based off the normalmap demo from blender.org. Except the specular highlight is masked by the specular texture to control which part of the objects gets specular reflection.

Ah, i guess I have no idea how to use GLSL stuff lol

Could you post a .blend :smiley: ? Please don’t make me beg XD

EDIT: I didn’t see it XD

Ok that’s the coolest blender demo I’ve ever seen XD

C&C’s ehm… the ocean texture displacement needs a bit more work, also the underwater caustics, I think that, that it mirrors across the object is what makes it weird… Other than that! Perfect!

Great “eye-candy”!
Thank you for sharing!
The other “great thing” is that my “poor and old” gfx 7500LE handles
the 70,000? polys at a steady 60 FPS?!
Bye

whoa, those look great :smiley: i wanted to learn GLSL, where’d you start?

Yeah, where do we start? Aprocot uses it also.

I third that :wink: Ok from now on all my games will use GLSL!

Will these things be able to work in the apricot release of Blender?

I am not sure, I just started playing around with the apricot Branch, so far they work with the ‘Use Blender Material’ option, but Apricot has a different/better way of handling GLSL.

C&C’s ehm… the ocean texture displacement needs a bit more work, also the underwater caustics, I think that, that it mirrors across the object is what makes it weird… Other than that! Perfect!

James, do you see the blender file now?
I completely agree with your criticism, the mirror is because of the way the caustics is applied using the existing UV layout, which is mirrored across the middle of the whale.
Ocean is very difficult to get right, I am still looking at different ways of doing it.

The other “great thing” is that my “poor and old” gfx 7500LE handles
the 70,000? polys at a steady 60 FPS?!

Performance of the BGE has been greatly improved over the past release, especially with high polygon count. As long as “Display List” is enabled in the game menu, the game will run fast.

whoa, those look great :smiley: i wanted to learn GLSL, where’d you start?

I used the Orange Book. and a few tutorialsonline.

Very nice, I’ll have a look into that, might even buy the book :smiley:

**Read the tutorial now, very nice read, simple but informative, now I’ll go test it :smiley:

By the way, the underwater caustics, does the GLSL script use some sort of alpha blending on the top say 45% of the model, or is it height based, as in the further you get from the surface, the further you get from the light(alpha slider set to 1 if too far?)

The good thing about Apricot is that now you don’t have to be a programmer to add GLSL, if you have a team you can now have the artists take control over the shaders.:wink: