|
"Ashima" Vertex Noise with Lighting and Texture (Composition by gtoledo3)
Per the conversation here: http://kineme.net/forum/DevelopingCompositions/Environmentmapsandvertexn... I decided to put together an example over morning coffee. This is a GLSL shader that "intercepts" the lighting position, diffuse, specular, and shininess, etc., and basically just sets up a Blinn-Phong model lighting using that info - so Lighting patch controls can be used as expected. Then I added the popular "ashima arts" perlin noise implementation that's been kicking around that I've been seeing in the frag shaders, but placed in the vertex shader - so that there's some tweakable exposure (though I don't really recommend it) instead of just invoking the default noise function. |
Thank you for an inspiring example. I like the noise implementation. Very smooth. Strictly speaking though this is an example of texturing and not environment mapping as an environment map should create a reflection relative to the placement of the object in space instead of to the object.
Oh, interesting point. The orange book environment map shader does that? I'll have to take another look at that. I'll retitle this :)
Hey thanks for that note again; I was just looking over the 3D labs classic environment map. One cool thing I just learned out of it is the "reflect" keyword in GLSL. I'd never noticed that, and always did more complex stuff to get that result.
I like the Ashima / Perlin noise implementation as well. I made a 2D filter awhile back that implements it in the fragment shader, with a few settings that use a feedback loop as a low rent way of getting normals for a lighting effect too.
http://kineme.net/composition/gtoledo3/AshimaNoiseExternalTextureWarp